//! 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 CKFetchSubscriptionsOperation;

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

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

extern_methods!(
    #[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
    unsafe impl CKFetchSubscriptionsOperation {
        #[method_id(@__retain_semantics Other fetchAllSubscriptionsOperation)]
        pub unsafe fn fetchAllSubscriptionsOperation() -> Retained<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "CKSubscription")]
        #[method_id(@__retain_semantics Init initWithSubscriptionIDs:)]
        pub unsafe fn initWithSubscriptionIDs(
            this: Allocated<Self>,
            subscription_i_ds: &NSArray<CKSubscriptionID>,
        ) -> Retained<Self>;

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

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

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

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

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

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

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