objc2_contacts/generated/
CNError.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4use objc2_foundation::*;
5
6use crate::*;
7
8extern "C" {
9    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerrordomain?language=objc)
10    pub static CNErrorDomain: Option<&'static NSString>;
11}
12
13/// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerrorcode?language=objc)
14// NS_ENUM
15#[repr(transparent)]
16#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
17pub struct CNErrorCode(pub NSInteger);
18impl CNErrorCode {
19    #[doc(alias = "CNErrorCodeCommunicationError")]
20    pub const CommunicationError: Self = Self(1);
21    #[doc(alias = "CNErrorCodeDataAccessError")]
22    pub const DataAccessError: Self = Self(2);
23    #[doc(alias = "CNErrorCodeAuthorizationDenied")]
24    pub const AuthorizationDenied: Self = Self(100);
25    #[doc(alias = "CNErrorCodeNoAccessableWritableContainers")]
26    pub const NoAccessableWritableContainers: Self = Self(101);
27    #[doc(alias = "CNErrorCodeUnauthorizedKeys")]
28    pub const UnauthorizedKeys: Self = Self(102);
29    #[doc(alias = "CNErrorCodeFeatureDisabledByUser")]
30    pub const FeatureDisabledByUser: Self = Self(103);
31    #[doc(alias = "CNErrorCodeFeatureNotAvailable")]
32    pub const FeatureNotAvailable: Self = Self(104);
33    #[doc(alias = "CNErrorCodeRecordDoesNotExist")]
34    pub const RecordDoesNotExist: Self = Self(200);
35    #[doc(alias = "CNErrorCodeInsertedRecordAlreadyExists")]
36    pub const InsertedRecordAlreadyExists: Self = Self(201);
37    #[doc(alias = "CNErrorCodeContainmentCycle")]
38    pub const ContainmentCycle: Self = Self(202);
39    #[doc(alias = "CNErrorCodeContainmentScope")]
40    pub const ContainmentScope: Self = Self(203);
41    #[doc(alias = "CNErrorCodeParentRecordDoesNotExist")]
42    pub const ParentRecordDoesNotExist: Self = Self(204);
43    #[doc(alias = "CNErrorCodeRecordIdentifierInvalid")]
44    pub const RecordIdentifierInvalid: Self = Self(205);
45    #[doc(alias = "CNErrorCodeRecordNotWritable")]
46    pub const RecordNotWritable: Self = Self(206);
47    #[doc(alias = "CNErrorCodeParentContainerNotWritable")]
48    pub const ParentContainerNotWritable: Self = Self(207);
49    #[doc(alias = "CNErrorCodeValidationMultipleErrors")]
50    pub const ValidationMultipleErrors: Self = Self(300);
51    #[doc(alias = "CNErrorCodeValidationTypeMismatch")]
52    pub const ValidationTypeMismatch: Self = Self(301);
53    #[doc(alias = "CNErrorCodeValidationConfigurationError")]
54    pub const ValidationConfigurationError: Self = Self(302);
55    #[doc(alias = "CNErrorCodePredicateInvalid")]
56    pub const PredicateInvalid: Self = Self(400);
57    #[doc(alias = "CNErrorCodePolicyViolation")]
58    pub const PolicyViolation: Self = Self(500);
59    #[doc(alias = "CNErrorCodeClientIdentifierInvalid")]
60    pub const ClientIdentifierInvalid: Self = Self(600);
61    #[doc(alias = "CNErrorCodeClientIdentifierDoesNotExist")]
62    pub const ClientIdentifierDoesNotExist: Self = Self(601);
63    #[doc(alias = "CNErrorCodeClientIdentifierCollision")]
64    pub const ClientIdentifierCollision: Self = Self(602);
65    #[doc(alias = "CNErrorCodeChangeHistoryExpired")]
66    pub const ChangeHistoryExpired: Self = Self(603);
67    #[doc(alias = "CNErrorCodeChangeHistoryInvalidAnchor")]
68    pub const ChangeHistoryInvalidAnchor: Self = Self(604);
69    #[doc(alias = "CNErrorCodeChangeHistoryInvalidFetchRequest")]
70    pub const ChangeHistoryInvalidFetchRequest: Self = Self(605);
71    #[doc(alias = "CNErrorCodeVCardMalformed")]
72    pub const VCardMalformed: Self = Self(700);
73    #[doc(alias = "CNErrorCodeVCardSummarizationError")]
74    pub const VCardSummarizationError: Self = Self(701);
75}
76
77unsafe impl Encode for CNErrorCode {
78    const ENCODING: Encoding = NSInteger::ENCODING;
79}
80
81unsafe impl RefEncode for CNErrorCode {
82    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
83}
84
85extern "C" {
86    /// When available an array of one or more CNContact, CNGroup, CNContainer, CNSaveRequest, or CNFetchRequest objects for which the error code applies.
87    ///
88    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerroruserinfoaffectedrecordskey?language=objc)
89    pub static CNErrorUserInfoAffectedRecordsKey: Option<&'static NSString>;
90}
91
92extern "C" {
93    /// When available an array of one or more NSString objects for which the error code applies.
94    ///
95    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerroruserinfoaffectedrecordidentifierskey?language=objc)
96    pub static CNErrorUserInfoAffectedRecordIdentifiersKey: Option<&'static NSString>;
97}
98
99extern "C" {
100    /// An array of NSErrors for CNErrorCodeValidationMultipleErrors.
101    ///
102    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerroruserinfovalidationerrorskey?language=objc)
103    pub static CNErrorUserInfoValidationErrorsKey: Option<&'static NSString>;
104}
105
106extern "C" {
107    /// An array of key paths associated with a given error. For validation errors this will contain key paths to specific object properties.
108    ///
109    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerroruserinfokeypathskey?language=objc)
110    pub static CNErrorUserInfoKeyPathsKey: Option<&'static NSString>;
111}