1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::CloudKit::*;
use crate::CoreLocation::*;
use crate::Foundation::*;

ns_enum!(
    #[underlying(NSInteger)]
    pub enum CKShareParticipantAcceptanceStatus {
        CKShareParticipantAcceptanceStatusUnknown = 0,
        CKShareParticipantAcceptanceStatusPending = 1,
        CKShareParticipantAcceptanceStatusAccepted = 2,
        CKShareParticipantAcceptanceStatusRemoved = 3,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum CKShareParticipantPermission {
        CKShareParticipantPermissionUnknown = 0,
        CKShareParticipantPermissionNone = 1,
        CKShareParticipantPermissionReadOnly = 2,
        CKShareParticipantPermissionReadWrite = 3,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum CKShareParticipantRole {
        CKShareParticipantRoleUnknown = 0,
        CKShareParticipantRoleOwner = 1,
        CKShareParticipantRolePrivateUser = 3,
        CKShareParticipantRolePublicUser = 4,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    #[deprecated]
    pub enum CKShareParticipantType {
        #[deprecated]
        CKShareParticipantTypeUnknown = 0,
        #[deprecated]
        CKShareParticipantTypeOwner = 1,
        #[deprecated]
        CKShareParticipantTypePrivateUser = 3,
        #[deprecated]
        CKShareParticipantTypePublicUser = 4,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "CloudKit_CKShareParticipant")]
    pub struct CKShareParticipant;

    #[cfg(feature = "CloudKit_CKShareParticipant")]
    unsafe impl ClassType for CKShareParticipant {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "CloudKit_CKShareParticipant")]
unsafe impl NSCoding for CKShareParticipant {}

#[cfg(feature = "CloudKit_CKShareParticipant")]
unsafe impl NSCopying for CKShareParticipant {}

#[cfg(feature = "CloudKit_CKShareParticipant")]
unsafe impl NSObjectProtocol for CKShareParticipant {}

#[cfg(feature = "CloudKit_CKShareParticipant")]
unsafe impl NSSecureCoding for CKShareParticipant {}

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

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;

        #[cfg(feature = "CloudKit_CKUserIdentity")]
        #[method_id(@__retain_semantics Other userIdentity)]
        pub unsafe fn userIdentity(&self) -> Id<CKUserIdentity>;

        #[method(role)]
        pub unsafe fn role(&self) -> CKShareParticipantRole;

        #[method(setRole:)]
        pub unsafe fn setRole(&self, role: CKShareParticipantRole);

        #[deprecated]
        #[method(type)]
        pub unsafe fn r#type(&self) -> CKShareParticipantType;

        #[deprecated]
        #[method(setType:)]
        pub unsafe fn setType(&self, r#type: CKShareParticipantType);

        #[method(acceptanceStatus)]
        pub unsafe fn acceptanceStatus(&self) -> CKShareParticipantAcceptanceStatus;

        #[method(permission)]
        pub unsafe fn permission(&self) -> CKShareParticipantPermission;

        #[method(setPermission:)]
        pub unsafe fn setPermission(&self, permission: CKShareParticipantPermission);
    }
);