use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CKShareParticipantAcceptanceStatus(pub NSInteger);
impl CKShareParticipantAcceptanceStatus {
#[doc(alias = "CKShareParticipantAcceptanceStatusUnknown")]
pub const Unknown: Self = Self(0);
#[doc(alias = "CKShareParticipantAcceptanceStatusPending")]
pub const Pending: Self = Self(1);
#[doc(alias = "CKShareParticipantAcceptanceStatusAccepted")]
pub const Accepted: Self = Self(2);
#[doc(alias = "CKShareParticipantAcceptanceStatusRemoved")]
pub const Removed: Self = Self(3);
}
unsafe impl Encode for CKShareParticipantAcceptanceStatus {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CKShareParticipantAcceptanceStatus {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CKShareParticipantPermission(pub NSInteger);
impl CKShareParticipantPermission {
#[doc(alias = "CKShareParticipantPermissionUnknown")]
pub const Unknown: Self = Self(0);
#[doc(alias = "CKShareParticipantPermissionNone")]
pub const None: Self = Self(1);
#[doc(alias = "CKShareParticipantPermissionReadOnly")]
pub const ReadOnly: Self = Self(2);
#[doc(alias = "CKShareParticipantPermissionReadWrite")]
pub const ReadWrite: Self = Self(3);
}
unsafe impl Encode for CKShareParticipantPermission {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CKShareParticipantPermission {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CKShareParticipantRole(pub NSInteger);
impl CKShareParticipantRole {
#[doc(alias = "CKShareParticipantRoleUnknown")]
pub const Unknown: Self = Self(0);
#[doc(alias = "CKShareParticipantRoleOwner")]
pub const Owner: Self = Self(1);
#[doc(alias = "CKShareParticipantRolePrivateUser")]
pub const PrivateUser: Self = Self(3);
#[doc(alias = "CKShareParticipantRolePublicUser")]
pub const PublicUser: Self = Self(4);
#[doc(alias = "CKShareParticipantRoleAdministrator")]
pub const Administrator: Self = Self(2);
}
unsafe impl Encode for CKShareParticipantRole {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CKShareParticipantRole {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CKShareParticipantType(pub NSInteger);
impl CKShareParticipantType {
#[doc(alias = "CKShareParticipantTypeUnknown")]
#[deprecated]
pub const Unknown: Self = Self(0);
#[doc(alias = "CKShareParticipantTypeOwner")]
#[deprecated]
pub const Owner: Self = Self(1);
#[doc(alias = "CKShareParticipantTypePrivateUser")]
#[deprecated]
pub const PrivateUser: Self = Self(3);
#[doc(alias = "CKShareParticipantTypePublicUser")]
#[deprecated]
pub const PublicUser: Self = Self(4);
}
unsafe impl Encode for CKShareParticipantType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CKShareParticipantType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CKShareParticipant;
);
extern_conformance!(
unsafe impl NSCoding for CKShareParticipant {}
);
extern_conformance!(
unsafe impl NSCopying for CKShareParticipant {}
);
unsafe impl CopyingHelper for CKShareParticipant {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CKShareParticipant {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CKShareParticipant {}
);
impl CKShareParticipant {
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>;
#[cfg(feature = "CKUserIdentity")]
#[unsafe(method(userIdentity))]
#[unsafe(method_family = none)]
pub unsafe fn userIdentity(&self) -> Retained<CKUserIdentity>;
#[unsafe(method(role))]
#[unsafe(method_family = none)]
pub unsafe fn role(&self) -> CKShareParticipantRole;
#[unsafe(method(setRole:))]
#[unsafe(method_family = none)]
pub unsafe fn setRole(&self, role: CKShareParticipantRole);
#[deprecated]
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub unsafe fn r#type(&self) -> CKShareParticipantType;
#[deprecated]
#[unsafe(method(setType:))]
#[unsafe(method_family = none)]
pub unsafe fn setType(&self, r#type: CKShareParticipantType);
#[unsafe(method(acceptanceStatus))]
#[unsafe(method_family = none)]
pub unsafe fn acceptanceStatus(&self) -> CKShareParticipantAcceptanceStatus;
#[unsafe(method(permission))]
#[unsafe(method_family = none)]
pub unsafe fn permission(&self) -> CKShareParticipantPermission;
#[unsafe(method(setPermission:))]
#[unsafe(method_family = none)]
pub unsafe fn setPermission(&self, permission: CKShareParticipantPermission);
#[unsafe(method(participantID))]
#[unsafe(method_family = none)]
pub unsafe fn participantID(&self) -> Retained<NSString>;
#[unsafe(method(isApprovedRequester))]
#[unsafe(method_family = none)]
pub unsafe fn isApprovedRequester(&self) -> bool;
#[unsafe(method(dateAddedToShare))]
#[unsafe(method_family = none)]
pub unsafe fn dateAddedToShare(&self) -> Option<Retained<NSDate>>;
#[unsafe(method(oneTimeURLParticipant))]
#[unsafe(method_family = none)]
pub unsafe fn oneTimeURLParticipant() -> Retained<Self>;
);
}