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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    pub static CKErrorDomain: &'static NSString;
}

extern "C" {
    pub static CKPartialErrorsByItemIDKey: &'static NSString;
}

extern "C" {
    pub static CKRecordChangedErrorAncestorRecordKey: &'static NSString;
}

extern "C" {
    pub static CKRecordChangedErrorServerRecordKey: &'static NSString;
}

extern "C" {
    pub static CKRecordChangedErrorClientRecordKey: &'static NSString;
}

extern "C" {
    pub static CKErrorUserDidResetEncryptedDataKey: &'static NSString;
}

extern "C" {
    pub static CKErrorRetryAfterKey: &'static NSString;
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CKErrorCode(pub NSInteger);
impl CKErrorCode {
    pub const CKErrorInternalError: Self = Self(1);
    pub const CKErrorPartialFailure: Self = Self(2);
    pub const CKErrorNetworkUnavailable: Self = Self(3);
    pub const CKErrorNetworkFailure: Self = Self(4);
    pub const CKErrorBadContainer: Self = Self(5);
    pub const CKErrorServiceUnavailable: Self = Self(6);
    pub const CKErrorRequestRateLimited: Self = Self(7);
    pub const CKErrorMissingEntitlement: Self = Self(8);
    pub const CKErrorNotAuthenticated: Self = Self(9);
    pub const CKErrorPermissionFailure: Self = Self(10);
    pub const CKErrorUnknownItem: Self = Self(11);
    pub const CKErrorInvalidArguments: Self = Self(12);
    #[deprecated = "Will not be returned"]
    pub const CKErrorResultsTruncated: Self = Self(13);
    pub const CKErrorServerRecordChanged: Self = Self(14);
    pub const CKErrorServerRejectedRequest: Self = Self(15);
    pub const CKErrorAssetFileNotFound: Self = Self(16);
    pub const CKErrorAssetFileModified: Self = Self(17);
    pub const CKErrorIncompatibleVersion: Self = Self(18);
    pub const CKErrorConstraintViolation: Self = Self(19);
    pub const CKErrorOperationCancelled: Self = Self(20);
    pub const CKErrorChangeTokenExpired: Self = Self(21);
    pub const CKErrorBatchRequestFailed: Self = Self(22);
    pub const CKErrorZoneBusy: Self = Self(23);
    pub const CKErrorBadDatabase: Self = Self(24);
    pub const CKErrorQuotaExceeded: Self = Self(25);
    pub const CKErrorZoneNotFound: Self = Self(26);
    pub const CKErrorLimitExceeded: Self = Self(27);
    pub const CKErrorUserDeletedZone: Self = Self(28);
    pub const CKErrorTooManyParticipants: Self = Self(29);
    pub const CKErrorAlreadyShared: Self = Self(30);
    pub const CKErrorReferenceViolation: Self = Self(31);
    pub const CKErrorManagedAccountRestricted: Self = Self(32);
    pub const CKErrorParticipantMayNeedVerification: Self = Self(33);
    pub const CKErrorServerResponseLost: Self = Self(34);
    pub const CKErrorAssetNotAvailable: Self = Self(35);
    pub const CKErrorAccountTemporarilyUnavailable: Self = Self(36);
}

unsafe impl Encode for CKErrorCode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for CKErrorCode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}