objc2-exposure-notification 0.3.2

Bindings to the ExposureNotification framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    /// NSError domain for Exposure Notification errors.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enerrordomain?language=objc)
    pub static ENErrorDomain: &'static NSErrorDomain;
}

/// Error codes used with ENErrorDomain.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enerrorcode?language=objc)
// NS_ERROR_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ENErrorCode(pub NSInteger);
impl ENErrorCode {
    #[doc(alias = "ENErrorCodeUnknown")]
    pub const Unknown: Self = Self(1);
    /// Underlying failure with an unknown cause.
    #[doc(alias = "ENErrorCodeBadParameter")]
    pub const BadParameter: Self = Self(2);
    /// Missing or incorrect parameter.
    #[doc(alias = "ENErrorCodeNotEntitled")]
    pub const NotEntitled: Self = Self(3);
    /// Calling process doesn't have the correct entitlement.
    #[doc(alias = "ENErrorCodeNotAuthorized")]
    pub const NotAuthorized: Self = Self(4);
    /// User denied this process access to Exposure Notification functionality.
    #[doc(alias = "ENErrorCodeUnsupported")]
    pub const Unsupported: Self = Self(5);
    /// Operation is not supported.
    #[doc(alias = "ENErrorCodeInvalidated")]
    pub const Invalidated: Self = Self(6);
    /// Invalidate was called before the operation completed normally.
    #[doc(alias = "ENErrorCodeBluetoothOff")]
    pub const BluetoothOff: Self = Self(7);
    /// Bluetooth was turned off the by user.
    #[doc(alias = "ENErrorCodeInsufficientStorage")]
    pub const InsufficientStorage: Self = Self(8);
    /// Insufficient storage space to enable Exposure Notification.
    #[doc(alias = "ENErrorCodeNotEnabled")]
    pub const NotEnabled: Self = Self(9);
    /// Exposure Notification has not been enabled.
    #[doc(alias = "ENErrorCodeAPIMisuse")]
    pub const APIMisuse: Self = Self(10);
    /// The API was used incorrectly.
    #[doc(alias = "ENErrorCodeInternal")]
    pub const Internal: Self = Self(11);
    /// Internal error. This indicates a bug in this framework.
    #[doc(alias = "ENErrorCodeInsufficientMemory")]
    pub const InsufficientMemory: Self = Self(12);
    /// Not enough memory to perform an operation.
    #[doc(alias = "ENErrorCodeRateLimited")]
    pub const RateLimited: Self = Self(13);
    /// API called too frequently. See API for acceptable frequency.
    #[doc(alias = "ENErrorCodeRestricted")]
    pub const Restricted: Self = Self(14);
    /// Exposure Notification is disabled due to system policies.
    #[doc(alias = "ENErrorCodeBadFormat")]
    pub const BadFormat: Self = Self(15);
    /// File or data format problem.
    #[doc(alias = "ENErrorCodeDataInaccessible")]
    pub const DataInaccessible: Self = Self(16);
    /// The device must be unlocked before data is accessible.
    #[doc(alias = "ENErrorCodeTravelStatusNotAvailable")]
    pub const TravelStatusNotAvailable: Self = Self(17);
}

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

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

/// Type for returning NSError's from functions. Avoids long and repetitious method signatures.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enerrorouttype?language=objc)
pub type ENErrorOutType = *mut *mut NSError;

/// Attenuation of a radio signal. This is the Advertised Transmit Power - Measured RSSI.
///
/// Note: The attenuation value may be misleading because more attenuation doesn’t necessarily mean the device is farther
/// away. For example, two people could be very close and facing each other with their phones in their back pockets. This
/// may report higher attenuation (i.e. weaker received signal) even though the individuals are very close together.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enattenuation?language=objc)
pub type ENAttenuation = u8;

/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enattenuationmin?language=objc)
pub const ENAttenuationMin: c_uint = 0;
/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enattenuationmax?language=objc)
pub const ENAttenuationMax: c_uint = 0xFF;

/// Indicates the status of authorization for the app.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enauthorizationstatus?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ENAuthorizationStatus(pub NSInteger);
impl ENAuthorizationStatus {
    /// Authorization status has not yet been determined.
    /// This status means the user has not been prompted yet. Using the API in this state may prompt the user.
    #[doc(alias = "ENAuthorizationStatusUnknown")]
    pub const Unknown: Self = Self(0);
    /// This app is not authorized to use Exposure Notification. The user cannot change this app's authorization status.
    /// This status may be due to active restrictions, such as parental controls being in place.
    #[doc(alias = "ENAuthorizationStatusRestricted")]
    pub const Restricted: Self = Self(1);
    /// The user denied authorization for this app.
    #[doc(alias = "ENAuthorizationStatusNotAuthorized")]
    pub const NotAuthorized: Self = Self(2);
    /// The user has authorized this app to use Exposure Notification.
    #[doc(alias = "ENAuthorizationStatusAuthorized")]
    pub const Authorized: Self = Self(3);
}

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

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

