objc2_exposure_notification/generated/
ENCommon.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11    /// NSError domain for Exposure Notification errors.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enerrordomain?language=objc)
14    pub static ENErrorDomain: &'static NSErrorDomain;
15}
16
17/// Error codes used with ENErrorDomain.
18///
19/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enerrorcode?language=objc)
20// NS_ERROR_ENUM
21#[repr(transparent)]
22#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
23pub struct ENErrorCode(pub NSInteger);
24impl ENErrorCode {
25    #[doc(alias = "ENErrorCodeUnknown")]
26    pub const Unknown: Self = Self(1);
27    /// Underlying failure with an unknown cause.
28    #[doc(alias = "ENErrorCodeBadParameter")]
29    pub const BadParameter: Self = Self(2);
30    /// Missing or incorrect parameter.
31    #[doc(alias = "ENErrorCodeNotEntitled")]
32    pub const NotEntitled: Self = Self(3);
33    /// Calling process doesn't have the correct entitlement.
34    #[doc(alias = "ENErrorCodeNotAuthorized")]
35    pub const NotAuthorized: Self = Self(4);
36    /// User denied this process access to Exposure Notification functionality.
37    #[doc(alias = "ENErrorCodeUnsupported")]
38    pub const Unsupported: Self = Self(5);
39    /// Operation is not supported.
40    #[doc(alias = "ENErrorCodeInvalidated")]
41    pub const Invalidated: Self = Self(6);
42    /// Invalidate was called before the operation completed normally.
43    #[doc(alias = "ENErrorCodeBluetoothOff")]
44    pub const BluetoothOff: Self = Self(7);
45    /// Bluetooth was turned off the by user.
46    #[doc(alias = "ENErrorCodeInsufficientStorage")]
47    pub const InsufficientStorage: Self = Self(8);
48    /// Insufficient storage space to enable Exposure Notification.
49    #[doc(alias = "ENErrorCodeNotEnabled")]
50    pub const NotEnabled: Self = Self(9);
51    /// Exposure Notification has not been enabled.
52    #[doc(alias = "ENErrorCodeAPIMisuse")]
53    pub const APIMisuse: Self = Self(10);
54    /// The API was used incorrectly.
55    #[doc(alias = "ENErrorCodeInternal")]
56    pub const Internal: Self = Self(11);
57    /// Internal error. This indicates a bug in this framework.
58    #[doc(alias = "ENErrorCodeInsufficientMemory")]
59    pub const InsufficientMemory: Self = Self(12);
60    /// Not enough memory to perform an operation.
61    #[doc(alias = "ENErrorCodeRateLimited")]
62    pub const RateLimited: Self = Self(13);
63    /// API called too frequently. See API for acceptable frequency.
64    #[doc(alias = "ENErrorCodeRestricted")]
65    pub const Restricted: Self = Self(14);
66    /// Exposure Notification is disabled due to system policies.
67    #[doc(alias = "ENErrorCodeBadFormat")]
68    pub const BadFormat: Self = Self(15);
69    /// File or data format problem.
70    #[doc(alias = "ENErrorCodeDataInaccessible")]
71    pub const DataInaccessible: Self = Self(16);
72    /// The device must be unlocked before data is accessible.
73    #[doc(alias = "ENErrorCodeTravelStatusNotAvailable")]
74    pub const TravelStatusNotAvailable: Self = Self(17);
75}
76
77unsafe impl Encode for ENErrorCode {
78    const ENCODING: Encoding = NSInteger::ENCODING;
79}
80
81unsafe impl RefEncode for ENErrorCode {
82    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
83}
84
85/// Type for returning NSError's from functions. Avoids long and repetitious method signatures.
86///
87/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enerrorouttype?language=objc)
88pub type ENErrorOutType = *mut *mut NSError;
89
90/// Attenuation of a radio signal. This is the Advertised Transmit Power - Measured RSSI.
91///
92/// Note: The attenuation value may be misleading because more attenuation doesn’t necessarily mean the device is farther
93/// away. For example, two people could be very close and facing each other with their phones in their back pockets. This
94/// may report higher attenuation (i.e. weaker received signal) even though the individuals are very close together.
95///
96/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enattenuation?language=objc)
97pub type ENAttenuation = u8;
98
99/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enattenuationmin?language=objc)
100pub const ENAttenuationMin: c_uint = 0;
101/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enattenuationmax?language=objc)
102pub const ENAttenuationMax: c_uint = 0xFF;
103
104/// Indicates the status of authorization for the app.
105///
106/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enauthorizationstatus?language=objc)
107// NS_ENUM
108#[repr(transparent)]
109#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
110pub struct ENAuthorizationStatus(pub NSInteger);
111impl ENAuthorizationStatus {
112    /// Authorization status has not yet been determined.
113    /// This status means the user has not been prompted yet. Using the API in this state may prompt the user.
114    #[doc(alias = "ENAuthorizationStatusUnknown")]
115    pub const Unknown: Self = Self(0);
116    /// This app is not authorized to use Exposure Notification. The user cannot change this app's authorization status.
117    /// This status may be due to active restrictions, such as parental controls being in place.
118    #[doc(alias = "ENAuthorizationStatusRestricted")]
119    pub const Restricted: Self = Self(1);
120    /// The user denied authorization for this app.
121    #[doc(alias = "ENAuthorizationStatusNotAuthorized")]
122    pub const NotAuthorized: Self = Self(2);
123    /// The user has authorized this app to use Exposure Notification.
124    #[doc(alias = "ENAuthorizationStatusAuthorized")]
125    pub const Authorized: Self = Self(3);
126}
127
128unsafe impl Encode for ENAuthorizationStatus {
129    const ENCODING: Encoding = NSInteger::ENCODING;
130}
131
132unsafe impl RefEncode for ENAuthorizationStatus {
133    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
134}
135
136/// Confidence in calibration data.
137///
138/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/encalibrationconfidence?language=objc)
139// NS_ENUM
140#[repr(transparent)]
141#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
142pub struct ENCalibrationConfidence(pub u8);
143impl ENCalibrationConfidence {
144    /// No calibration data.
145    #[doc(alias = "ENCalibrationConfidenceLowest")]
146    pub const Lowest: Self = Self(0);
147    /// Using average calibration over phones of this manufacturer or Android beacons from EN API version
148    /// <
149    /// 1.5.
150    #[doc(alias = "ENCalibrationConfidenceLow")]
151    pub const Low: Self = Self(1);
152    /// Using single-antenna orientation for a similar phone model or iPhone beacons from EN API version
153    /// <
154    /// 1.5.
155    #[doc(alias = "ENCalibrationConfidenceMedium")]
156    pub const Medium: Self = Self(2);
157    /// Determined using significant calibration data for this model.
158    #[doc(alias = "ENCalibrationConfidenceHigh")]
159    pub const High: Self = Self(3);
160}
161
162unsafe impl Encode for ENCalibrationConfidence {
163    const ENCODING: Encoding = u8::ENCODING;
164}
165
166unsafe impl RefEncode for ENCalibrationConfidence {
167    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
168}
169
170/// The value used when days since onset of symptoms is unspecified.
171///
172/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/endayssinceonsetofsymptomsunknown?language=objc)
173#[deprecated = "Server must provide keys with days_since_onset_of_symptoms set."]
174pub static ENDaysSinceOnsetOfSymptomsUnknown: NSInteger = NSIntegerMax as _;
175
176/// How positive diagnosis was reported.
177///
178/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/endiagnosisreporttype?language=objc)
179// NS_ENUM
180#[repr(transparent)]
181#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
182pub struct ENDiagnosisReportType(pub u32);
183impl ENDiagnosisReportType {
184    /// Diagnosis type unknown or not available.
185    #[doc(alias = "ENDiagnosisReportTypeUnknown")]
186    pub const Unknown: Self = Self(0);
187    /// Confirmed test.
188    #[doc(alias = "ENDiagnosisReportTypeConfirmedTest")]
189    pub const ConfirmedTest: Self = Self(1);
190    /// Confirmed clinical diagnosis.
191    #[doc(alias = "ENDiagnosisReportTypeConfirmedClinicalDiagnosis")]
192    pub const ConfirmedClinicalDiagnosis: Self = Self(2);
193    /// User reported positive diagnosis without health authority involvement.
194    #[doc(alias = "ENDiagnosisReportTypeSelfReported")]
195    pub const SelfReported: Self = Self(3);
196    /// Person determined to be positive based on exposure to another person confirmed to be positive. This report type
197    /// is reserved for future use and keys with this report type are not matched by iOS.
198    #[doc(alias = "ENDiagnosisReportTypeRecursive")]
199    pub const Recursive: Self = Self(4);
200    /// Negative test. This is mainly to negate a previous self report or clinical diagnosis that may have been in error.
201    #[doc(alias = "ENDiagnosisReportTypeRevoked")]
202    pub const Revoked: Self = Self(5);
203}
204
205unsafe impl Encode for ENDiagnosisReportType {
206    const ENCODING: Encoding = u32::ENCODING;
207}
208
209unsafe impl RefEncode for ENDiagnosisReportType {
210    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
211}
212
213/// How infectious based on days since onset of symptoms.
214///
215/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/eninfectiousness?language=objc)
216// NS_ENUM
217#[repr(transparent)]
218#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
219pub struct ENInfectiousness(pub u32);
220impl ENInfectiousness {
221    #[doc(alias = "ENInfectiousnessNone")]
222    pub const None: Self = Self(0);
223    /// Never returned through the API, but used for configuration.
224    #[doc(alias = "ENInfectiousnessStandard")]
225    pub const Standard: Self = Self(1);
226    /// Never returned through the API, but used for configuration.
227    #[doc(alias = "ENInfectiousnessHigh")]
228    pub const High: Self = Self(2);
229}
230
231unsafe impl Encode for ENInfectiousness {
232    const ENCODING: Encoding = u32::ENCODING;
233}
234
235unsafe impl RefEncode for ENInfectiousness {
236    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
237}
238
239/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/envariantofconcerntype?language=objc)
240// NS_ENUM
241#[repr(transparent)]
242#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
243pub struct ENVariantOfConcernType(pub u32);
244impl ENVariantOfConcernType {
245    #[doc(alias = "ENVariantOfConcernTypeUnknown")]
246    pub const TypeUnknown: Self = Self(0);
247    #[doc(alias = "ENVariantOfConcernType1")]
248    pub const Type1: Self = Self(1);
249    #[doc(alias = "ENVariantOfConcernType2")]
250    pub const Type2: Self = Self(2);
251    #[doc(alias = "ENVariantOfConcernType3")]
252    pub const Type3: Self = Self(3);
253    #[doc(alias = "ENVariantOfConcernType4")]
254    pub const Type4: Self = Self(4);
255}
256
257unsafe impl Encode for ENVariantOfConcernType {
258    const ENCODING: Encoding = u32::ENCODING;
259}
260
261unsafe impl RefEncode for ENVariantOfConcernType {
262    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
263}
264
265/// ENIntervalNumber (ENIN)
266///
267/// A number for each 10 minute window that is shared between all devices participating in the protocol.
268/// These time windows are based Unix Time (epoch 1970-01-01 00:00:00). It's calculated as:
269///
270/// ENIN =
271/// <Seconds
272/// since 1970-01-01 00:00:00> / ( 60 * 10 )
273///
274/// It's encoded as an unsigned 32-bit (uint32_t), little endian value.
275///
276/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enintervalnumber?language=objc)
277pub type ENIntervalNumber = u32;
278
279/// Represents a risk level, ranging from 0-7.
280///
281/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevel?language=objc)
282pub type ENRiskLevel = u8;
283
284/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevelmin?language=objc)
285pub const ENRiskLevelMin: c_uint = 0;
286/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevelmax?language=objc)
287pub const ENRiskLevelMax: c_uint = 7;
288
289/// The value, ranging from 0 to 8, that the app assigns to each Risk Level in each of the Risk Level Parameters.
290///
291/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevelvalue?language=objc)
292pub type ENRiskLevelValue = u8;
293
294/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevelvaluemin?language=objc)
295pub const ENRiskLevelValueMin: c_uint = 0;
296/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevelvaluemax?language=objc)
297pub const ENRiskLevelValueMax: c_uint = 8;
298
299/// Represents estimated risk calculated by a scoring algorithm. Range is 0-255. 255 is the highest risk.
300///
301/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskscore?language=objc)
302pub type ENRiskScore = u8;
303
304/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskscoremin?language=objc)
305pub const ENRiskScoreMin: c_uint = 0;
306/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskscoremax?language=objc)
307pub const ENRiskScoreMax: c_uint = 255;
308
309/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskweightdefault?language=objc)
310pub const ENRiskWeightDefault: c_uint = 1;
311/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskweightdefaultv2?language=objc)
312pub const ENRiskWeightDefaultV2: c_uint = 100;
313/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskweightmin?language=objc)
314pub const ENRiskWeightMin: c_uint = 0;
315/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskweightmax?language=objc)
316pub const ENRiskWeightMax: c_uint = 100;
317/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskweightmaxv2?language=objc)
318pub const ENRiskWeightMaxV2: c_uint = 250;
319
320/// Invoked when an operation completes. Error is nil for success or non-nil if an error occurred.
321///
322/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enerrorhandler?language=objc)
323#[cfg(feature = "block2")]
324pub type ENErrorHandler = *mut block2::DynBlock<dyn Fn(*mut NSError)>;
325
326extern_class!(
327    /// Configuration parameters for exposure detection.
328    ///
329    /// Configuration parameters are used to calculate an exposure duration for each exposure using the following formula.
330    ///
331    /// exposureDuration =
332    /// ( ( immediateDuration * immediateDurationWeight ) +
333    /// ( nearDuration      * nearDurationWeight ) +
334    /// ( mediumDuration    * mediumDurationWeight ) +
335    /// ( otherDuration     * otherDurationWeight ) )
336    /// infectiousnessWeight )
337    /// reportTypeWeight )
338    ///
339    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposureconfiguration?language=objc)
340    #[unsafe(super(NSObject))]
341    #[derive(Debug, PartialEq, Eq, Hash)]
342    pub struct ENExposureConfiguration;
343);
344
345extern_conformance!(
346    unsafe impl NSObjectProtocol for ENExposureConfiguration {}
347);
348
349impl ENExposureConfiguration {
350    extern_methods!(
351        /// Weights to apply to durations at each proximity level based on attenuation. Range is 0-250%.
352        #[unsafe(method(immediateDurationWeight))]
353        #[unsafe(method_family = none)]
354        pub unsafe fn immediateDurationWeight(&self) -> c_double;
355
356        /// Setter for [`immediateDurationWeight`][Self::immediateDurationWeight].
357        #[unsafe(method(setImmediateDurationWeight:))]
358        #[unsafe(method_family = none)]
359        pub unsafe fn setImmediateDurationWeight(&self, immediate_duration_weight: c_double);
360
361        #[unsafe(method(nearDurationWeight))]
362        #[unsafe(method_family = none)]
363        pub unsafe fn nearDurationWeight(&self) -> c_double;
364
365        /// Setter for [`nearDurationWeight`][Self::nearDurationWeight].
366        #[unsafe(method(setNearDurationWeight:))]
367        #[unsafe(method_family = none)]
368        pub unsafe fn setNearDurationWeight(&self, near_duration_weight: c_double);
369
370        #[unsafe(method(mediumDurationWeight))]
371        #[unsafe(method_family = none)]
372        pub unsafe fn mediumDurationWeight(&self) -> c_double;
373
374        /// Setter for [`mediumDurationWeight`][Self::mediumDurationWeight].
375        #[unsafe(method(setMediumDurationWeight:))]
376        #[unsafe(method_family = none)]
377        pub unsafe fn setMediumDurationWeight(&self, medium_duration_weight: c_double);
378
379        #[unsafe(method(otherDurationWeight))]
380        #[unsafe(method_family = none)]
381        pub unsafe fn otherDurationWeight(&self) -> c_double;
382
383        /// Setter for [`otherDurationWeight`][Self::otherDurationWeight].
384        #[unsafe(method(setOtherDurationWeight:))]
385        #[unsafe(method_family = none)]
386        pub unsafe fn setOtherDurationWeight(&self, other_duration_weight: c_double);
387
388        /// Maps daysSinceOnsetOfSymptoms to infectiousness. Must be configured if using V2 scoring.
389        /// Key is a daysSinceOnsetOfSymptoms: -14 to 14. Value is an ENInfectiousness.
390        /// Defaults to ENInfectiousnessNone for days not specified.
391        /// If a value is set to ENInfectiousnessNone, diagnosis keys for it should be ignored.
392        #[unsafe(method(infectiousnessForDaysSinceOnsetOfSymptoms))]
393        #[unsafe(method_family = none)]
394        pub unsafe fn infectiousnessForDaysSinceOnsetOfSymptoms(
395            &self,
396        ) -> Option<Retained<NSDictionary<NSNumber, NSNumber>>>;
397
398        /// Setter for [`infectiousnessForDaysSinceOnsetOfSymptoms`][Self::infectiousnessForDaysSinceOnsetOfSymptoms].
399        ///
400        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
401        #[unsafe(method(setInfectiousnessForDaysSinceOnsetOfSymptoms:))]
402        #[unsafe(method_family = none)]
403        pub unsafe fn setInfectiousnessForDaysSinceOnsetOfSymptoms(
404            &self,
405            infectiousness_for_days_since_onset_of_symptoms: Option<
406                &NSDictionary<NSNumber, NSNumber>,
407            >,
408        );
409
410        /// Weights to apply for infectiousness. Range is 0-250%.
411        #[unsafe(method(infectiousnessStandardWeight))]
412        #[unsafe(method_family = none)]
413        pub unsafe fn infectiousnessStandardWeight(&self) -> c_double;
414
415        /// Setter for [`infectiousnessStandardWeight`][Self::infectiousnessStandardWeight].
416        #[unsafe(method(setInfectiousnessStandardWeight:))]
417        #[unsafe(method_family = none)]
418        pub unsafe fn setInfectiousnessStandardWeight(
419            &self,
420            infectiousness_standard_weight: c_double,
421        );
422
423        #[unsafe(method(infectiousnessHighWeight))]
424        #[unsafe(method_family = none)]
425        pub unsafe fn infectiousnessHighWeight(&self) -> c_double;
426
427        /// Setter for [`infectiousnessHighWeight`][Self::infectiousnessHighWeight].
428        #[unsafe(method(setInfectiousnessHighWeight:))]
429        #[unsafe(method_family = none)]
430        pub unsafe fn setInfectiousnessHighWeight(&self, infectiousness_high_weight: c_double);
431
432        /// Weights to apply for each report type. Range is 0-250%.
433        #[unsafe(method(reportTypeConfirmedTestWeight))]
434        #[unsafe(method_family = none)]
435        pub unsafe fn reportTypeConfirmedTestWeight(&self) -> c_double;
436
437        /// Setter for [`reportTypeConfirmedTestWeight`][Self::reportTypeConfirmedTestWeight].
438        #[unsafe(method(setReportTypeConfirmedTestWeight:))]
439        #[unsafe(method_family = none)]
440        pub unsafe fn setReportTypeConfirmedTestWeight(
441            &self,
442            report_type_confirmed_test_weight: c_double,
443        );
444
445        #[unsafe(method(reportTypeConfirmedClinicalDiagnosisWeight))]
446        #[unsafe(method_family = none)]
447        pub unsafe fn reportTypeConfirmedClinicalDiagnosisWeight(&self) -> c_double;
448
449        /// Setter for [`reportTypeConfirmedClinicalDiagnosisWeight`][Self::reportTypeConfirmedClinicalDiagnosisWeight].
450        #[unsafe(method(setReportTypeConfirmedClinicalDiagnosisWeight:))]
451        #[unsafe(method_family = none)]
452        pub unsafe fn setReportTypeConfirmedClinicalDiagnosisWeight(
453            &self,
454            report_type_confirmed_clinical_diagnosis_weight: c_double,
455        );
456
457        #[unsafe(method(reportTypeSelfReportedWeight))]
458        #[unsafe(method_family = none)]
459        pub unsafe fn reportTypeSelfReportedWeight(&self) -> c_double;
460
461        /// Setter for [`reportTypeSelfReportedWeight`][Self::reportTypeSelfReportedWeight].
462        #[unsafe(method(setReportTypeSelfReportedWeight:))]
463        #[unsafe(method_family = none)]
464        pub unsafe fn setReportTypeSelfReportedWeight(
465            &self,
466            report_type_self_reported_weight: c_double,
467        );
468
469        #[unsafe(method(reportTypeRecursiveWeight))]
470        #[unsafe(method_family = none)]
471        pub unsafe fn reportTypeRecursiveWeight(&self) -> c_double;
472
473        /// Setter for [`reportTypeRecursiveWeight`][Self::reportTypeRecursiveWeight].
474        #[unsafe(method(setReportTypeRecursiveWeight:))]
475        #[unsafe(method_family = none)]
476        pub unsafe fn setReportTypeRecursiveWeight(&self, report_type_recursive_weight: c_double);
477
478        /// Maps scenarios when Report Type is not present into one of the available report types.
479        /// If this is set to ENDiagnosisReportTypeUnknown, the key will be ignored if it does not contain a report type.
480        #[unsafe(method(reportTypeNoneMap))]
481        #[unsafe(method_family = none)]
482        pub unsafe fn reportTypeNoneMap(&self) -> ENDiagnosisReportType;
483
484        /// Setter for [`reportTypeNoneMap`][Self::reportTypeNoneMap].
485        #[unsafe(method(setReportTypeNoneMap:))]
486        #[unsafe(method_family = none)]
487        pub unsafe fn setReportTypeNoneMap(&self, report_type_none_map: ENDiagnosisReportType);
488
489        /// Thresholds for calculating attenuationDurations. Defaults to [50, 70, 90].
490        ///
491        /// Index        |0    |1    |2
492        /// Variable    |X    |Y    |Z
493        #[unsafe(method(attenuationDurationThresholds))]
494        #[unsafe(method_family = none)]
495        pub unsafe fn attenuationDurationThresholds(&self) -> Retained<NSArray<NSNumber>>;
496
497        /// Setter for [`attenuationDurationThresholds`][Self::attenuationDurationThresholds].
498        ///
499        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
500        #[unsafe(method(setAttenuationDurationThresholds:))]
501        #[unsafe(method_family = none)]
502        pub unsafe fn setAttenuationDurationThresholds(
503            &self,
504            attenuation_duration_thresholds: &NSArray<NSNumber>,
505        );
506
507        /// Exclude exposures with daysSinceLastExposure > this value. Defaults to 0 (don't filter).
508        #[unsafe(method(daysSinceLastExposureThreshold))]
509        #[unsafe(method_family = none)]
510        pub unsafe fn daysSinceLastExposureThreshold(&self) -> NSInteger;
511
512        /// Setter for [`daysSinceLastExposureThreshold`][Self::daysSinceLastExposureThreshold].
513        #[unsafe(method(setDaysSinceLastExposureThreshold:))]
514        #[unsafe(method_family = none)]
515        pub unsafe fn setDaysSinceLastExposureThreshold(
516            &self,
517            days_since_last_exposure_threshold: NSInteger,
518        );
519
520        /// Minimum risk score. Excludes exposure incidents with scores lower than this. Full range and not capped to ENRiskScore.
521        #[unsafe(method(minimumRiskScoreFullRange))]
522        #[unsafe(method_family = none)]
523        pub unsafe fn minimumRiskScoreFullRange(&self) -> c_double;
524
525        /// Setter for [`minimumRiskScoreFullRange`][Self::minimumRiskScoreFullRange].
526        #[unsafe(method(setMinimumRiskScoreFullRange:))]
527        #[unsafe(method_family = none)]
528        pub unsafe fn setMinimumRiskScoreFullRange(&self, minimum_risk_score_full_range: c_double);
529
530        #[unsafe(method(attenuationLevelValues))]
531        #[unsafe(method_family = none)]
532        pub unsafe fn attenuationLevelValues(&self) -> Retained<NSArray<NSNumber>>;
533
534        /// Setter for [`attenuationLevelValues`][Self::attenuationLevelValues].
535        ///
536        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
537        #[unsafe(method(setAttenuationLevelValues:))]
538        #[unsafe(method_family = none)]
539        pub unsafe fn setAttenuationLevelValues(
540            &self,
541            attenuation_level_values: &NSArray<NSNumber>,
542        );
543
544        #[unsafe(method(attenuationWeight))]
545        #[unsafe(method_family = none)]
546        pub unsafe fn attenuationWeight(&self) -> c_double;
547
548        /// Setter for [`attenuationWeight`][Self::attenuationWeight].
549        #[unsafe(method(setAttenuationWeight:))]
550        #[unsafe(method_family = none)]
551        pub unsafe fn setAttenuationWeight(&self, attenuation_weight: c_double);
552
553        #[unsafe(method(daysSinceLastExposureLevelValues))]
554        #[unsafe(method_family = none)]
555        pub unsafe fn daysSinceLastExposureLevelValues(&self) -> Retained<NSArray<NSNumber>>;
556
557        /// Setter for [`daysSinceLastExposureLevelValues`][Self::daysSinceLastExposureLevelValues].
558        ///
559        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
560        #[unsafe(method(setDaysSinceLastExposureLevelValues:))]
561        #[unsafe(method_family = none)]
562        pub unsafe fn setDaysSinceLastExposureLevelValues(
563            &self,
564            days_since_last_exposure_level_values: &NSArray<NSNumber>,
565        );
566
567        #[unsafe(method(daysSinceLastExposureWeight))]
568        #[unsafe(method_family = none)]
569        pub unsafe fn daysSinceLastExposureWeight(&self) -> c_double;
570
571        /// Setter for [`daysSinceLastExposureWeight`][Self::daysSinceLastExposureWeight].
572        #[unsafe(method(setDaysSinceLastExposureWeight:))]
573        #[unsafe(method_family = none)]
574        pub unsafe fn setDaysSinceLastExposureWeight(
575            &self,
576            days_since_last_exposure_weight: c_double,
577        );
578
579        #[unsafe(method(durationLevelValues))]
580        #[unsafe(method_family = none)]
581        pub unsafe fn durationLevelValues(&self) -> Retained<NSArray<NSNumber>>;
582
583        /// Setter for [`durationLevelValues`][Self::durationLevelValues].
584        ///
585        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
586        #[unsafe(method(setDurationLevelValues:))]
587        #[unsafe(method_family = none)]
588        pub unsafe fn setDurationLevelValues(&self, duration_level_values: &NSArray<NSNumber>);
589
590        #[unsafe(method(durationWeight))]
591        #[unsafe(method_family = none)]
592        pub unsafe fn durationWeight(&self) -> c_double;
593
594        /// Setter for [`durationWeight`][Self::durationWeight].
595        #[unsafe(method(setDurationWeight:))]
596        #[unsafe(method_family = none)]
597        pub unsafe fn setDurationWeight(&self, duration_weight: c_double);
598
599        #[unsafe(method(metadata))]
600        #[unsafe(method_family = none)]
601        pub unsafe fn metadata(&self) -> Option<Retained<NSDictionary>>;
602
603        /// Setter for [`metadata`][Self::metadata].
604        ///
605        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
606        ///
607        /// # Safety
608        ///
609        /// `metadata` generic should be of the correct type.
610        #[unsafe(method(setMetadata:))]
611        #[unsafe(method_family = none)]
612        pub unsafe fn setMetadata(&self, metadata: Option<&NSDictionary>);
613
614        #[unsafe(method(minimumRiskScore))]
615        #[unsafe(method_family = none)]
616        pub unsafe fn minimumRiskScore(&self) -> ENRiskScore;
617
618        /// Setter for [`minimumRiskScore`][Self::minimumRiskScore].
619        #[unsafe(method(setMinimumRiskScore:))]
620        #[unsafe(method_family = none)]
621        pub unsafe fn setMinimumRiskScore(&self, minimum_risk_score: ENRiskScore);
622
623        #[unsafe(method(transmissionRiskLevelValues))]
624        #[unsafe(method_family = none)]
625        pub unsafe fn transmissionRiskLevelValues(&self) -> Retained<NSArray<NSNumber>>;
626
627        /// Setter for [`transmissionRiskLevelValues`][Self::transmissionRiskLevelValues].
628        ///
629        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
630        #[unsafe(method(setTransmissionRiskLevelValues:))]
631        #[unsafe(method_family = none)]
632        pub unsafe fn setTransmissionRiskLevelValues(
633            &self,
634            transmission_risk_level_values: &NSArray<NSNumber>,
635        );
636
637        #[unsafe(method(transmissionRiskWeight))]
638        #[unsafe(method_family = none)]
639        pub unsafe fn transmissionRiskWeight(&self) -> c_double;
640
641        /// Setter for [`transmissionRiskWeight`][Self::transmissionRiskWeight].
642        #[unsafe(method(setTransmissionRiskWeight:))]
643        #[unsafe(method_family = none)]
644        pub unsafe fn setTransmissionRiskWeight(&self, transmission_risk_weight: c_double);
645    );
646}
647
648/// Methods declared on superclass `NSObject`.
649impl ENExposureConfiguration {
650    extern_methods!(
651        #[unsafe(method(init))]
652        #[unsafe(method_family = init)]
653        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
654
655        #[unsafe(method(new))]
656        #[unsafe(method_family = new)]
657        pub unsafe fn new() -> Retained<Self>;
658    );
659}
660
661extern_class!(
662    /// Summary of exposure info for a single day.
663    ///
664    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposuredaysummary?language=objc)
665    #[unsafe(super(NSObject))]
666    #[derive(Debug, PartialEq, Eq, Hash)]
667    pub struct ENExposureDaySummary;
668);
669
670extern_conformance!(
671    unsafe impl NSObjectProtocol for ENExposureDaySummary {}
672);
673
674impl ENExposureDaySummary {
675    extern_methods!(
676        /// Day the exposure occurred.
677        #[unsafe(method(date))]
678        #[unsafe(method_family = none)]
679        pub unsafe fn date(&self) -> Retained<NSDate>;
680
681        /// Summary of all exposures on this day of a specific diagnosis report type.
682        #[unsafe(method(confirmedTestSummary))]
683        #[unsafe(method_family = none)]
684        pub unsafe fn confirmedTestSummary(&self) -> Option<Retained<ENExposureSummaryItem>>;
685
686        #[unsafe(method(confirmedClinicalDiagnosisSummary))]
687        #[unsafe(method_family = none)]
688        pub unsafe fn confirmedClinicalDiagnosisSummary(
689            &self,
690        ) -> Option<Retained<ENExposureSummaryItem>>;
691
692        #[unsafe(method(recursiveSummary))]
693        #[unsafe(method_family = none)]
694        pub unsafe fn recursiveSummary(&self) -> Option<Retained<ENExposureSummaryItem>>;
695
696        #[unsafe(method(selfReportedSummary))]
697        #[unsafe(method_family = none)]
698        pub unsafe fn selfReportedSummary(&self) -> Option<Retained<ENExposureSummaryItem>>;
699
700        /// Summary of all exposures on this day.
701        #[unsafe(method(daySummary))]
702        #[unsafe(method_family = none)]
703        pub unsafe fn daySummary(&self) -> Retained<ENExposureSummaryItem>;
704    );
705}
706
707/// Methods declared on superclass `NSObject`.
708impl ENExposureDaySummary {
709    extern_methods!(
710        #[unsafe(method(init))]
711        #[unsafe(method_family = init)]
712        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
713
714        #[unsafe(method(new))]
715        #[unsafe(method_family = new)]
716        pub unsafe fn new() -> Retained<Self>;
717    );
718}
719
720extern_class!(
721    /// Summary of exposure detection.
722    ///
723    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposuredetectionsummary?language=objc)
724    #[unsafe(super(NSObject))]
725    #[derive(Debug, PartialEq, Eq, Hash)]
726    pub struct ENExposureDetectionSummary;
727);
728
729extern_conformance!(
730    unsafe impl NSObjectProtocol for ENExposureDetectionSummary {}
731);
732
733impl ENExposureDetectionSummary {
734    extern_methods!(
735        /// Array of durations in seconds at certain radio signal attenuations.
736        /// Array index 0: Sum of durations for all exposures when attenuation
737        /// <
738        /// = X
739        /// Array index 1: Sum of durations for all exposures when attenuation
740        /// <
741        /// = Y
742        /// Array index 2: Sum of durations for all exposures when attenuation
743        /// <
744        /// = Z
745        /// Array index 3: Sum of durations for all exposures when attenuation >  Z
746        /// X, Y, Z come from the attenuationDurationThresholds on the configuration object.
747        #[unsafe(method(attenuationDurations))]
748        #[unsafe(method_family = none)]
749        pub unsafe fn attenuationDurations(&self) -> Retained<NSArray<NSNumber>>;
750
751        /// Number of days since the most recent exposure. 0 = today, 1 = yesterday, etc. Only valid if matchedKeyCount > 0.
752        #[unsafe(method(daysSinceLastExposure))]
753        #[unsafe(method_family = none)]
754        pub unsafe fn daysSinceLastExposure(&self) -> NSInteger;
755
756        /// Number of diagnosis keys that matched.
757        #[unsafe(method(matchedKeyCount))]
758        #[unsafe(method_family = none)]
759        pub unsafe fn matchedKeyCount(&self) -> u64;
760
761        /// Highest risk score of all exposure incidents.
762        #[unsafe(method(maximumRiskScore))]
763        #[unsafe(method_family = none)]
764        pub unsafe fn maximumRiskScore(&self) -> ENRiskScore;
765
766        /// Highest risk score of all exposure incidents.
767        #[unsafe(method(maximumRiskScoreFullRange))]
768        #[unsafe(method_family = none)]
769        pub unsafe fn maximumRiskScoreFullRange(&self) -> c_double;
770
771        /// Metadata associated with the summary.
772        #[unsafe(method(metadata))]
773        #[unsafe(method_family = none)]
774        pub unsafe fn metadata(&self) -> Option<Retained<NSDictionary>>;
775
776        /// Sum of risk scores for all exposures. Summed using the full range risk scores before capping to ENRiskScore.
777        #[unsafe(method(riskScoreSumFullRange))]
778        #[unsafe(method_family = none)]
779        pub unsafe fn riskScoreSumFullRange(&self) -> c_double;
780
781        /// Summary of each day containing an exposure.
782        #[unsafe(method(daySummaries))]
783        #[unsafe(method_family = none)]
784        pub unsafe fn daySummaries(&self) -> Retained<NSArray<ENExposureDaySummary>>;
785    );
786}
787
788/// Methods declared on superclass `NSObject`.
789impl ENExposureDetectionSummary {
790    extern_methods!(
791        #[unsafe(method(init))]
792        #[unsafe(method_family = init)]
793        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
794
795        #[unsafe(method(new))]
796        #[unsafe(method_family = new)]
797        pub unsafe fn new() -> Retained<Self>;
798    );
799}
800
801extern_class!(
802    /// Info about an exposure.
803    ///
804    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposureinfo?language=objc)
805    #[unsafe(super(NSObject))]
806    #[derive(Debug, PartialEq, Eq, Hash)]
807    pub struct ENExposureInfo;
808);
809
810extern_conformance!(
811    unsafe impl NSObjectProtocol for ENExposureInfo {}
812);
813
814impl ENExposureInfo {
815    extern_methods!(
816        /// Array of durations in seconds at certain radio signal attenuations.
817        /// Array index 0: Sum of durations for this exposure when attenuation
818        /// <
819        /// = X
820        /// Array index 1: Sum of durations for this exposure when attenuation
821        /// <
822        /// = Y
823        /// Array index 2: Sum of durations for this exposure when attenuation
824        /// <
825        /// = Z
826        /// Array index 3: Sum of durations for this exposure when attenuation >  Z
827        /// X, Y, Z come from the attenuationDurationThresholds on the configuration object.
828        #[unsafe(method(attenuationDurations))]
829        #[unsafe(method_family = none)]
830        pub unsafe fn attenuationDurations(&self) -> Retained<NSArray<NSNumber>>;
831
832        /// Duration-weighted average of the attenuations associated with this exposure.
833        #[unsafe(method(attenuationValue))]
834        #[unsafe(method_family = none)]
835        pub unsafe fn attenuationValue(&self) -> ENAttenuation;
836
837        /// Date when the exposure occurred. This may have reduced precision, such as within 1 day of the actual time.
838        #[unsafe(method(date))]
839        #[unsafe(method_family = none)]
840        pub unsafe fn date(&self) -> Retained<NSDate>;
841
842        /// Number of days since the onset of symptoms. Defaults to ENDaysSinceOnsetOfSymptomsUnknown.
843        #[unsafe(method(daysSinceOnsetOfSymptoms))]
844        #[unsafe(method_family = none)]
845        pub unsafe fn daysSinceOnsetOfSymptoms(&self) -> NSInteger;
846
847        /// How positive diagnosis was reported.
848        #[unsafe(method(diagnosisReportType))]
849        #[unsafe(method_family = none)]
850        pub unsafe fn diagnosisReportType(&self) -> ENDiagnosisReportType;
851
852        /// Length of exposure in 5 minute increments with a 30 minute maximum.
853        #[unsafe(method(duration))]
854        #[unsafe(method_family = none)]
855        pub unsafe fn duration(&self) -> NSTimeInterval;
856
857        /// Metadata associated with the exposure.
858        #[unsafe(method(metadata))]
859        #[unsafe(method_family = none)]
860        pub unsafe fn metadata(&self) -> Option<Retained<NSDictionary>>;
861
862        /// Indicates the total risk calculated for this exposure incident. Capped to ENRiskScore range.
863        #[unsafe(method(totalRiskScore))]
864        #[unsafe(method_family = none)]
865        pub unsafe fn totalRiskScore(&self) -> ENRiskScore;
866
867        /// Indicates the total risk calculated for this exposure incident. Full range and not capped to ENRiskScore.
868        #[unsafe(method(totalRiskScoreFullRange))]
869        #[unsafe(method_family = none)]
870        pub unsafe fn totalRiskScoreFullRange(&self) -> c_double;
871
872        /// Indicates the transmission risk associated with the diagnosis key.
873        #[unsafe(method(transmissionRiskLevel))]
874        #[unsafe(method_family = none)]
875        pub unsafe fn transmissionRiskLevel(&self) -> ENRiskLevel;
876    );
877}
878
879/// Methods declared on superclass `NSObject`.
880impl ENExposureInfo {
881    extern_methods!(
882        #[unsafe(method(init))]
883        #[unsafe(method_family = init)]
884        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
885
886        #[unsafe(method(new))]
887        #[unsafe(method_family = new)]
888        pub unsafe fn new() -> Retained<Self>;
889    );
890}
891
892extern_class!(
893    /// Summary for a specific time period or report type.
894    ///
895    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposuresummaryitem?language=objc)
896    #[unsafe(super(NSObject))]
897    #[derive(Debug, PartialEq, Eq, Hash)]
898    pub struct ENExposureSummaryItem;
899);
900
901extern_conformance!(
902    unsafe impl NSObjectProtocol for ENExposureSummaryItem {}
903);
904
905impl ENExposureSummaryItem {
906    extern_methods!(
907        /// Highest score of all exposures for this item.
908        #[unsafe(method(maximumScore))]
909        #[unsafe(method_family = none)]
910        pub unsafe fn maximumScore(&self) -> c_double;
911
912        /// Sum of scores for all exposure for this item.
913        #[unsafe(method(scoreSum))]
914        #[unsafe(method_family = none)]
915        pub unsafe fn scoreSum(&self) -> c_double;
916
917        /// Sum of exposure durations weighted by their attenuation.
918        /// weightedDurationSum =
919        /// ( immediateDuration * immediateDurationWeight ) +
920        /// ( nearDuration      * nearDurationWeight ) +
921        /// ( mediumDuration    * mediumDurationWeight ) +
922        /// ( otherDuration     * otherDurationWeight ).
923        #[unsafe(method(weightedDurationSum))]
924        #[unsafe(method_family = none)]
925        pub unsafe fn weightedDurationSum(&self) -> NSTimeInterval;
926    );
927}
928
929/// Methods declared on superclass `NSObject`.
930impl ENExposureSummaryItem {
931    extern_methods!(
932        #[unsafe(method(init))]
933        #[unsafe(method_family = init)]
934        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
935
936        #[unsafe(method(new))]
937        #[unsafe(method_family = new)]
938        pub unsafe fn new() -> Retained<Self>;
939    );
940}
941
942extern_class!(
943    /// A duration of up to 30 minutes during which beacons from a TEK were observed.
944    ///
945    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposurewindow?language=objc)
946    #[unsafe(super(NSObject))]
947    #[derive(Debug, PartialEq, Eq, Hash)]
948    pub struct ENExposureWindow;
949);
950
951extern_conformance!(
952    unsafe impl NSObjectProtocol for ENExposureWindow {}
953);
954
955impl ENExposureWindow {
956    extern_methods!(
957        /// Transmitting device's calibration confidence.
958        #[unsafe(method(calibrationConfidence))]
959        #[unsafe(method_family = none)]
960        pub unsafe fn calibrationConfidence(&self) -> ENCalibrationConfidence;
961
962        /// Day the exposure occurred.
963        #[unsafe(method(date))]
964        #[unsafe(method_family = none)]
965        pub unsafe fn date(&self) -> Retained<NSDate>;
966
967        /// How positive diagnosis was reported for this the TEK observed for this window.
968        #[unsafe(method(diagnosisReportType))]
969        #[unsafe(method_family = none)]
970        pub unsafe fn diagnosisReportType(&self) -> ENDiagnosisReportType;
971
972        /// How infectious based on days since onset of symptoms.
973        #[unsafe(method(infectiousness))]
974        #[unsafe(method_family = none)]
975        pub unsafe fn infectiousness(&self) -> ENInfectiousness;
976
977        /// Each scan instance corresponds to a scan (of a few seconds) when a beacon with a TEK causing this exposure was observed.
978        #[unsafe(method(scanInstances))]
979        #[unsafe(method_family = none)]
980        pub unsafe fn scanInstances(&self) -> Retained<NSArray<ENScanInstance>>;
981
982        /// Type of variant of concern
983        #[unsafe(method(variantOfConcernType))]
984        #[unsafe(method_family = none)]
985        pub unsafe fn variantOfConcernType(&self) -> ENVariantOfConcernType;
986    );
987}
988
989/// Methods declared on superclass `NSObject`.
990impl ENExposureWindow {
991    extern_methods!(
992        #[unsafe(method(init))]
993        #[unsafe(method_family = init)]
994        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
995
996        #[unsafe(method(new))]
997        #[unsafe(method_family = new)]
998        pub unsafe fn new() -> Retained<Self>;
999    );
1000}
1001
1002extern_class!(
1003    /// Aggregation of attenuations of all of this TEK's beacons received during a scan.
1004    ///
1005    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enscaninstance?language=objc)
1006    #[unsafe(super(NSObject))]
1007    #[derive(Debug, PartialEq, Eq, Hash)]
1008    pub struct ENScanInstance;
1009);
1010
1011extern_conformance!(
1012    unsafe impl NSObjectProtocol for ENScanInstance {}
1013);
1014
1015impl ENScanInstance {
1016    extern_methods!(
1017        /// Minimum attenuation of all of this TEK's beacons received during the scan.
1018        #[unsafe(method(minimumAttenuation))]
1019        #[unsafe(method_family = none)]
1020        pub unsafe fn minimumAttenuation(&self) -> ENAttenuation;
1021
1022        /// Aggregation of the attenuations of all of this TEK's beacons received during the scan.
1023        #[unsafe(method(typicalAttenuation))]
1024        #[unsafe(method_family = none)]
1025        pub unsafe fn typicalAttenuation(&self) -> ENAttenuation;
1026
1027        /// Seconds elapsed since the the previous scan.
1028        #[unsafe(method(secondsSinceLastScan))]
1029        #[unsafe(method_family = none)]
1030        pub unsafe fn secondsSinceLastScan(&self) -> NSInteger;
1031    );
1032}
1033
1034/// Methods declared on superclass `NSObject`.
1035impl ENScanInstance {
1036    extern_methods!(
1037        #[unsafe(method(init))]
1038        #[unsafe(method_family = init)]
1039        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1040
1041        #[unsafe(method(new))]
1042        #[unsafe(method_family = new)]
1043        pub unsafe fn new() -> Retained<Self>;
1044    );
1045}
1046
1047extern_class!(
1048    /// Key used to generate rolling proximity identifiers.
1049    ///
1050    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/entemporaryexposurekey?language=objc)
1051    #[unsafe(super(NSObject))]
1052    #[derive(Debug, PartialEq, Eq, Hash)]
1053    pub struct ENTemporaryExposureKey;
1054);
1055
1056extern_conformance!(
1057    unsafe impl NSObjectProtocol for ENTemporaryExposureKey {}
1058);
1059
1060impl ENTemporaryExposureKey {
1061    extern_methods!(
1062        /// Key material used to generate Rolling Proximity Identifiers.
1063        #[unsafe(method(keyData))]
1064        #[unsafe(method_family = none)]
1065        pub unsafe fn keyData(&self) -> Retained<NSData>;
1066
1067        /// Setter for [`keyData`][Self::keyData].
1068        ///
1069        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1070        #[unsafe(method(setKeyData:))]
1071        #[unsafe(method_family = none)]
1072        pub unsafe fn setKeyData(&self, key_data: &NSData);
1073
1074        /// Duration this key is valid. It's the number of 10-minute windows between key rolling.
1075        #[unsafe(method(rollingPeriod))]
1076        #[unsafe(method_family = none)]
1077        pub unsafe fn rollingPeriod(&self) -> ENIntervalNumber;
1078
1079        /// Setter for [`rollingPeriod`][Self::rollingPeriod].
1080        #[unsafe(method(setRollingPeriod:))]
1081        #[unsafe(method_family = none)]
1082        pub unsafe fn setRollingPeriod(&self, rolling_period: ENIntervalNumber);
1083
1084        /// Interval number when the key's EKRollingPeriod started.
1085        #[unsafe(method(rollingStartNumber))]
1086        #[unsafe(method_family = none)]
1087        pub unsafe fn rollingStartNumber(&self) -> ENIntervalNumber;
1088
1089        /// Setter for [`rollingStartNumber`][Self::rollingStartNumber].
1090        #[unsafe(method(setRollingStartNumber:))]
1091        #[unsafe(method_family = none)]
1092        pub unsafe fn setRollingStartNumber(&self, rolling_start_number: ENIntervalNumber);
1093
1094        /// Risk of transmission associated with the person this key came from.
1095        #[unsafe(method(transmissionRiskLevel))]
1096        #[unsafe(method_family = none)]
1097        pub unsafe fn transmissionRiskLevel(&self) -> ENRiskLevel;
1098
1099        /// Setter for [`transmissionRiskLevel`][Self::transmissionRiskLevel].
1100        #[unsafe(method(setTransmissionRiskLevel:))]
1101        #[unsafe(method_family = none)]
1102        pub unsafe fn setTransmissionRiskLevel(&self, transmission_risk_level: ENRiskLevel);
1103    );
1104}
1105
1106/// Methods declared on superclass `NSObject`.
1107impl ENTemporaryExposureKey {
1108    extern_methods!(
1109        #[unsafe(method(init))]
1110        #[unsafe(method_family = init)]
1111        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1112
1113        #[unsafe(method(new))]
1114        #[unsafe(method_family = new)]
1115        pub unsafe fn new() -> Retained<Self>;
1116    );
1117}