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

use crate::*;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsmigrationmanagerkey?language=objc)
    pub static NSMigrationManagerKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsmigrationsourceobjectkey?language=objc)
    pub static NSMigrationSourceObjectKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsmigrationdestinationobjectkey?language=objc)
    pub static NSMigrationDestinationObjectKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsmigrationentitymappingkey?language=objc)
    pub static NSMigrationEntityMappingKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsmigrationpropertymappingkey?language=objc)
    pub static NSMigrationPropertyMappingKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsmigrationentitypolicykey?language=objc)
    pub static NSMigrationEntityPolicyKey: &'static NSString;
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsentitymigrationpolicy?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSEntityMigrationPolicy;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for NSEntityMigrationPolicy {}
);

impl NSEntityMigrationPolicy {
    extern_methods!(
        #[cfg(all(feature = "NSEntityMapping", feature = "NSMigrationManager"))]
        #[unsafe(method(beginEntityMapping:manager:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn beginEntityMapping_manager_error(
            &self,
            mapping: &NSEntityMapping,
            manager: &NSMigrationManager,
        ) -> Result<(), Retained<NSError>>;

        #[cfg(all(
            feature = "NSEntityMapping",
            feature = "NSManagedObject",
            feature = "NSMigrationManager"
        ))]
        #[unsafe(method(createDestinationInstancesForSourceInstance:entityMapping:manager:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn createDestinationInstancesForSourceInstance_entityMapping_manager_error(
            &self,
            s_instance: &NSManagedObject,
            mapping: &NSEntityMapping,
            manager: &NSMigrationManager,
        ) -> Result<(), Retained<NSError>>;

        #[cfg(all(feature = "NSEntityMapping", feature = "NSMigrationManager"))]
        #[unsafe(method(endInstanceCreationForEntityMapping:manager:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn endInstanceCreationForEntityMapping_manager_error(
            &self,
            mapping: &NSEntityMapping,
            manager: &NSMigrationManager,
        ) -> Result<(), Retained<NSError>>;

        #[cfg(all(
            feature = "NSEntityMapping",
            feature = "NSManagedObject",
            feature = "NSMigrationManager"
        ))]
        #[unsafe(method(createRelationshipsForDestinationInstance:entityMapping:manager:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn createRelationshipsForDestinationInstance_entityMapping_manager_error(
            &self,
            d_instance: &NSManagedObject,
            mapping: &NSEntityMapping,
            manager: &NSMigrationManager,
        ) -> Result<(), Retained<NSError>>;

        #[cfg(all(feature = "NSEntityMapping", feature = "NSMigrationManager"))]
        #[unsafe(method(endRelationshipCreationForEntityMapping:manager:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn endRelationshipCreationForEntityMapping_manager_error(
            &self,
            mapping: &NSEntityMapping,
            manager: &NSMigrationManager,
        ) -> Result<(), Retained<NSError>>;

        #[cfg(all(feature = "NSEntityMapping", feature = "NSMigrationManager"))]
        #[unsafe(method(performCustomValidationForEntityMapping:manager:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn performCustomValidationForEntityMapping_manager_error(
            &self,
            mapping: &NSEntityMapping,
            manager: &NSMigrationManager,
        ) -> Result<(), Retained<NSError>>;

        #[cfg(all(feature = "NSEntityMapping", feature = "NSMigrationManager"))]
        #[unsafe(method(endEntityMapping:manager:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn endEntityMapping_manager_error(
            &self,
            mapping: &NSEntityMapping,
            manager: &NSMigrationManager,
        ) -> Result<(), Retained<NSError>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSEntityMigrationPolicy {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}