/// Confidence in calibration data.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/encalibrationconfidence?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ENCalibrationConfidence(pub u8);
impl ENCalibrationConfidence {
    /// No calibration data.
    #[doc(alias = "ENCalibrationConfidenceLowest")]
    pub const Lowest: Self = Self(0);
    /// Using average calibration over phones of this manufacturer or Android beacons from EN API version
    /// <
    /// 1.5.
    #[doc(alias = "ENCalibrationConfidenceLow")]
    pub const Low: Self = Self(1);
    /// Using single-antenna orientation for a similar phone model or iPhone beacons from EN API version
    /// <
    /// 1.5.
    #[doc(alias = "ENCalibrationConfidenceMedium")]
    pub const Medium: Self = Self(2);
    /// Determined using significant calibration data for this model.
    #[doc(alias = "ENCalibrationConfidenceHigh")]
    pub const High: Self = Self(3);
}

unsafe impl Encode for ENCalibrationConfidence {
    const ENCODING: Encoding = u8::ENCODING;
}

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

/// The value used when days since onset of symptoms is unspecified.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/endayssinceonsetofsymptomsunknown?language=objc)
#[deprecated = "Server must provide keys with days_since_onset_of_symptoms set."]
pub static ENDaysSinceOnsetOfSymptomsUnknown: NSInteger = NSIntegerMax as _;

/// How positive diagnosis was reported.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/endiagnosisreporttype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ENDiagnosisReportType(pub u32);
impl ENDiagnosisReportType {
    /// Diagnosis type unknown or not available.
    #[doc(alias = "ENDiagnosisReportTypeUnknown")]
    pub const Unknown: Self = Self(0);
    /// Confirmed test.
    #[doc(alias = "ENDiagnosisReportTypeConfirmedTest")]
    pub const ConfirmedTest: Self = Self(1);
    /// Confirmed clinical diagnosis.
    #[doc(alias = "ENDiagnosisReportTypeConfirmedClinicalDiagnosis")]
    pub const ConfirmedClinicalDiagnosis: Self = Self(2);
    /// User reported positive diagnosis without health authority involvement.
    #[doc(alias = "ENDiagnosisReportTypeSelfReported")]
    pub const SelfReported: Self = Self(3);
    /// Person determined to be positive based on exposure to another person confirmed to be positive. This report type
    /// is reserved for future use and keys with this report type are not matched by iOS.
    #[doc(alias = "ENDiagnosisReportTypeRecursive")]
    pub const Recursive: Self = Self(4);
    /// Negative test. This is mainly to negate a previous self report or clinical diagnosis that may have been in error.
    #[doc(alias = "ENDiagnosisReportTypeRevoked")]
    pub const Revoked: Self = Self(5);
}

unsafe impl Encode for ENDiagnosisReportType {
    const ENCODING: Encoding = u32::ENCODING;
}

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

/// How infectious based on days since onset of symptoms.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/eninfectiousness?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ENInfectiousness(pub u32);
impl ENInfectiousness {
    #[doc(alias = "ENInfectiousnessNone")]
    pub const None: Self = Self(0);
    /// Never returned through the API, but used for configuration.
    #[doc(alias = "ENInfectiousnessStandard")]
    pub const Standard: Self = Self(1);
    /// Never returned through the API, but used for configuration.
    #[doc(alias = "ENInfectiousnessHigh")]
    pub const High: Self = Self(2);
}

