//! 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_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nssavechangesrequest?language=objc)
    #[unsafe(super(NSPersistentStoreRequest, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "NSPersistentStoreRequest")]
    pub struct NSSaveChangesRequest;
);

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

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

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

#[cfg(feature = "NSPersistentStoreRequest")]
impl NSSaveChangesRequest {
    extern_methods!(
        #[cfg(feature = "NSManagedObject")]
        #[unsafe(method(initWithInsertedObjects:updatedObjects:deletedObjects:lockedObjects:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithInsertedObjects_updatedObjects_deletedObjects_lockedObjects(
            this: Allocated<Self>,
            inserted_objects: Option<&NSSet<NSManagedObject>>,
            updated_objects: Option<&NSSet<NSManagedObject>>,
            deleted_objects: Option<&NSSet<NSManagedObject>>,
            locked_objects: Option<&NSSet<NSManagedObject>>,
        ) -> Retained<Self>;

        #[cfg(feature = "NSManagedObject")]
        #[unsafe(method(insertedObjects))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertedObjects(&self) -> Option<Retained<NSSet<NSManagedObject>>>;

        #[cfg(feature = "NSManagedObject")]
        #[unsafe(method(updatedObjects))]
        #[unsafe(method_family = none)]
        pub unsafe fn updatedObjects(&self) -> Option<Retained<NSSet<NSManagedObject>>>;

        #[cfg(feature = "NSManagedObject")]
        #[unsafe(method(deletedObjects))]
        #[unsafe(method_family = none)]
        pub unsafe fn deletedObjects(&self) -> Option<Retained<NSSet<NSManagedObject>>>;

        #[cfg(feature = "NSManagedObject")]
        #[unsafe(method(lockedObjects))]
        #[unsafe(method_family = none)]
        pub unsafe fn lockedObjects(&self) -> Option<Retained<NSSet<NSManagedObject>>>;
    );
}

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