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/hkfhirresourcetype?language=objc)
// NS_TYPED_ENUM
pub type HKFHIRResourceType = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypeallergyintolerance?language=objc)
    pub static HKFHIRResourceTypeAllergyIntolerance: &'static HKFHIRResourceType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypecondition?language=objc)
    pub static HKFHIRResourceTypeCondition: &'static HKFHIRResourceType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypecoverage?language=objc)
    pub static HKFHIRResourceTypeCoverage: &'static HKFHIRResourceType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypediagnosticreport?language=objc)
    pub static HKFHIRResourceTypeDiagnosticReport: &'static HKFHIRResourceType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypedocumentreference?language=objc)
    pub static HKFHIRResourceTypeDocumentReference: &'static HKFHIRResourceType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypeimmunization?language=objc)
    pub static HKFHIRResourceTypeImmunization: &'static HKFHIRResourceType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypemedicationdispense?language=objc)
    pub static HKFHIRResourceTypeMedicationDispense: &'static HKFHIRResourceType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypemedicationorder?language=objc)
    pub static HKFHIRResourceTypeMedicationOrder: &'static HKFHIRResourceType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypemedicationrequest?language=objc)
    pub static HKFHIRResourceTypeMedicationRequest: &'static HKFHIRResourceType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypemedicationstatement?language=objc)
    pub static HKFHIRResourceTypeMedicationStatement: &'static HKFHIRResourceType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypeobservation?language=objc)
    pub static HKFHIRResourceTypeObservation: &'static HKFHIRResourceType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresourcetypeprocedure?language=objc)
    pub static HKFHIRResourceTypeProcedure: &'static HKFHIRResourceType;
}

extern_class!(
    /// The HKFHIRResource class encapsulates a FHIR (Fast Healthcare Interoperability Resources) resource.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkfhirresource?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct HKFHIRResource;
);

unsafe impl Send for HKFHIRResource {}

unsafe impl Sync for HKFHIRResource {}

extern_conformance!(
    unsafe impl NSCoding for HKFHIRResource {}
);

extern_conformance!(
    unsafe impl NSCopying for HKFHIRResource {}
);

unsafe impl CopyingHelper for HKFHIRResource {
    type Result = Self;
}

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

extern_conformance!(
    unsafe impl NSSecureCoding for HKFHIRResource {}
);

impl HKFHIRResource {
    extern_methods!(
        #[cfg(feature = "HKFHIRVersion")]
        /// The FHIR version of the resource data.
        #[unsafe(method(FHIRVersion))]
        #[unsafe(method_family = none)]
        pub unsafe fn FHIRVersion(&self) -> Retained<HKFHIRVersion>;

        /// The resource type, corresponding to the 'resourceType' field in the resource's JSON representation.
        ///
        /// May be one of 8 FHIR resource types supported within HealthKit: AllergyIntolerance, Condition,
        /// Immunization, MedicationDispense, MedicationOrder, MedicationStatement, Observation, and Procedure.
        #[unsafe(method(resourceType))]
        #[unsafe(method_family = none)]
        pub unsafe fn resourceType(&self) -> Retained<HKFHIRResourceType>;

        /// The identifier of the resource, corresponding to the 'id' field in the resource's JSON representation.
        ///
        /// Unique within a given resource type and FHIR end-point, as represented by an HKSource.
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Retained<NSString>;

        /// The JSON representation of the FHIR resource.
        ///
        /// Conforms to the HL7 Argonaut Project resource type definitions.
        #[unsafe(method(data))]
        #[unsafe(method_family = none)]
        pub unsafe fn data(&self) -> Retained<NSData>;

        /// The fully specified source URL of the FHIR resource.
        ///
        /// This URL can be used to help determine the provenance of the resource. Direct access is protected by
        /// OAuth: querying without suitable authorization will result in an authorization error.
        #[unsafe(method(sourceURL))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceURL(&self) -> Option<Retained<NSURL>>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl HKFHIRResource {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}