objc2-core-data 0.3.2

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

use crate::*;

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

#[cfg(feature = "NSPersistentStoreRequest")]
extern_conformance!(
    unsafe impl NSCopying for NSBatchUpdateRequest {}
);

#[cfg(feature = "NSPersistentStoreRequest")]
unsafe impl CopyingHelper for NSBatchUpdateRequest {
    type Result = Self;
}

#[cfg(feature = "NSPersistentStoreRequest")]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSBatchUpdateRequest {}
);

#[cfg(feature = "NSPersistentStoreRequest")]
impl NSBatchUpdateRequest {
    extern_methods!(
        #[unsafe(method(batchUpdateRequestWithEntityName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn batchUpdateRequestWithEntityName(entity_name: &NSString) -> Retained<Self>;

        #[unsafe(method(initWithEntityName:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithEntityName(
            this: Allocated<Self>,
            entity_name: &NSString,
        ) -> Retained<Self>;

        #[cfg(feature = "NSEntityDescription")]
        #[unsafe(method(initWithEntity:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithEntity(
            this: Allocated<Self>,
            entity: &NSEntityDescription,
        ) -> Retained<Self>;

        #[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) -> Retained<NSEntityDescription>;

        #[unsafe(method(predicate))]
        #[unsafe(method_family = none)]
        pub unsafe fn predicate(&self) -> Option<Retained<NSPredicate>>;

        /// Setter for [`predicate`][Self::predicate].
        #[unsafe(method(setPredicate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPredicate(&self, predicate: Option<&NSPredicate>);

        #[unsafe(method(includesSubentities))]
        #[unsafe(method_family = none)]
        pub unsafe fn includesSubentities(&self) -> bool;

        /// Setter for [`includesSubentities`][Self::includesSubentities].
        #[unsafe(method(setIncludesSubentities:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIncludesSubentities(&self, includes_subentities: bool);

        #[cfg(feature = "NSPersistentStoreResult")]
        #[unsafe(method(resultType))]
        #[unsafe(method_family = none)]
        pub unsafe fn resultType(&self) -> NSBatchUpdateRequestResultType;

        #[cfg(feature = "NSPersistentStoreResult")]
        /// Setter for [`resultType`][Self::resultType].
        #[unsafe(method(setResultType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setResultType(&self, result_type: NSBatchUpdateRequestResultType);

        #[unsafe(method(propertiesToUpdate))]
        #[unsafe(method_family = none)]
        pub unsafe fn propertiesToUpdate(&self) -> Option<Retained<NSDictionary>>;

        /// Setter for [`propertiesToUpdate`][Self::propertiesToUpdate].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `properties_to_update` generic should be of the correct type.
        #[unsafe(method(setPropertiesToUpdate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPropertiesToUpdate(&self, properties_to_update: Option<&NSDictionary>);
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "NSPersistentStoreRequest")]
impl NSBatchUpdateRequest {
    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>;
    );
}