//! 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(feature = "CKOperation")]
    pub struct CKAcceptSharesOperation;

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

#[cfg(feature = "CKOperation")]
unsafe impl NSObjectProtocol for CKAcceptSharesOperation {}

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

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

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

        #[cfg(feature = "CKShareMetadata")]
        #[method(setShareMetadatas:)]
        pub unsafe fn setShareMetadatas(&self, share_metadatas: Option<&NSArray<CKShareMetadata>>);

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

        #[cfg(all(
            feature = "CKRecord",
            feature = "CKShare",
            feature = "CKShareMetadata",
            feature = "block2"
        ))]
        #[method(setPerShareCompletionBlock:)]
        pub unsafe fn setPerShareCompletionBlock(
            &self,
            per_share_completion_block: Option<
                &block2::Block<dyn Fn(NonNull<CKShareMetadata>, *mut CKShare, *mut NSError)>,
            >,
        );

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

        #[cfg(feature = "block2")]
        #[method(setAcceptSharesCompletionBlock:)]
        pub unsafe fn setAcceptSharesCompletionBlock(
            &self,
            accept_shares_completion_block: Option<&block2::Block<dyn Fn(*mut NSError)>>,
        );
    }
);

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