objc2_health_kit/generated/
HKCumulativeQuantitySeriesSample.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkcumulativequantityseriessample?language=objc)
11    #[unsafe(super(
12        HKCumulativeQuantitySample,
13        HKQuantitySample,
14        HKSample,
15        HKObject,
16        NSObject
17    ))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(all(
20        feature = "HKCumulativeQuantitySample",
21        feature = "HKObject",
22        feature = "HKQuantitySample",
23        feature = "HKSample"
24    ))]
25    #[deprecated]
26    pub struct HKCumulativeQuantitySeriesSample;
27);
28
29#[cfg(all(
30    feature = "HKCumulativeQuantitySample",
31    feature = "HKObject",
32    feature = "HKQuantitySample",
33    feature = "HKSample"
34))]
35unsafe impl Send for HKCumulativeQuantitySeriesSample {}
36
37#[cfg(all(
38    feature = "HKCumulativeQuantitySample",
39    feature = "HKObject",
40    feature = "HKQuantitySample",
41    feature = "HKSample"
42))]
43unsafe impl Sync for HKCumulativeQuantitySeriesSample {}
44
45#[cfg(all(
46    feature = "HKCumulativeQuantitySample",
47    feature = "HKObject",
48    feature = "HKQuantitySample",
49    feature = "HKSample"
50))]
51extern_conformance!(
52    unsafe impl NSCoding for HKCumulativeQuantitySeriesSample {}
53);
54
55#[cfg(all(
56    feature = "HKCumulativeQuantitySample",
57    feature = "HKObject",
58    feature = "HKQuantitySample",
59    feature = "HKSample"
60))]
61extern_conformance!(
62    unsafe impl NSObjectProtocol for HKCumulativeQuantitySeriesSample {}
63);
64
65#[cfg(all(
66    feature = "HKCumulativeQuantitySample",
67    feature = "HKObject",
68    feature = "HKQuantitySample",
69    feature = "HKSample"
70))]
71extern_conformance!(
72    unsafe impl NSSecureCoding for HKCumulativeQuantitySeriesSample {}
73);
74
75#[cfg(all(
76    feature = "HKCumulativeQuantitySample",
77    feature = "HKObject",
78    feature = "HKQuantitySample",
79    feature = "HKSample"
80))]
81impl HKCumulativeQuantitySeriesSample {
82    extern_methods!(
83        #[cfg(feature = "HKQuantity")]
84        #[deprecated]
85        #[unsafe(method(sum))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn sum(&self) -> Retained<HKQuantity>;
88    );
89}
90
91/// Methods declared on superclass `HKQuantitySample`.
92#[cfg(all(
93    feature = "HKCumulativeQuantitySample",
94    feature = "HKObject",
95    feature = "HKQuantitySample",
96    feature = "HKSample"
97))]
98impl HKCumulativeQuantitySeriesSample {
99    extern_methods!(
100        #[cfg(all(feature = "HKObjectType", feature = "HKQuantity"))]
101        /// Creates a new HKQuantitySample with the given type, quantity, start date, and end date.
102        ///
103        /// The quantity must have a unit that is compatible with the given quantity type.
104        /// See -[HKQuantityType isCompatibleWithUnit:].
105        #[unsafe(method(quantitySampleWithType:quantity:startDate:endDate:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn quantitySampleWithType_quantity_startDate_endDate(
108            quantity_type: &HKQuantityType,
109            quantity: &HKQuantity,
110            start_date: &NSDate,
111            end_date: &NSDate,
112        ) -> Retained<Self>;
113
114        #[cfg(all(feature = "HKObjectType", feature = "HKQuantity"))]
115        /// Creates a new HKQuantitySample with the given type, quantity, start date, end date, and metadata.
116        ///
117        /// The quantity must have a unit that is compatible with the given quantity type.
118        /// See -[HKQuantityType isCompatibleWithUnit:].
119        ///
120        /// # Safety
121        ///
122        /// `metadata` generic should be of the correct type.
123        #[unsafe(method(quantitySampleWithType:quantity:startDate:endDate:metadata:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn quantitySampleWithType_quantity_startDate_endDate_metadata(
126            quantity_type: &HKQuantityType,
127            quantity: &HKQuantity,
128            start_date: &NSDate,
129            end_date: &NSDate,
130            metadata: Option<&NSDictionary<NSString, AnyObject>>,
131        ) -> Retained<Self>;
132
133        #[cfg(all(feature = "HKDevice", feature = "HKObjectType", feature = "HKQuantity"))]
134        /// Creates a new HKQuantitySample with the given type, quantity, start date, end date, and metadata.
135        ///
136        /// Parameter `quantityType`: The type of the sample.
137        ///
138        /// Parameter `startDate`: The start date of the sample.
139        ///
140        /// Parameter `endDate`: The end date of the sample.
141        ///
142        /// Parameter `device`: The HKDevice that generated the sample (optional).
143        ///
144        /// Parameter `metadata`: Metadata for the sample (optional).
145        ///
146        /// The quantity must have a unit that is compatible with the given quantity type.
147        /// See -[HKQuantityType isCompatibleWithUnit:].
148        ///
149        /// # Safety
150        ///
151        /// `metadata` generic should be of the correct type.
152        #[unsafe(method(quantitySampleWithType:quantity:startDate:endDate:device:metadata:))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn quantitySampleWithType_quantity_startDate_endDate_device_metadata(
155            quantity_type: &HKQuantityType,
156            quantity: &HKQuantity,
157            start_date: &NSDate,
158            end_date: &NSDate,
159            device: Option<&HKDevice>,
160            metadata: Option<&NSDictionary<NSString, AnyObject>>,
161        ) -> Retained<Self>;
162    );
163}
164
165/// Methods declared on superclass `HKObject`.
166#[cfg(all(
167    feature = "HKCumulativeQuantitySample",
168    feature = "HKObject",
169    feature = "HKQuantitySample",
170    feature = "HKSample"
171))]
172impl HKCumulativeQuantitySeriesSample {
173    extern_methods!(
174        #[unsafe(method(init))]
175        #[unsafe(method_family = init)]
176        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
177    );
178}
179
180/// Methods declared on superclass `NSObject`.
181#[cfg(all(
182    feature = "HKCumulativeQuantitySample",
183    feature = "HKObject",
184    feature = "HKQuantitySample",
185    feature = "HKSample"
186))]
187impl HKCumulativeQuantitySeriesSample {
188    extern_methods!(
189        #[unsafe(method(new))]
190        #[unsafe(method_family = new)]
191        pub unsafe fn new() -> Retained<Self>;
192    );
193}