objc2-cloud-kit 0.3.2

Bindings to the CloudKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-contacts")]
#[cfg(not(target_os = "tvos"))]
use objc2_contacts::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckshareaccessrequester?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CKShareAccessRequester;
);

unsafe impl Send for CKShareAccessRequester {}

unsafe impl Sync for CKShareAccessRequester {}

extern_conformance!(
    unsafe impl NSCoding for CKShareAccessRequester {}
);

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

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

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

extern_conformance!(
    unsafe impl NSSecureCoding for CKShareAccessRequester {}
);

impl CKShareAccessRequester {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "CKUserIdentity")]
        /// The identity of the user requesting access to the share.
        #[unsafe(method(userIdentity))]
        #[unsafe(method_family = none)]
        pub unsafe fn userIdentity(&self) -> Retained<CKUserIdentity>;

        #[cfg(feature = "CKUserIdentityLookupInfo")]
        /// Lookup information for the requester.
        ///
        /// Use this lookup info with ``CKFetchShareParticipantsOperation`` to fetch the corresponding participant.
        /// Once fetched, add the participant to the share to approve the requester.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(participantLookupInfo))]
        #[unsafe(method_family = none)]
        pub unsafe fn participantLookupInfo(&self) -> Retained<CKUserIdentityLookupInfo>;

        #[cfg(feature = "objc2-contacts")]
        #[cfg(not(target_os = "tvos"))]
        /// A displayable `CNContact` representing the requester.
        ///
        /// If the requester doesn't exist in the user's contacts or is not accessible, returns a newly created `CNContact`.
        /// This provides formatted requester information suitable for display in the application's UI.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(contact))]
        #[unsafe(method_family = none)]
        pub unsafe fn contact(&self) -> Retained<CNContact>;
    );
}