use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSPersistentStoreRequest, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "NSPersistentStoreRequest")]
pub struct NSBatchInsertRequest;
);
#[cfg(feature = "NSPersistentStoreRequest")]
extern_conformance!(
unsafe impl NSCopying for NSBatchInsertRequest {}
);
#[cfg(feature = "NSPersistentStoreRequest")]
unsafe impl CopyingHelper for NSBatchInsertRequest {
type Result = Self;
}
#[cfg(feature = "NSPersistentStoreRequest")]
extern_conformance!(
unsafe impl NSObjectProtocol for NSBatchInsertRequest {}
);
#[cfg(feature = "NSPersistentStoreRequest")]
impl NSBatchInsertRequest {
extern_methods!(
#[unsafe(method(entityName))]
#[unsafe(method_family = none)]
pub unsafe fn entityName(&self) -> Retained<NSString>;
#[cfg(feature = "NSEntityDescription")]
#[unsafe(method(entity))]
#[unsafe(method_family = none)]
pub unsafe fn entity(&self) -> Option<Retained<NSEntityDescription>>;
#[unsafe(method(objectsToInsert))]
#[unsafe(method_family = none)]
pub unsafe fn objectsToInsert(
&self,
) -> Option<Retained<NSArray<NSDictionary<NSString, AnyObject>>>>;
#[unsafe(method(setObjectsToInsert:))]
#[unsafe(method_family = none)]
pub unsafe fn setObjectsToInsert(
&self,
objects_to_insert: Option<&NSArray<NSDictionary<NSString, AnyObject>>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(dictionaryHandler))]
#[unsafe(method_family = none)]
pub unsafe fn dictionaryHandler(
&self,
) -> *mut block2::DynBlock<dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool>;
#[cfg(feature = "block2")]
#[unsafe(method(setDictionaryHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn setDictionaryHandler(
&self,
dictionary_handler: Option<
&block2::DynBlock<
dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
>,
>,
);
#[cfg(all(feature = "NSManagedObject", feature = "block2"))]
#[unsafe(method(managedObjectHandler))]
#[unsafe(method_family = none)]
pub unsafe fn managedObjectHandler(
&self,
) -> *mut block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>;
#[cfg(all(feature = "NSManagedObject", feature = "block2"))]
#[unsafe(method(setManagedObjectHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn setManagedObjectHandler(
&self,
managed_object_handler: Option<
&block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
>,
);
#[cfg(feature = "NSPersistentStoreResult")]
#[unsafe(method(resultType))]
#[unsafe(method_family = none)]
pub unsafe fn resultType(&self) -> NSBatchInsertRequestResultType;
#[cfg(feature = "NSPersistentStoreResult")]
#[unsafe(method(setResultType:))]
#[unsafe(method_family = none)]
pub unsafe fn setResultType(&self, result_type: NSBatchInsertRequestResultType);
#[unsafe(method(batchInsertRequestWithEntityName:objects:))]
#[unsafe(method_family = none)]
pub unsafe fn batchInsertRequestWithEntityName_objects(
entity_name: &NSString,
dictionaries: &NSArray<NSDictionary<NSString, AnyObject>>,
) -> Retained<Self>;
#[cfg(feature = "block2")]
#[unsafe(method(batchInsertRequestWithEntityName:dictionaryHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn batchInsertRequestWithEntityName_dictionaryHandler(
entity_name: &NSString,
handler: &block2::DynBlock<
dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
>,
) -> Retained<Self>;
#[cfg(all(feature = "NSManagedObject", feature = "block2"))]
#[unsafe(method(batchInsertRequestWithEntityName:managedObjectHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn batchInsertRequestWithEntityName_managedObjectHandler(
entity_name: &NSString,
handler: &block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
) -> Retained<Self>;
#[deprecated]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithEntityName:objects:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithEntityName_objects(
this: Allocated<Self>,
entity_name: &NSString,
dictionaries: &NSArray<NSDictionary<NSString, AnyObject>>,
) -> Retained<Self>;
#[cfg(feature = "NSEntityDescription")]
#[unsafe(method(initWithEntity:objects:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithEntity_objects(
this: Allocated<Self>,
entity: &NSEntityDescription,
dictionaries: &NSArray<NSDictionary<NSString, AnyObject>>,
) -> Retained<Self>;
#[cfg(all(feature = "NSEntityDescription", feature = "block2"))]
#[unsafe(method(initWithEntity:dictionaryHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithEntity_dictionaryHandler(
this: Allocated<Self>,
entity: &NSEntityDescription,
handler: &block2::DynBlock<
dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
>,
) -> Retained<Self>;
#[cfg(all(
feature = "NSEntityDescription",
feature = "NSManagedObject",
feature = "block2"
))]
#[unsafe(method(initWithEntity:managedObjectHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithEntity_managedObjectHandler(
this: Allocated<Self>,
entity: &NSEntityDescription,
handler: &block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
) -> Retained<Self>;
#[cfg(feature = "block2")]
#[unsafe(method(initWithEntityName:dictionaryHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithEntityName_dictionaryHandler(
this: Allocated<Self>,
entity_name: &NSString,
handler: &block2::DynBlock<
dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
>,
) -> Retained<Self>;
#[cfg(all(feature = "NSManagedObject", feature = "block2"))]
#[unsafe(method(initWithEntityName:managedObjectHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithEntityName_managedObjectHandler(
this: Allocated<Self>,
entity_name: &NSString,
handler: &block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
) -> Retained<Self>;
);
}
#[cfg(feature = "NSPersistentStoreRequest")]
impl NSBatchInsertRequest {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}