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::*;

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

unsafe impl Send for HKObject {}

unsafe impl Sync for HKObject {}

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

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

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

impl HKObject {
    extern_methods!(
        /// A unique identifier of the receiver in the HealthKit database.
        #[unsafe(method(UUID))]
        #[unsafe(method_family = none)]
        pub unsafe fn UUID(&self) -> Retained<NSUUID>;

        #[cfg(feature = "HKSource")]
        #[deprecated]
        #[unsafe(method(source))]
        #[unsafe(method_family = none)]
        pub unsafe fn source(&self) -> Retained<HKSource>;

        #[cfg(feature = "HKSourceRevision")]
        /// Represents the revision of the source responsible for saving the receiver.
        #[unsafe(method(sourceRevision))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceRevision(&self) -> Retained<HKSourceRevision>;

        #[cfg(feature = "HKDevice")]
        /// Represents the device that generated the data of the receiver.
        #[unsafe(method(device))]
        #[unsafe(method_family = none)]
        pub unsafe fn device(&self) -> Option<Retained<HKDevice>>;

        /// Extra information describing properties of the receiver.
        ///
        /// Keys must be NSString and values must be either NSString, NSNumber, NSDate, or
        /// HKQuantity. See HKMetadata.h for potential metadata keys and values.
        #[unsafe(method(metadata))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadata(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;

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

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

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

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

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

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

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

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

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

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