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::*;
use objc2_foundation::*;

use crate::*;

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

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

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

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

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

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

impl CKShareMetadata {
    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>;

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

        #[cfg(all(feature = "CKRecord", feature = "CKShare"))]
        #[unsafe(method(share))]
        #[unsafe(method_family = none)]
        pub unsafe fn share(&self) -> Retained<CKShare>;

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

        #[cfg(feature = "CKShareParticipant")]
        /// These properties reflect the participant properties of the user invoking CKFetchShareMetadataOperation
        #[unsafe(method(participantRole))]
        #[unsafe(method_family = none)]
        pub unsafe fn participantRole(&self) -> CKShareParticipantRole;

        #[cfg(feature = "CKShareParticipant")]
        #[unsafe(method(participantStatus))]
        #[unsafe(method_family = none)]
        pub unsafe fn participantStatus(&self) -> CKShareParticipantAcceptanceStatus;

        #[cfg(feature = "CKShareParticipant")]
        #[unsafe(method(participantPermission))]
        #[unsafe(method_family = none)]
        pub unsafe fn participantPermission(&self) -> CKShareParticipantPermission;

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

        #[cfg(feature = "CKRecord")]
        /// This is only present if the share metadata was returned from a CKFetchShareMetadataOperation with shouldFetchRootRecord set to YES
        #[unsafe(method(rootRecord))]
        #[unsafe(method_family = none)]
        pub unsafe fn rootRecord(&self) -> Option<Retained<CKRecord>>;

        #[cfg(feature = "CKShareParticipant")]
        #[deprecated]
        #[unsafe(method(participantType))]
        #[unsafe(method_family = none)]
        pub unsafe fn participantType(&self) -> CKShareParticipantType;

        #[cfg(feature = "CKRecordID")]
        #[deprecated]
        #[unsafe(method(rootRecordID))]
        #[unsafe(method_family = none)]
        pub unsafe fn rootRecordID(&self) -> Retained<CKRecordID>;
    );
}