unsafe impl Encode for ENInfectiousness {
    const ENCODING: Encoding = u32::ENCODING;
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/envariantofconcerntype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ENVariantOfConcernType(pub u32);
impl ENVariantOfConcernType {
    #[doc(alias = "ENVariantOfConcernTypeUnknown")]
    pub const TypeUnknown: Self = Self(0);
    #[doc(alias = "ENVariantOfConcernType1")]
    pub const Type1: Self = Self(1);
    #[doc(alias = "ENVariantOfConcernType2")]
    pub const Type2: Self = Self(2);
    #[doc(alias = "ENVariantOfConcernType3")]
    pub const Type3: Self = Self(3);
    #[doc(alias = "ENVariantOfConcernType4")]
    pub const Type4: Self = Self(4);
}

unsafe impl Encode for ENVariantOfConcernType {
    const ENCODING: Encoding = u32::ENCODING;
}

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

/// ENIntervalNumber (ENIN)
///
/// A number for each 10 minute window that is shared between all devices participating in the protocol.
/// These time windows are based Unix Time (epoch 1970-01-01 00:00:00). It's calculated as:
///
/// ENIN =
/// <Seconds
/// since 1970-01-01 00:00:00> / ( 60 * 10 )
///
/// It's encoded as an unsigned 32-bit (uint32_t), little endian value.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enintervalnumber?language=objc)
pub type ENIntervalNumber = u32;

/// Represents a risk level, ranging from 0-7.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevel?language=objc)
pub type ENRiskLevel = u8;

/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevelmin?language=objc)
pub const ENRiskLevelMin: c_uint = 0;
/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevelmax?language=objc)
pub const ENRiskLevelMax: c_uint = 7;

/// The value, ranging from 0 to 8, that the app assigns to each Risk Level in each of the Risk Level Parameters.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevelvalue?language=objc)
pub type ENRiskLevelValue = u8;

/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevelvaluemin?language=objc)
pub const ENRiskLevelValueMin: c_uint = 0;
/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enrisklevelvaluemax?language=objc)
pub const ENRiskLevelValueMax: c_uint = 8;

/// Represents estimated risk calculated by a scoring algorithm. Range is 0-255. 255 is the highest risk.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskscore?language=objc)
pub type ENRiskScore = u8;

/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskscoremin?language=objc)
pub const ENRiskScoreMin: c_uint = 0;
/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskscoremax?language=objc)
pub const ENRiskScoreMax: c_uint = 255;

/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskweightdefault?language=objc)
pub const ENRiskWeightDefault: c_uint = 1;
/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskweightdefaultv2?language=objc)
pub const ENRiskWeightDefaultV2: c_uint = 100;
/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskweightmin?language=objc)
pub const ENRiskWeightMin: c_uint = 0;
/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskweightmax?language=objc)
pub const ENRiskWeightMax: c_uint = 100;
/// [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enriskweightmaxv2?language=objc)
pub const ENRiskWeightMaxV2: c_uint = 250;

/// Invoked when an operation completes. Error is nil for success or non-nil if an error occurred.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enerrorhandler?language=objc)
#[cfg(feature = "block2")]
pub type ENErrorHandler = *mut block2::DynBlock<dyn Fn(*mut NSError)>;

extern_class!(
    /// Configuration parameters for exposure detection.
    ///
    /// Configuration parameters are used to calculate an exposure duration for each exposure using the following formula.
    ///
    /// exposureDuration =
    /// ( ( immediateDuration * immediateDurationWeight ) +
    /// ( nearDuration      * nearDurationWeight ) +
    /// ( mediumDuration    * mediumDurationWeight ) +
    /// ( otherDuration     * otherDurationWeight ) )
    /// infectiousnessWeight )
    /// reportTypeWeight )
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposureconfiguration?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ENExposureConfiguration;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for ENExposureConfiguration {}
);

impl ENExposureConfiguration {
    extern_methods!(
        /// Weights to apply to durations at each proximity level based on attenuation. Range is 0-250%.
        #[unsafe(method(immediateDurationWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn immediateDurationWeight(&self) -> c_double;

        /// Setter for [`immediateDurationWeight`][Self::immediateDurationWeight].
        #[unsafe(method(setImmediateDurationWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setImmediateDurationWeight(&self, immediate_duration_weight: c_double);

        #[unsafe(method(nearDurationWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn nearDurationWeight(&self) -> c_double;

        /// Setter for [`nearDurationWeight`][Self::nearDurationWeight].
        #[unsafe(method(setNearDurationWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNearDurationWeight(&self, near_duration_weight: c_double);

        #[unsafe(method(mediumDurationWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediumDurationWeight(&self) -> c_double;

        /// Setter for [`mediumDurationWeight`][Self::mediumDurationWeight].
        #[unsafe(method(setMediumDurationWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMediumDurationWeight(&self, medium_duration_weight: c_double);

        #[unsafe(method(otherDurationWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn otherDurationWeight(&self) -> c_double;

        /// Setter for [`otherDurationWeight`][Self::otherDurationWeight].
        #[unsafe(method(setOtherDurationWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setOtherDurationWeight(&self, other_duration_weight: c_double);

        /// Maps daysSinceOnsetOfSymptoms to infectiousness. Must be configured if using V2 scoring.
        /// Key is a daysSinceOnsetOfSymptoms: -14 to 14. Value is an ENInfectiousness.
        /// Defaults to ENInfectiousnessNone for days not specified.
        /// If a value is set to ENInfectiousnessNone, diagnosis keys for it should be ignored.
        #[unsafe(method(infectiousnessForDaysSinceOnsetOfSymptoms))]
        #[unsafe(method_family = none)]
        pub unsafe fn infectiousnessForDaysSinceOnsetOfSymptoms(
            &self,
        ) -> Option<Retained<NSDictionary<NSNumber, NSNumber>>>;

        /// Setter for [`infectiousnessForDaysSinceOnsetOfSymptoms`][Self::infectiousnessForDaysSinceOnsetOfSymptoms].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setInfectiousnessForDaysSinceOnsetOfSymptoms:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setInfectiousnessForDaysSinceOnsetOfSymptoms(
            &self,
            infectiousness_for_days_since_onset_of_symptoms: Option<
                &NSDictionary<NSNumber, NSNumber>,
            >,
        );

