use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern "C" {
pub static NSMigrationManagerKey: &'static NSString;
}
extern "C" {
pub static NSMigrationSourceObjectKey: &'static NSString;
}
extern "C" {
pub static NSMigrationDestinationObjectKey: &'static NSString;
}
extern "C" {
pub static NSMigrationEntityMappingKey: &'static NSString;
}
extern "C" {
pub static NSMigrationPropertyMappingKey: &'static NSString;
}
extern "C" {
pub static NSMigrationEntityPolicyKey: &'static NSString;
}
extern_class!(
#[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>>;
);
}
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>;
);
}