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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkverifiableclinicalrecordquery?language=objc)
    #[unsafe(super(HKQuery, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "HKQuery")]
    pub struct HKVerifiableClinicalRecordQuery;
);

#[cfg(feature = "HKQuery")]
unsafe impl Send for HKVerifiableClinicalRecordQuery {}

#[cfg(feature = "HKQuery")]
unsafe impl Sync for HKVerifiableClinicalRecordQuery {}

#[cfg(feature = "HKQuery")]
extern_conformance!(
    unsafe impl NSObjectProtocol for HKVerifiableClinicalRecordQuery {}
);

#[cfg(feature = "HKQuery")]
impl HKVerifiableClinicalRecordQuery {
    extern_methods!(
        /// The record types that need to be present on desired records.
        #[unsafe(method(recordTypes))]
        #[unsafe(method_family = none)]
        pub unsafe fn recordTypes(&self) -> Retained<NSArray<NSString>>;

        #[cfg(feature = "HKVerifiableClinicalRecord")]
        /// The source type(s) of the records.
        #[unsafe(method(sourceTypes))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceTypes(&self)
            -> Retained<NSArray<HKVerifiableClinicalRecordSourceType>>;

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

        #[cfg(all(
            feature = "HKObject",
            feature = "HKSample",
            feature = "HKVerifiableClinicalRecord",
            feature = "block2"
        ))]
        /// Returns an one-time query that will ask for access to verifiable clinical records that match the query.
        ///
        ///
        /// Parameter `recordTypes`: The record types that need to be present on a verifiable clinical record.
        ///
        /// Parameter `predicate`: The predicate which records should match.
        ///
        /// Parameter `resultsHandler`: The block to invoke with the verifiable clinical records from the query.
        ///
        /// # Safety
        ///
        /// `results_handler` block must be sendable.
        #[unsafe(method(initWithRecordTypes:predicate:resultsHandler:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRecordTypes_predicate_resultsHandler(
            this: Allocated<Self>,
            record_types: &NSArray<NSString>,
            predicate: Option<&NSPredicate>,
            results_handler: &block2::DynBlock<
                dyn Fn(
                    NonNull<HKVerifiableClinicalRecordQuery>,
                    *mut NSArray<HKVerifiableClinicalRecord>,
                    *mut NSError,
                ),
            >,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "HKObject",
            feature = "HKSample",
            feature = "HKVerifiableClinicalRecord",
            feature = "block2"
        ))]
        /// Returns a one-time query that will ask for access to and return verifiable clinical records that match the query.
        ///
        ///
        /// Parameter `recordTypes`: The record types that need to be present on a verifiable clinical record.
        ///
        /// Parameter `sourceTypes`: The source type(s) of the records.
        ///
        /// Parameter `predicate`: The predicate which records should match.
        ///
        /// Parameter `resultsHandler`: The block to invoke with the verifiable clinical records from the query.
        ///
        /// # Safety
        ///
        /// `results_handler` block must be sendable.
        #[unsafe(method(initWithRecordTypes:sourceTypes:predicate:resultsHandler:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRecordTypes_sourceTypes_predicate_resultsHandler(
            this: Allocated<Self>,
            record_types: &NSArray<NSString>,
            source_types: &NSArray<HKVerifiableClinicalRecordSourceType>,
            predicate: Option<&NSPredicate>,
            results_handler: &block2::DynBlock<
                dyn Fn(
                    NonNull<HKVerifiableClinicalRecordQuery>,
                    *mut NSArray<HKVerifiableClinicalRecord>,
                    *mut NSError,
                ),
            >,
        ) -> Retained<Self>;
    );
}