        /// Weights to apply for infectiousness. Range is 0-250%.
        #[unsafe(method(infectiousnessStandardWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn infectiousnessStandardWeight(&self) -> c_double;

        /// Setter for [`infectiousnessStandardWeight`][Self::infectiousnessStandardWeight].
        #[unsafe(method(setInfectiousnessStandardWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setInfectiousnessStandardWeight(
            &self,
            infectiousness_standard_weight: c_double,
        );

        #[unsafe(method(infectiousnessHighWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn infectiousnessHighWeight(&self) -> c_double;

        /// Setter for [`infectiousnessHighWeight`][Self::infectiousnessHighWeight].
        #[unsafe(method(setInfectiousnessHighWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setInfectiousnessHighWeight(&self, infectiousness_high_weight: c_double);

        /// Weights to apply for each report type. Range is 0-250%.
        #[unsafe(method(reportTypeConfirmedTestWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn reportTypeConfirmedTestWeight(&self) -> c_double;

        /// Setter for [`reportTypeConfirmedTestWeight`][Self::reportTypeConfirmedTestWeight].
        #[unsafe(method(setReportTypeConfirmedTestWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setReportTypeConfirmedTestWeight(
            &self,
            report_type_confirmed_test_weight: c_double,
        );

        #[unsafe(method(reportTypeConfirmedClinicalDiagnosisWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn reportTypeConfirmedClinicalDiagnosisWeight(&self) -> c_double;

        /// Setter for [`reportTypeConfirmedClinicalDiagnosisWeight`][Self::reportTypeConfirmedClinicalDiagnosisWeight].
        #[unsafe(method(setReportTypeConfirmedClinicalDiagnosisWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setReportTypeConfirmedClinicalDiagnosisWeight(
            &self,
            report_type_confirmed_clinical_diagnosis_weight: c_double,
        );

        #[unsafe(method(reportTypeSelfReportedWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn reportTypeSelfReportedWeight(&self) -> c_double;

        /// Setter for [`reportTypeSelfReportedWeight`][Self::reportTypeSelfReportedWeight].
        #[unsafe(method(setReportTypeSelfReportedWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setReportTypeSelfReportedWeight(
            &self,
            report_type_self_reported_weight: c_double,
        );

        #[unsafe(method(reportTypeRecursiveWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn reportTypeRecursiveWeight(&self) -> c_double;

        /// Setter for [`reportTypeRecursiveWeight`][Self::reportTypeRecursiveWeight].
        #[unsafe(method(setReportTypeRecursiveWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setReportTypeRecursiveWeight(&self, report_type_recursive_weight: c_double);

        /// Maps scenarios when Report Type is not present into one of the available report types.
        /// If this is set to ENDiagnosisReportTypeUnknown, the key will be ignored if it does not contain a report type.
        #[unsafe(method(reportTypeNoneMap))]
        #[unsafe(method_family = none)]
        pub unsafe fn reportTypeNoneMap(&self) -> ENDiagnosisReportType;

        /// Setter for [`reportTypeNoneMap`][Self::reportTypeNoneMap].
        #[unsafe(method(setReportTypeNoneMap:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setReportTypeNoneMap(&self, report_type_none_map: ENDiagnosisReportType);

        /// Thresholds for calculating attenuationDurations. Defaults to [50, 70, 90].
        ///
        /// Index        |0    |1    |2
        /// Variable    |X    |Y    |Z
        #[unsafe(method(attenuationDurationThresholds))]
        #[unsafe(method_family = none)]
        pub unsafe fn attenuationDurationThresholds(&self) -> Retained<NSArray<NSNumber>>;

        /// Setter for [`attenuationDurationThresholds`][Self::attenuationDurationThresholds].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAttenuationDurationThresholds:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttenuationDurationThresholds(
            &self,
            attenuation_duration_thresholds: &NSArray<NSNumber>,
        );

        /// Exclude exposures with daysSinceLastExposure > this value. Defaults to 0 (don't filter).
        #[unsafe(method(daysSinceLastExposureThreshold))]
        #[unsafe(method_family = none)]
        pub unsafe fn daysSinceLastExposureThreshold(&self) -> NSInteger;

        /// Setter for [`daysSinceLastExposureThreshold`][Self::daysSinceLastExposureThreshold].
        #[unsafe(method(setDaysSinceLastExposureThreshold:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDaysSinceLastExposureThreshold(
            &self,
            days_since_last_exposure_threshold: NSInteger,
        );

        /// Minimum risk score. Excludes exposure incidents with scores lower than this. Full range and not capped to ENRiskScore.
        #[unsafe(method(minimumRiskScoreFullRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn minimumRiskScoreFullRange(&self) -> c_double;

        /// Setter for [`minimumRiskScoreFullRange`][Self::minimumRiskScoreFullRange].
        #[unsafe(method(setMinimumRiskScoreFullRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMinimumRiskScoreFullRange(&self, minimum_risk_score_full_range: c_double);

        #[unsafe(method(attenuationLevelValues))]
        #[unsafe(method_family = none)]
        pub unsafe fn attenuationLevelValues(&self) -> Retained<NSArray<NSNumber>>;

        /// Setter for [`attenuationLevelValues`][Self::attenuationLevelValues].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAttenuationLevelValues:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttenuationLevelValues(
            &self,
            attenuation_level_values: &NSArray<NSNumber>,
        );

        #[unsafe(method(attenuationWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn attenuationWeight(&self) -> c_double;

        /// Setter for [`attenuationWeight`][Self::attenuationWeight].
        #[unsafe(method(setAttenuationWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttenuationWeight(&self, attenuation_weight: c_double);

        #[unsafe(method(daysSinceLastExposureLevelValues))]
        #[unsafe(method_family = none)]
        pub unsafe fn daysSinceLastExposureLevelValues(&self) -> Retained<NSArray<NSNumber>>;

        /// Setter for [`daysSinceLastExposureLevelValues`][Self::daysSinceLastExposureLevelValues].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDaysSinceLastExposureLevelValues:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDaysSinceLastExposureLevelValues(
            &self,
            days_since_last_exposure_level_values: &NSArray<NSNumber>,
        );

        #[unsafe(method(daysSinceLastExposureWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn daysSinceLastExposureWeight(&self) -> c_double;

        /// Setter for [`daysSinceLastExposureWeight`][Self::daysSinceLastExposureWeight].
        #[unsafe(method(setDaysSinceLastExposureWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDaysSinceLastExposureWeight(
            &self,
            days_since_last_exposure_weight: c_double,
        );

        #[unsafe(method(durationLevelValues))]
        #[unsafe(method_family = none)]
        pub unsafe fn durationLevelValues(&self) -> Retained<NSArray<NSNumber>>;

        /// Setter for [`durationLevelValues`][Self::durationLevelValues].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDurationLevelValues:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDurationLevelValues(&self, duration_level_values: &NSArray<NSNumber>);

        #[unsafe(method(durationWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn durationWeight(&self) -> c_double;

        /// Setter for [`durationWeight`][Self::durationWeight].
        #[unsafe(method(setDurationWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDurationWeight(&self, duration_weight: c_double);

        #[unsafe(method(metadata))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadata(&self) -> Option<Retained<NSDictionary>>;

        /// Setter for [`metadata`][Self::metadata].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `metadata` generic should be of the correct type.
        #[unsafe(method(setMetadata:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMetadata(&self, metadata: Option<&NSDictionary>);

        #[unsafe(method(minimumRiskScore))]
        #[unsafe(method_family = none)]
        pub unsafe fn minimumRiskScore(&self) -> ENRiskScore;

        /// Setter for [`minimumRiskScore`][Self::minimumRiskScore].
        #[unsafe(method(setMinimumRiskScore:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMinimumRiskScore(&self, minimum_risk_score: ENRiskScore);

        #[unsafe(method(transmissionRiskLevelValues))]
        #[unsafe(method_family = none)]
        pub unsafe fn transmissionRiskLevelValues(&self) -> Retained<NSArray<NSNumber>>;

        /// Setter for [`transmissionRiskLevelValues`][Self::transmissionRiskLevelValues].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTransmissionRiskLevelValues:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTransmissionRiskLevelValues(
            &self,
            transmission_risk_level_values: &NSArray<NSNumber>,
        );

        #[unsafe(method(transmissionRiskWeight))]
        #[unsafe(method_family = none)]
        pub unsafe fn transmissionRiskWeight(&self) -> c_double;

        /// Setter for [`transmissionRiskWeight`][Self::transmissionRiskWeight].
        #[unsafe(method(setTransmissionRiskWeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTransmissionRiskWeight(&self, transmission_risk_weight: c_double);
    );
}

