objc2_device_check/generated/DCError.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 /// The error domain for errors associated with DeviceCheck APIs.
11 ///
12 /// See also [Apple's documentation](https://developer.apple.com/documentation/devicecheck/dcerrordomain?language=objc)
13 pub static DCErrorDomain: &'static NSErrorDomain;
14}
15
16/// DeviceCheck error codes.
17///
18/// See also [Apple's documentation](https://developer.apple.com/documentation/devicecheck/dcerror?language=objc)
19// NS_ERROR_ENUM
20#[repr(transparent)]
21#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
22pub struct DCError(pub NSInteger);
23impl DCError {
24 /// A failure has occurred, such as the failure to generate a token.
25 #[doc(alias = "DCErrorUnknownSystemFailure")]
26 pub const UnknownSystemFailure: Self = Self(0);
27 /// DeviceCheck is unavailable on this device.
28 #[doc(alias = "DCErrorFeatureUnsupported")]
29 pub const FeatureUnsupported: Self = Self(1);
30 /// An error code that indicates when your app provides data that isn’t
31 /// formatted correctly.
32 #[doc(alias = "DCErrorInvalidInput")]
33 pub const InvalidInput: Self = Self(2);
34 /// An error caused by a failed attempt to use the App Attest key.
35 ///
36 /// You receive this error if something goes wrong with generating,
37 /// retrieving, or using an App Attest cryptographic key, when:
38 ///
39 /// - You call
40 /// ``DeviceCheck/DCAppAttestService/attestKey:clientDataHash:completionHandler:``
41 /// for a key that’s already been attested.
42 /// - You call
43 /// ``DeviceCheck/DCAppAttestService/generateAssertion:clientDataHash:completionHandler:``
44 /// with an unattested key.
45 /// - The App Attest service rejects the key.
46 #[doc(alias = "DCErrorInvalidKey")]
47 pub const InvalidKey: Self = Self(3);
48 /// An error that indicates a failed attempt to contact the App Attest service
49 /// during an attestation.
50 ///
51 /// You receive this error when you call
52 /// ``DeviceCheck/DCAppAttestService/attestKey:clientDataHash:completionHandler:``
53 /// and the framework isn’t able to complete the attestation. If you receive
54 /// this error, try the attestation again later using the same key and the same
55 /// value for the `clientDataHash` parameter. Retrying with the same inputs
56 /// helps to preserve the risk metric for a given device.
57 #[doc(alias = "DCErrorServerUnavailable")]
58 pub const ServerUnavailable: Self = Self(4);
59}
60
61unsafe impl Encode for DCError {
62 const ENCODING: Encoding = NSInteger::ENCODING;
63}
64
65unsafe impl RefEncode for DCError {
66 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
67}