objc2-contacts 0.3.2

Bindings to the Contacts framework
Documentation
//! 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" {
    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerrordomain?language=objc)
    pub static CNErrorDomain: Option<&'static NSString>;
}

/// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerrorcode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CNErrorCode(pub NSInteger);
impl CNErrorCode {
    #[doc(alias = "CNErrorCodeCommunicationError")]
    pub const CommunicationError: Self = Self(1);
    #[doc(alias = "CNErrorCodeDataAccessError")]
    pub const DataAccessError: Self = Self(2);
    #[doc(alias = "CNErrorCodeAuthorizationDenied")]
    pub const AuthorizationDenied: Self = Self(100);
    #[doc(alias = "CNErrorCodeNoAccessableWritableContainers")]
    pub const NoAccessableWritableContainers: Self = Self(101);
    #[doc(alias = "CNErrorCodeUnauthorizedKeys")]
    pub const UnauthorizedKeys: Self = Self(102);
    #[doc(alias = "CNErrorCodeFeatureDisabledByUser")]
    pub const FeatureDisabledByUser: Self = Self(103);
    #[doc(alias = "CNErrorCodeFeatureNotAvailable")]
    pub const FeatureNotAvailable: Self = Self(104);
    #[doc(alias = "CNErrorCodeRecordDoesNotExist")]
    pub const RecordDoesNotExist: Self = Self(200);
    #[doc(alias = "CNErrorCodeInsertedRecordAlreadyExists")]
    pub const InsertedRecordAlreadyExists: Self = Self(201);
    #[doc(alias = "CNErrorCodeContainmentCycle")]
    pub const ContainmentCycle: Self = Self(202);
    #[doc(alias = "CNErrorCodeContainmentScope")]
    pub const ContainmentScope: Self = Self(203);
    #[doc(alias = "CNErrorCodeParentRecordDoesNotExist")]
    pub const ParentRecordDoesNotExist: Self = Self(204);
    #[doc(alias = "CNErrorCodeRecordIdentifierInvalid")]
    pub const RecordIdentifierInvalid: Self = Self(205);
    #[doc(alias = "CNErrorCodeRecordNotWritable")]
    pub const RecordNotWritable: Self = Self(206);
    #[doc(alias = "CNErrorCodeParentContainerNotWritable")]
    pub const ParentContainerNotWritable: Self = Self(207);
    #[doc(alias = "CNErrorCodeValidationMultipleErrors")]
    pub const ValidationMultipleErrors: Self = Self(300);
    #[doc(alias = "CNErrorCodeValidationTypeMismatch")]
    pub const ValidationTypeMismatch: Self = Self(301);
    #[doc(alias = "CNErrorCodeValidationConfigurationError")]
    pub const ValidationConfigurationError: Self = Self(302);
    #[doc(alias = "CNErrorCodePredicateInvalid")]
    pub const PredicateInvalid: Self = Self(400);
    #[doc(alias = "CNErrorCodePolicyViolation")]
    pub const PolicyViolation: Self = Self(500);
    #[doc(alias = "CNErrorCodeClientIdentifierInvalid")]
    pub const ClientIdentifierInvalid: Self = Self(600);
    #[doc(alias = "CNErrorCodeClientIdentifierDoesNotExist")]
    pub const ClientIdentifierDoesNotExist: Self = Self(601);
    #[doc(alias = "CNErrorCodeClientIdentifierCollision")]
    pub const ClientIdentifierCollision: Self = Self(602);
    #[doc(alias = "CNErrorCodeChangeHistoryExpired")]
    pub const ChangeHistoryExpired: Self = Self(603);
    #[doc(alias = "CNErrorCodeChangeHistoryInvalidAnchor")]
    pub const ChangeHistoryInvalidAnchor: Self = Self(604);
    #[doc(alias = "CNErrorCodeChangeHistoryInvalidFetchRequest")]
    pub const ChangeHistoryInvalidFetchRequest: Self = Self(605);
    #[doc(alias = "CNErrorCodeVCardMalformed")]
    pub const VCardMalformed: Self = Self(700);
    #[doc(alias = "CNErrorCodeVCardSummarizationError")]
    pub const VCardSummarizationError: Self = Self(701);
}

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

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

extern "C" {
    /// When available an array of one or more CNContact, CNGroup, CNContainer, CNSaveRequest, or CNFetchRequest objects for which the error code applies.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerroruserinfoaffectedrecordskey?language=objc)
    pub static CNErrorUserInfoAffectedRecordsKey: Option<&'static NSString>;
}

extern "C" {
    /// When available an array of one or more NSString objects for which the error code applies.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerroruserinfoaffectedrecordidentifierskey?language=objc)
    pub static CNErrorUserInfoAffectedRecordIdentifiersKey: Option<&'static NSString>;
}

extern "C" {
    /// An array of NSErrors for CNErrorCodeValidationMultipleErrors.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerroruserinfovalidationerrorskey?language=objc)
    pub static CNErrorUserInfoValidationErrorsKey: Option<&'static NSString>;
}

extern "C" {
    /// An array of key paths associated with a given error. For validation errors this will contain key paths to specific object properties.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnerroruserinfokeypathskey?language=objc)
    pub static CNErrorUserInfoKeyPathsKey: Option<&'static NSString>;
}