objc2-health-kit 0.3.2

Bindings to the HealthKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkverifiableclinicalrecordsourcetype?language=objc)
// NS_TYPED_ENUM
pub type HKVerifiableClinicalRecordSourceType = NSString;

extern "C" {
    /// Represents a SMART Health Card source type for a verifiable record.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkverifiableclinicalrecordsourcetypesmarthealthcard?language=objc)
    pub static HKVerifiableClinicalRecordSourceTypeSMARTHealthCard:
        &'static HKVerifiableClinicalRecordSourceType;
}

extern "C" {
    /// Represents a EU Digital COVID Certificate source type for a verifiable record.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkverifiableclinicalrecordsourcetypeeudigitalcovidcertificate?language=objc)
    pub static HKVerifiableClinicalRecordSourceTypeEUDigitalCOVIDCertificate:
        &'static HKVerifiableClinicalRecordSourceType;
}

/// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkverifiableclinicalrecordcredentialtype?language=objc)
// NS_TYPED_ENUM
pub type HKVerifiableClinicalRecordCredentialType = NSString;

extern "C" {
    /// Represents the COVID-19 credential type for a verifiable record.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkverifiableclinicalrecordcredentialtypecovid19?language=objc)
    pub static HKVerifiableClinicalRecordCredentialTypeCOVID19:
        &'static HKVerifiableClinicalRecordCredentialType;
}

extern "C" {
    /// Represents the immunization credential type for a verifiable record.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkverifiableclinicalrecordcredentialtypeimmunization?language=objc)
    pub static HKVerifiableClinicalRecordCredentialTypeImmunization:
        &'static HKVerifiableClinicalRecordCredentialType;
}

extern "C" {
    /// Represents the laboratory credential type for a verifiable record.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkverifiableclinicalrecordcredentialtypelaboratory?language=objc)
    pub static HKVerifiableClinicalRecordCredentialTypeLaboratory:
        &'static HKVerifiableClinicalRecordCredentialType;
}

extern "C" {
    /// Represents the recovery credential type for a verifiable record.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkverifiableclinicalrecordcredentialtyperecovery?language=objc)
    pub static HKVerifiableClinicalRecordCredentialTypeRecovery:
        &'static HKVerifiableClinicalRecordCredentialType;
}

extern_class!(
    /// An NSObject that represents a verifiable clinical record.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkverifiableclinicalrecord?language=objc)
    #[unsafe(super(HKSample, HKObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "HKObject", feature = "HKSample"))]
    pub struct HKVerifiableClinicalRecord;
);

#[cfg(all(feature = "HKObject", feature = "HKSample"))]
unsafe impl Send for HKVerifiableClinicalRecord {}

#[cfg(all(feature = "HKObject", feature = "HKSample"))]
unsafe impl Sync for HKVerifiableClinicalRecord {}

#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
    unsafe impl NSCoding for HKVerifiableClinicalRecord {}
);

#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for HKVerifiableClinicalRecord {}
);

#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
    unsafe impl NSSecureCoding for HKVerifiableClinicalRecord {}
);

#[cfg(all(feature = "HKObject", feature = "HKSample"))]
impl HKVerifiableClinicalRecord {
    extern_methods!(
        /// The types present in this record.
        #[unsafe(method(recordTypes))]
        #[unsafe(method_family = none)]
        pub unsafe fn recordTypes(&self) -> Retained<NSArray<NSString>>;

        /// The identifier for the issuer of this record.
        #[unsafe(method(issuerIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn issuerIdentifier(&self) -> Retained<NSString>;

        #[cfg(feature = "HKVerifiableClinicalRecordSubject")]
        /// The subject of this record.
        #[unsafe(method(subject))]
        #[unsafe(method_family = none)]
        pub unsafe fn subject(&self) -> Retained<HKVerifiableClinicalRecordSubject>;

        /// The date this record was issued.
        #[unsafe(method(issuedDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn issuedDate(&self) -> Retained<NSDate>;

        /// A date most relevant to this record, like when a vaccine was
        /// administered or a test was performed.
        #[unsafe(method(relevantDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn relevantDate(&self) -> Retained<NSDate>;

        /// The date this record expires.
        #[unsafe(method(expirationDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn expirationDate(&self) -> Option<Retained<NSDate>>;

        /// A list of display names for each item contained in this record.
        #[unsafe(method(itemNames))]
        #[unsafe(method_family = none)]
        pub unsafe fn itemNames(&self) -> Retained<NSArray<NSString>>;

        /// The type of the source leading to this verifiable record.
        #[unsafe(method(sourceType))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceType(&self) -> Option<Retained<HKVerifiableClinicalRecordSourceType>>;

        /// The record's data representation, determined by source type.
        #[unsafe(method(dataRepresentation))]
        #[unsafe(method_family = none)]
        pub unsafe fn dataRepresentation(&self) -> Retained<NSData>;

        /// The record's entirety as JSON Web Signature (JWS) data.
        #[deprecated]
        #[unsafe(method(JWSRepresentation))]
        #[unsafe(method_family = none)]
        pub unsafe fn JWSRepresentation(&self) -> Retained<NSData>;

        #[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>;
    );
}