//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
    pub struct CKModifySubscriptionsOperation;

    #[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
    unsafe impl ClassType for CKModifySubscriptionsOperation {
        #[inherits(CKOperation, NSOperation, NSObject)]
        type Super = CKDatabaseOperation;
        type Mutability = InteriorMutable;
    }
);

#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
unsafe impl NSObjectProtocol for CKModifySubscriptionsOperation {}

extern_methods!(
    #[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
    unsafe impl CKModifySubscriptionsOperation {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "CKSubscription")]
        #[method_id(@__retain_semantics Init initWithSubscriptionsToSave:subscriptionIDsToDelete:)]
        pub unsafe fn initWithSubscriptionsToSave_subscriptionIDsToDelete(
            this: Allocated<Self>,
            subscriptions_to_save: Option<&NSArray<CKSubscription>>,
            subscription_i_ds_to_delete: Option<&NSArray<CKSubscriptionID>>,
        ) -> Retained<Self>;

        #[cfg(feature = "CKSubscription")]
        #[method_id(@__retain_semantics Other subscriptionsToSave)]
        pub unsafe fn subscriptionsToSave(&self) -> Option<Retained<NSArray<CKSubscription>>>;

        #[cfg(feature = "CKSubscription")]
        #[method(setSubscriptionsToSave:)]
        pub unsafe fn setSubscriptionsToSave(
            &self,
            subscriptions_to_save: Option<&NSArray<CKSubscription>>,
        );

        #[cfg(feature = "CKSubscription")]
        #[method_id(@__retain_semantics Other subscriptionIDsToDelete)]
        pub unsafe fn subscriptionIDsToDelete(&self)
            -> Option<Retained<NSArray<CKSubscriptionID>>>;

        #[cfg(feature = "CKSubscription")]
        #[method(setSubscriptionIDsToDelete:)]
        pub unsafe fn setSubscriptionIDsToDelete(
            &self,
            subscription_i_ds_to_delete: Option<&NSArray<CKSubscriptionID>>,
        );

        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
        #[method(perSubscriptionSaveBlock)]
        pub unsafe fn perSubscriptionSaveBlock(
            &self,
        ) -> *mut block2::Block<dyn Fn(NonNull<CKSubscriptionID>, *mut CKSubscription, *mut NSError)>;

        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
        #[method(setPerSubscriptionSaveBlock:)]
        pub unsafe fn setPerSubscriptionSaveBlock(
            &self,
            per_subscription_save_block: Option<
                &block2::Block<
                    dyn Fn(NonNull<CKSubscriptionID>, *mut CKSubscription, *mut NSError),
                >,
            >,
        );

        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
        #[method(perSubscriptionDeleteBlock)]
        pub unsafe fn perSubscriptionDeleteBlock(
            &self,
        ) -> *mut block2::Block<dyn Fn(NonNull<CKSubscriptionID>, *mut NSError)>;

        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
        #[method(setPerSubscriptionDeleteBlock:)]
        pub unsafe fn setPerSubscriptionDeleteBlock(
            &self,
            per_subscription_delete_block: Option<
                &block2::Block<dyn Fn(NonNull<CKSubscriptionID>, *mut NSError)>,
            >,
        );

        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
        #[method(modifySubscriptionsCompletionBlock)]
        pub unsafe fn modifySubscriptionsCompletionBlock(
            &self,
        ) -> *mut block2::Block<
            dyn Fn(*mut NSArray<CKSubscription>, *mut NSArray<CKSubscriptionID>, *mut NSError),
        >;

        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
        #[method(setModifySubscriptionsCompletionBlock:)]
        pub unsafe fn setModifySubscriptionsCompletionBlock(
            &self,
            modify_subscriptions_completion_block: Option<
                &block2::Block<
                    dyn Fn(
                        *mut NSArray<CKSubscription>,
                        *mut NSArray<CKSubscriptionID>,
                        *mut NSError,
                    ),
                >,
            >,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
    unsafe impl CKModifySubscriptionsOperation {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);
