//! 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/nsbatchdeleterequest?language=objc)
    #[unsafe(super(NSPersistentStoreRequest, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "NSPersistentStoreRequest")]
    pub struct NSBatchDeleteRequest;
);

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

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

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

#[cfg(feature = "NSPersistentStoreRequest")]
impl NSBatchDeleteRequest {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "NSFetchRequest")]
        /// # Safety
        ///
        /// `fetch` generic should be bound by `NSFetchRequestResult`.
        #[unsafe(method(initWithFetchRequest:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFetchRequest(
            this: Allocated<Self>,
            fetch: &NSFetchRequest,
        ) -> Retained<Self>;

        #[cfg(feature = "NSManagedObjectID")]
        #[unsafe(method(initWithObjectIDs:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithObjectIDs(
            this: Allocated<Self>,
            objects: &NSArray<NSManagedObjectID>,
        ) -> Retained<Self>;

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

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

        #[cfg(feature = "NSFetchRequest")]
        #[unsafe(method(fetchRequest))]
        #[unsafe(method_family = none)]
        pub unsafe fn fetchRequest(&self) -> Retained<NSFetchRequest>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "NSPersistentStoreRequest")]
impl NSBatchDeleteRequest {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}
