//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSPersistentStore;

    unsafe impl ClassType for NSPersistentStore {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for NSPersistentStore {}

extern_methods!(
    unsafe impl NSPersistentStore {
        #[method_id(@__retain_semantics Other metadataForPersistentStoreWithURL:error:_)]
        pub unsafe fn metadataForPersistentStoreWithURL_error(
            url: &NSURL,
        ) -> Result<Retained<NSDictionary<NSString, AnyObject>>, Retained<NSError>>;

        #[method(setMetadata:forPersistentStoreWithURL:error:_)]
        pub unsafe fn setMetadata_forPersistentStoreWithURL_error(
            metadata: Option<&NSDictionary<NSString, AnyObject>>,
            url: &NSURL,
        ) -> Result<(), Retained<NSError>>;

        #[method(migrationManagerClass)]
        pub unsafe fn migrationManagerClass() -> &'static AnyClass;

        #[cfg(feature = "NSPersistentStoreCoordinator")]
        #[method_id(@__retain_semantics Init initWithPersistentStoreCoordinator:configurationName:URL:options:)]
        pub unsafe fn initWithPersistentStoreCoordinator_configurationName_URL_options(
            this: Allocated<Self>,
            root: Option<&NSPersistentStoreCoordinator>,
            name: Option<&NSString>,
            url: &NSURL,
            options: Option<&NSDictionary>,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method(loadMetadata:_)]
        pub unsafe fn loadMetadata(&self) -> Result<(), Retained<NSError>>;

        #[cfg(feature = "NSPersistentStoreCoordinator")]
        #[method_id(@__retain_semantics Other persistentStoreCoordinator)]
        pub unsafe fn persistentStoreCoordinator(
            &self,
        ) -> Option<Retained<NSPersistentStoreCoordinator>>;

        #[method_id(@__retain_semantics Other configurationName)]
        pub unsafe fn configurationName(&self) -> Retained<NSString>;

        #[method_id(@__retain_semantics Other options)]
        pub unsafe fn options(&self) -> Option<Retained<NSDictionary>>;

        #[method_id(@__retain_semantics Other URL)]
        pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;

        #[method(setURL:)]
        pub unsafe fn setURL(&self, url: Option<&NSURL>);

        #[method_id(@__retain_semantics Other identifier)]
        pub unsafe fn identifier(&self) -> Retained<NSString>;

        #[method(setIdentifier:)]
        pub unsafe fn setIdentifier(&self, identifier: Option<&NSString>);

        #[method_id(@__retain_semantics Other type)]
        pub unsafe fn r#type(&self) -> Retained<NSString>;

        #[method(isReadOnly)]
        pub unsafe fn isReadOnly(&self) -> bool;

        #[method(setReadOnly:)]
        pub unsafe fn setReadOnly(&self, read_only: bool);

        #[method_id(@__retain_semantics Other metadata)]
        pub unsafe fn metadata(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;

        #[method(setMetadata:)]
        pub unsafe fn setMetadata(&self, metadata: Option<&NSDictionary<NSString, AnyObject>>);

        #[cfg(feature = "NSPersistentStoreCoordinator")]
        #[method(didAddToPersistentStoreCoordinator:)]
        pub unsafe fn didAddToPersistentStoreCoordinator(
            &self,
            coordinator: &NSPersistentStoreCoordinator,
        );

        #[cfg(feature = "NSPersistentStoreCoordinator")]
        #[method(willRemoveFromPersistentStoreCoordinator:)]
        pub unsafe fn willRemoveFromPersistentStoreCoordinator(
            &self,
            coordinator: Option<&NSPersistentStoreCoordinator>,
        );

        #[cfg(feature = "NSCoreDataCoreSpotlightDelegate")]
        #[method_id(@__retain_semantics Other coreSpotlightExporter)]
        pub unsafe fn coreSpotlightExporter(&self) -> Retained<NSCoreDataCoreSpotlightDelegate>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSPersistentStore {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);
