//! 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/nspersistenthistorytransaction?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSPersistentHistoryTransaction;
);

extern_conformance!(
    unsafe impl NSCopying for NSPersistentHistoryTransaction {}
);

unsafe impl CopyingHelper for NSPersistentHistoryTransaction {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for NSPersistentHistoryTransaction {}
);

impl NSPersistentHistoryTransaction {
    extern_methods!(
        #[cfg(all(feature = "NSEntityDescription", feature = "NSManagedObjectContext"))]
        #[unsafe(method(entityDescriptionWithContext:))]
        #[unsafe(method_family = none)]
        pub unsafe fn entityDescriptionWithContext(
            context: &NSManagedObjectContext,
        ) -> Option<Retained<NSEntityDescription>>;

        #[cfg(feature = "NSEntityDescription")]
        #[unsafe(method(entityDescription))]
        #[unsafe(method_family = none)]
        pub unsafe fn entityDescription() -> Option<Retained<NSEntityDescription>>;

        #[cfg(all(feature = "NSFetchRequest", feature = "NSPersistentStoreRequest"))]
        #[unsafe(method(fetchRequest))]
        #[unsafe(method_family = none)]
        pub unsafe fn fetchRequest() -> Option<Retained<NSFetchRequest>>;

        #[unsafe(method(timestamp))]
        #[unsafe(method_family = none)]
        pub unsafe fn timestamp(&self) -> Retained<NSDate>;

        #[cfg(feature = "NSPersistentHistoryChange")]
        #[unsafe(method(changes))]
        #[unsafe(method_family = none)]
        pub unsafe fn changes(&self) -> Option<Retained<NSArray<NSPersistentHistoryChange>>>;

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

        #[unsafe(method(storeID))]
        #[unsafe(method_family = none)]
        pub unsafe fn storeID(&self) -> Retained<NSString>;

        #[unsafe(method(bundleID))]
        #[unsafe(method_family = none)]
        pub unsafe fn bundleID(&self) -> Retained<NSString>;

        #[unsafe(method(processID))]
        #[unsafe(method_family = none)]
        pub unsafe fn processID(&self) -> Retained<NSString>;

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

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

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

        #[unsafe(method(objectIDNotification))]
        #[unsafe(method_family = none)]
        pub unsafe fn objectIDNotification(&self) -> Retained<NSNotification>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSPersistentHistoryTransaction {
    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>;
    );
}
