objc2_cloud_kit/generated/CKError.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern "C" {
10 /// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckerrordomain?language=objc)
11 pub static CKErrorDomain: &'static NSString;
12}
13
14extern "C" {
15 /// When a CKErrorPartialFailure happens this key will be set in the error's userInfo dictionary.
16 ///
17 ///
18 /// The value of this key will be a dictionary, and the values will be errors for individual items with the keys being the item IDs that failed.
19 ///
20 /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckpartialerrorsbyitemidkey?language=objc)
21 pub static CKPartialErrorsByItemIDKey: &'static NSString;
22}
23
24extern "C" {
25 /// If the server rejects a record save because it has been modified since the last time it was read,
26 /// a
27 /// `CKErrorServerRecordChanged`will be returned. The error's
28 /// `userInfo`dictionary will contain
29 /// a
30 /// `CKRecord`keyed by
31 /// `CKRecordChangedErrorAncestorRecordKey.`This is the original
32 /// record used as a basis for making your changes.
33 ///
34 /// Note that if you had attempted to save a new
35 /// `CKRecord`instance, this record may not have any
36 /// key / value pairs set on it, as there was no
37 /// `CKRecord`instance that represents an ancestor point.
38 ///
39 /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckrecordchangederrorancestorrecordkey?language=objc)
40 pub static CKRecordChangedErrorAncestorRecordKey: &'static NSString;
41}
42
43extern "C" {
44 /// If the server rejects a record save because it has been modified since the last time it was read,
45 /// a
46 /// `CKErrorServerRecordChanged`will be returned. The error's
47 /// `userInfo`dictionary will contain
48 /// a
49 /// `CKRecord`keyed by
50 /// `CKRecordChangedErrorServerRecordKey.`This is the record
51 /// object that was found on the server.
52 ///
53 /// Use this record as the basis for merging your changes.
54 ///
55 /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckrecordchangederrorserverrecordkey?language=objc)
56 pub static CKRecordChangedErrorServerRecordKey: &'static NSString;
57}
58
59extern "C" {
60 /// If the server rejects a record save because it has been modified since the last time it was read,
61 /// a
62 /// `CKErrorServerRecordChanged`will be returned. The error's
63 /// `userInfo`dictionary will contain
64 /// a
65 /// `CKRecord`keyed by
66 /// `CKRecordChangedErrorClientRecordKey.`This is the record
67 /// object that you tried to save.
68 ///
69 /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckrecordchangederrorclientrecordkey?language=objc)
70 pub static CKRecordChangedErrorClientRecordKey: &'static NSString;
71}
72
73extern "C" {
74 /// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckerroruserdidresetencrypteddatakey?language=objc)
75 pub static CKErrorUserDidResetEncryptedDataKey: &'static NSString;
76}
77
78extern "C" {
79 /// On some errors, the userInfo dictionary may contain a NSNumber instance that specifies the period of time in seconds after which the client may retry the request. For example, this key will be on
80 /// `CKErrorServiceUnavailable,``CKErrorRequestRateLimited,`and other errors for which the recommended resolution is to retry after a delay.
81 ///
82 /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckerrorretryafterkey?language=objc)
83 pub static CKErrorRetryAfterKey: &'static NSString;
84}
85
86/// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckerrorcode?language=objc)
87// NS_ENUM
88#[repr(transparent)]
89#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
90pub struct CKErrorCode(pub NSInteger);
91impl CKErrorCode {
92 /// CloudKit.framework encountered an error. This is a non-recoverable error.
93 #[doc(alias = "CKErrorInternalError")]
94 pub const InternalError: Self = Self(1);
95 /// Some items failed, but the operation succeeded overall. Check CKPartialErrorsByItemIDKey in the userInfo dictionary for more details.
96 /// This error is only returned from CKOperation completion blocks, which are deprecated in swift.
97 /// It will not be returned from (swift-only) CKOperation result blocks, which are their replacements
98 #[doc(alias = "CKErrorPartialFailure")]
99 pub const PartialFailure: Self = Self(2);
100 /// Network not available
101 #[doc(alias = "CKErrorNetworkUnavailable")]
102 pub const NetworkUnavailable: Self = Self(3);
103 /// Network error (available but CFNetwork gave us an error)
104 #[doc(alias = "CKErrorNetworkFailure")]
105 pub const NetworkFailure: Self = Self(4);
106 /// Un-provisioned or unauthorized container. Try provisioning the container before retrying the operation.
107 #[doc(alias = "CKErrorBadContainer")]
108 pub const BadContainer: Self = Self(5);
109 /// Service unavailable
110 #[doc(alias = "CKErrorServiceUnavailable")]
111 pub const ServiceUnavailable: Self = Self(6);
112 /// Client is being rate limited
113 #[doc(alias = "CKErrorRequestRateLimited")]
114 pub const RequestRateLimited: Self = Self(7);
115 /// Missing entitlement
116 #[doc(alias = "CKErrorMissingEntitlement")]
117 pub const MissingEntitlement: Self = Self(8);
118 /// Not authenticated (writing without being logged in, no user record)
119 #[doc(alias = "CKErrorNotAuthenticated")]
120 pub const NotAuthenticated: Self = Self(9);
121 /// Access failure (save, fetch, or shareAccept)
122 #[doc(alias = "CKErrorPermissionFailure")]
123 pub const PermissionFailure: Self = Self(10);
124 /// Record does not exist
125 #[doc(alias = "CKErrorUnknownItem")]
126 pub const UnknownItem: Self = Self(11);
127 /// Bad client request (bad record graph, malformed predicate)
128 #[doc(alias = "CKErrorInvalidArguments")]
129 pub const InvalidArguments: Self = Self(12);
130 /// Bad client request (bad record graph, malformed predicate)
131 #[doc(alias = "CKErrorResultsTruncated")]
132 #[deprecated = "Will not be returned"]
133 pub const ResultsTruncated: Self = Self(13);
134 /// The record was rejected because the version on the server was different
135 #[doc(alias = "CKErrorServerRecordChanged")]
136 pub const ServerRecordChanged: Self = Self(14);
137 /// The server rejected this request. This is a non-recoverable error
138 #[doc(alias = "CKErrorServerRejectedRequest")]
139 pub const ServerRejectedRequest: Self = Self(15);
140 /// Asset file was not found
141 #[doc(alias = "CKErrorAssetFileNotFound")]
142 pub const AssetFileNotFound: Self = Self(16);
143 /// Asset file content was modified while being saved
144 #[doc(alias = "CKErrorAssetFileModified")]
145 pub const AssetFileModified: Self = Self(17);
146 /// App version is less than the minimum allowed version
147 #[doc(alias = "CKErrorIncompatibleVersion")]
148 pub const IncompatibleVersion: Self = Self(18);
149 /// The server rejected the request because there was a conflict with a unique field.
150 #[doc(alias = "CKErrorConstraintViolation")]
151 pub const ConstraintViolation: Self = Self(19);
152 /// A CKOperation was explicitly cancelled
153 #[doc(alias = "CKErrorOperationCancelled")]
154 pub const OperationCancelled: Self = Self(20);
155 /// The previousServerChangeToken value is too old and the client must re-sync from scratch
156 #[doc(alias = "CKErrorChangeTokenExpired")]
157 pub const ChangeTokenExpired: Self = Self(21);
158 /// One of the items in this batch operation failed in a zone with atomic updates, so the entire batch was rejected.
159 #[doc(alias = "CKErrorBatchRequestFailed")]
160 pub const BatchRequestFailed: Self = Self(22);
161 /// The server is too busy to handle this zone operation. Try the operation again in a few seconds.
162 #[doc(alias = "CKErrorZoneBusy")]
163 pub const ZoneBusy: Self = Self(23);
164 /// Operation could not be completed on the given database. Likely caused by attempting to modify zones in the public database.
165 #[doc(alias = "CKErrorBadDatabase")]
166 pub const BadDatabase: Self = Self(24);
167 /// Saving a record would exceed quota
168 #[doc(alias = "CKErrorQuotaExceeded")]
169 pub const QuotaExceeded: Self = Self(25);
170 /// The specified zone does not exist on the server
171 #[doc(alias = "CKErrorZoneNotFound")]
172 pub const ZoneNotFound: Self = Self(26);
173 /// The request to the server was too large. Retry this request as a smaller batch.
174 #[doc(alias = "CKErrorLimitExceeded")]
175 pub const LimitExceeded: Self = Self(27);
176 /// The user deleted this zone through the settings UI. Your client should either remove its local data or prompt the user before attempting to re-upload any data to this zone.
177 #[doc(alias = "CKErrorUserDeletedZone")]
178 pub const UserDeletedZone: Self = Self(28);
179 /// A share cannot be saved because there are too many participants attached to the share
180 #[doc(alias = "CKErrorTooManyParticipants")]
181 pub const TooManyParticipants: Self = Self(29);
182 /// A record/share cannot be saved, doing so would cause a hierarchy of records to exist in multiple shares
183 #[doc(alias = "CKErrorAlreadyShared")]
184 pub const AlreadyShared: Self = Self(30);
185 /// The target of a record's parent or share reference was not found
186 #[doc(alias = "CKErrorReferenceViolation")]
187 pub const ReferenceViolation: Self = Self(31);
188 /// Request was rejected due to a managed account restriction
189 #[doc(alias = "CKErrorManagedAccountRestricted")]
190 pub const ManagedAccountRestricted: Self = Self(32);
191 /// Share Metadata cannot be determined, because the user is not a member of the share. There are invited participants on the share with email addresses or phone numbers not associated with any iCloud account. The user may be able to join the share if they can associate one of those email addresses or phone numbers with their iCloud account via the system Share Accept UI. Call UIApplication's openURL on this share URL to have the user attempt to verify their information.
192 #[doc(alias = "CKErrorParticipantMayNeedVerification")]
193 pub const ParticipantMayNeedVerification: Self = Self(33);
194 /// The server received and processed this request, but the response was lost due to a network failure. There is no guarantee that this request succeeded. Your client should re-issue the request (if it is idempotent), or fetch data from the server to determine if the request succeeded.
195 #[doc(alias = "CKErrorServerResponseLost")]
196 pub const ServerResponseLost: Self = Self(34);
197 /// The file for this asset could not be accessed. It is likely your application does not have permission to open the file, or the file may be temporarily unavailable due to its data protection class. This operation can be retried after it is able to be opened in your process.
198 #[doc(alias = "CKErrorAssetNotAvailable")]
199 pub const AssetNotAvailable: Self = Self(35);
200 /// The current account is in a state that may need user intervention to recover from. The user should be directed to check the Settings app. Listen for CKAccountChangedNotifications to know when to re-check account status and retry.
201 #[doc(alias = "CKErrorAccountTemporarilyUnavailable")]
202 pub const AccountTemporarilyUnavailable: Self = Self(36);
203 /// The user is already an invited participant on this share. They must accept the existing share invitation before continuing.
204 #[doc(alias = "CKErrorParticipantAlreadyInvited")]
205 pub const ParticipantAlreadyInvited: Self = Self(37);
206}
207
208unsafe impl Encode for CKErrorCode {
209 const ENCODING: Encoding = NSInteger::ENCODING;
210}
211
212unsafe impl RefEncode for CKErrorCode {
213 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
214}