/// Methods declared on superclass `NSObject`.
impl ENExposureConfiguration {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Summary of exposure info for a single day.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposuredaysummary?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ENExposureDaySummary;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for ENExposureDaySummary {}
);

impl ENExposureDaySummary {
    extern_methods!(
        /// Day the exposure occurred.
        #[unsafe(method(date))]
        #[unsafe(method_family = none)]
        pub unsafe fn date(&self) -> Retained<NSDate>;

        /// Summary of all exposures on this day of a specific diagnosis report type.
        #[unsafe(method(confirmedTestSummary))]
        #[unsafe(method_family = none)]
        pub unsafe fn confirmedTestSummary(&self) -> Option<Retained<ENExposureSummaryItem>>;

        #[unsafe(method(confirmedClinicalDiagnosisSummary))]
        #[unsafe(method_family = none)]
        pub unsafe fn confirmedClinicalDiagnosisSummary(
            &self,
        ) -> Option<Retained<ENExposureSummaryItem>>;

        #[unsafe(method(recursiveSummary))]
        #[unsafe(method_family = none)]
        pub unsafe fn recursiveSummary(&self) -> Option<Retained<ENExposureSummaryItem>>;

        #[unsafe(method(selfReportedSummary))]
        #[unsafe(method_family = none)]
        pub unsafe fn selfReportedSummary(&self) -> Option<Retained<ENExposureSummaryItem>>;

        /// Summary of all exposures on this day.
        #[unsafe(method(daySummary))]
        #[unsafe(method_family = none)]
        pub unsafe fn daySummary(&self) -> Retained<ENExposureSummaryItem>;
    );
}

/// Methods declared on superclass `NSObject`.
impl ENExposureDaySummary {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Summary of exposure detection.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposuredetectionsummary?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ENExposureDetectionSummary;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for ENExposureDetectionSummary {}
);

impl ENExposureDetectionSummary {
    extern_methods!(
        /// Array of durations in seconds at certain radio signal attenuations.
        /// Array index 0: Sum of durations for all exposures when attenuation
        /// <
        /// = X
        /// Array index 1: Sum of durations for all exposures when attenuation
        /// <
        /// = Y
        /// Array index 2: Sum of durations for all exposures when attenuation
        /// <
        /// = Z
        /// Array index 3: Sum of durations for all exposures when attenuation >  Z
        /// X, Y, Z come from the attenuationDurationThresholds on the configuration object.
        #[unsafe(method(attenuationDurations))]
        #[unsafe(method_family = none)]
        pub unsafe fn attenuationDurations(&self) -> Retained<NSArray<NSNumber>>;

        /// Number of days since the most recent exposure. 0 = today, 1 = yesterday, etc. Only valid if matchedKeyCount > 0.
        #[unsafe(method(daysSinceLastExposure))]
        #[unsafe(method_family = none)]
        pub unsafe fn daysSinceLastExposure(&self) -> NSInteger;

        /// Number of diagnosis keys that matched.
        #[unsafe(method(matchedKeyCount))]
        #[unsafe(method_family = none)]
        pub unsafe fn matchedKeyCount(&self) -> u64;

        /// Highest risk score of all exposure incidents.
        #[unsafe(method(maximumRiskScore))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumRiskScore(&self) -> ENRiskScore;

        /// Highest risk score of all exposure incidents.
        #[unsafe(method(maximumRiskScoreFullRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumRiskScoreFullRange(&self) -> c_double;

        /// Metadata associated with the summary.
        #[unsafe(method(metadata))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadata(&self) -> Option<Retained<NSDictionary>>;

        /// Sum of risk scores for all exposures. Summed using the full range risk scores before capping to ENRiskScore.
        #[unsafe(method(riskScoreSumFullRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn riskScoreSumFullRange(&self) -> c_double;

        /// Summary of each day containing an exposure.
        #[unsafe(method(daySummaries))]
        #[unsafe(method_family = none)]
        pub unsafe fn daySummaries(&self) -> Retained<NSArray<ENExposureDaySummary>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl ENExposureDetectionSummary {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Info about an exposure.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposureinfo?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ENExposureInfo;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for ENExposureInfo {}
);

impl ENExposureInfo {
    extern_methods!(
        /// Array of durations in seconds at certain radio signal attenuations.
        /// Array index 0: Sum of durations for this exposure when attenuation
        /// <
        /// = X
        /// Array index 1: Sum of durations for this exposure when attenuation
        /// <
        /// = Y
        /// Array index 2: Sum of durations for this exposure when attenuation
        /// <
        /// = Z
        /// Array index 3: Sum of durations for this exposure when attenuation >  Z
        /// X, Y, Z come from the attenuationDurationThresholds on the configuration object.
        #[unsafe(method(attenuationDurations))]
        #[unsafe(method_family = none)]
        pub unsafe fn attenuationDurations(&self) -> Retained<NSArray<NSNumber>>;

        /// Duration-weighted average of the attenuations associated with this exposure.
        #[unsafe(method(attenuationValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn attenuationValue(&self) -> ENAttenuation;

        /// Date when the exposure occurred. This may have reduced precision, such as within 1 day of the actual time.
        #[unsafe(method(date))]
        #[unsafe(method_family = none)]
        pub unsafe fn date(&self) -> Retained<NSDate>;

        /// Number of days since the onset of symptoms. Defaults to ENDaysSinceOnsetOfSymptomsUnknown.
        #[unsafe(method(daysSinceOnsetOfSymptoms))]
        #[unsafe(method_family = none)]
        pub unsafe fn daysSinceOnsetOfSymptoms(&self) -> NSInteger;

        /// How positive diagnosis was reported.
        #[unsafe(method(diagnosisReportType))]
        #[unsafe(method_family = none)]
        pub unsafe fn diagnosisReportType(&self) -> ENDiagnosisReportType;

        /// Length of exposure in 5 minute increments with a 30 minute maximum.
        #[unsafe(method(duration))]
        #[unsafe(method_family = none)]
        pub unsafe fn duration(&self) -> NSTimeInterval;

        /// Metadata associated with the exposure.
        #[unsafe(method(metadata))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadata(&self) -> Option<Retained<NSDictionary>>;

        /// Indicates the total risk calculated for this exposure incident. Capped to ENRiskScore range.
        #[unsafe(method(totalRiskScore))]
        #[unsafe(method_family = none)]
        pub unsafe fn totalRiskScore(&self) -> ENRiskScore;

        /// Indicates the total risk calculated for this exposure incident. Full range and not capped to ENRiskScore.
        #[unsafe(method(totalRiskScoreFullRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn totalRiskScoreFullRange(&self) -> c_double;

        /// Indicates the transmission risk associated with the diagnosis key.
        #[unsafe(method(transmissionRiskLevel))]
        #[unsafe(method_family = none)]
        pub unsafe fn transmissionRiskLevel(&self) -> ENRiskLevel;
    );
}

/// Methods declared on superclass `NSObject`.
impl ENExposureInfo {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Summary for a specific time period or report type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposuresummaryitem?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ENExposureSummaryItem;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for ENExposureSummaryItem {}
);

impl ENExposureSummaryItem {
    extern_methods!(
        /// Highest score of all exposures for this item.
        #[unsafe(method(maximumScore))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumScore(&self) -> c_double;

        /// Sum of scores for all exposure for this item.
        #[unsafe(method(scoreSum))]
        #[unsafe(method_family = none)]
        pub unsafe fn scoreSum(&self) -> c_double;

        /// Sum of exposure durations weighted by their attenuation.
        /// weightedDurationSum =
        /// ( immediateDuration * immediateDurationWeight ) +
        /// ( nearDuration      * nearDurationWeight ) +
        /// ( mediumDuration    * mediumDurationWeight ) +
        /// ( otherDuration     * otherDurationWeight ).
        #[unsafe(method(weightedDurationSum))]
        #[unsafe(method_family = none)]
        pub unsafe fn weightedDurationSum(&self) -> NSTimeInterval;
    );
}

/// Methods declared on superclass `NSObject`.
impl ENExposureSummaryItem {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// A duration of up to 30 minutes during which beacons from a TEK were observed.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enexposurewindow?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ENExposureWindow;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for ENExposureWindow {}
);

impl ENExposureWindow {
    extern_methods!(
        /// Transmitting device's calibration confidence.
        #[unsafe(method(calibrationConfidence))]
        #[unsafe(method_family = none)]
        pub unsafe fn calibrationConfidence(&self) -> ENCalibrationConfidence;

        /// Day the exposure occurred.
        #[unsafe(method(date))]
        #[unsafe(method_family = none)]
        pub unsafe fn date(&self) -> Retained<NSDate>;

        /// How positive diagnosis was reported for this the TEK observed for this window.
        #[unsafe(method(diagnosisReportType))]
        #[unsafe(method_family = none)]
        pub unsafe fn diagnosisReportType(&self) -> ENDiagnosisReportType;

        /// How infectious based on days since onset of symptoms.
        #[unsafe(method(infectiousness))]
        #[unsafe(method_family = none)]
        pub unsafe fn infectiousness(&self) -> ENInfectiousness;

        /// Each scan instance corresponds to a scan (of a few seconds) when a beacon with a TEK causing this exposure was observed.
        #[unsafe(method(scanInstances))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanInstances(&self) -> Retained<NSArray<ENScanInstance>>;

        /// Type of variant of concern
        #[unsafe(method(variantOfConcernType))]
        #[unsafe(method_family = none)]
        pub unsafe fn variantOfConcernType(&self) -> ENVariantOfConcernType;
    );
}

/// Methods declared on superclass `NSObject`.
impl ENExposureWindow {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Aggregation of attenuations of all of this TEK's beacons received during a scan.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/enscaninstance?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ENScanInstance;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for ENScanInstance {}
);

impl ENScanInstance {
    extern_methods!(
        /// Minimum attenuation of all of this TEK's beacons received during the scan.
        #[unsafe(method(minimumAttenuation))]
        #[unsafe(method_family = none)]
        pub unsafe fn minimumAttenuation(&self) -> ENAttenuation;

        /// Aggregation of the attenuations of all of this TEK's beacons received during the scan.
        #[unsafe(method(typicalAttenuation))]
        #[unsafe(method_family = none)]
        pub unsafe fn typicalAttenuation(&self) -> ENAttenuation;

        /// Seconds elapsed since the the previous scan.
        #[unsafe(method(secondsSinceLastScan))]
        #[unsafe(method_family = none)]
        pub unsafe fn secondsSinceLastScan(&self) -> NSInteger;
    );
}

/// Methods declared on superclass `NSObject`.
impl ENScanInstance {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Key used to generate rolling proximity identifiers.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/exposurenotification/entemporaryexposurekey?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ENTemporaryExposureKey;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for ENTemporaryExposureKey {}
);

impl ENTemporaryExposureKey {
    extern_methods!(
        /// Key material used to generate Rolling Proximity Identifiers.
        #[unsafe(method(keyData))]
        #[unsafe(method_family = none)]
        pub unsafe fn keyData(&self) -> Retained<NSData>;

        /// Setter for [`keyData`][Self::keyData].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setKeyData:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setKeyData(&self, key_data: &NSData);

        /// Duration this key is valid. It's the number of 10-minute windows between key rolling.
        #[unsafe(method(rollingPeriod))]
        #[unsafe(method_family = none)]
        pub unsafe fn rollingPeriod(&self) -> ENIntervalNumber;

        /// Setter for [`rollingPeriod`][Self::rollingPeriod].
        #[unsafe(method(setRollingPeriod:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRollingPeriod(&self, rolling_period: ENIntervalNumber);

        /// Interval number when the key's EKRollingPeriod started.
        #[unsafe(method(rollingStartNumber))]
        #[unsafe(method_family = none)]
        pub unsafe fn rollingStartNumber(&self) -> ENIntervalNumber;

        /// Setter for [`rollingStartNumber`][Self::rollingStartNumber].
        #[unsafe(method(setRollingStartNumber:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRollingStartNumber(&self, rolling_start_number: ENIntervalNumber);

        /// Risk of transmission associated with the person this key came from.
        #[unsafe(method(transmissionRiskLevel))]
        #[unsafe(method_family = none)]
        pub unsafe fn transmissionRiskLevel(&self) -> ENRiskLevel;

        /// Setter for [`transmissionRiskLevel`][Self::transmissionRiskLevel].
        #[unsafe(method(setTransmissionRiskLevel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTransmissionRiskLevel(&self, transmission_risk_level: ENRiskLevel);
    );
}

/// Methods declared on superclass `NSObject`.
impl ENTemporaryExposureKey {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}