104 lines
2.9 KiB
Swift
Generated
104 lines
2.9 KiB
Swift
Generated
///
|
|
/// NativeHealthMetricSample.swift
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
import NitroModules
|
|
|
|
/**
|
|
* Represents an instance of `NativeHealthMetricSample`, backed by a C++ struct.
|
|
*/
|
|
public typealias NativeHealthMetricSample = margelo.nitro.haptika.ppg.NativeHealthMetricSample
|
|
|
|
public extension NativeHealthMetricSample {
|
|
private typealias bridge = margelo.nitro.haptika.ppg.bridge.swift
|
|
|
|
/**
|
|
* Create a new instance of `NativeHealthMetricSample`.
|
|
*/
|
|
init(type: HealthMetricType, value: Double, unit: String, startDate: String, endDate: String, sourceName: String?, sourceBundleIdentifier: String?, deviceName: String?) {
|
|
self.init(type, value, std.string(unit), std.string(startDate), std.string(endDate), { () -> bridge.std__optional_std__string_ in
|
|
if let __unwrappedValue = sourceName {
|
|
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
} else {
|
|
return .init()
|
|
}
|
|
}(), { () -> bridge.std__optional_std__string_ in
|
|
if let __unwrappedValue = sourceBundleIdentifier {
|
|
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
} else {
|
|
return .init()
|
|
}
|
|
}(), { () -> bridge.std__optional_std__string_ in
|
|
if let __unwrappedValue = deviceName {
|
|
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
} else {
|
|
return .init()
|
|
}
|
|
}())
|
|
}
|
|
|
|
@inline(__always)
|
|
var type: HealthMetricType {
|
|
return self.__type
|
|
}
|
|
|
|
@inline(__always)
|
|
var value: Double {
|
|
return self.__value
|
|
}
|
|
|
|
@inline(__always)
|
|
var unit: String {
|
|
return String(self.__unit)
|
|
}
|
|
|
|
@inline(__always)
|
|
var startDate: String {
|
|
return String(self.__startDate)
|
|
}
|
|
|
|
@inline(__always)
|
|
var endDate: String {
|
|
return String(self.__endDate)
|
|
}
|
|
|
|
@inline(__always)
|
|
var sourceName: String? {
|
|
return { () -> String? in
|
|
if bridge.has_value_std__optional_std__string_(self.__sourceName) {
|
|
let __unwrapped = bridge.get_std__optional_std__string_(self.__sourceName)
|
|
return String(__unwrapped)
|
|
} else {
|
|
return nil
|
|
}
|
|
}()
|
|
}
|
|
|
|
@inline(__always)
|
|
var sourceBundleIdentifier: String? {
|
|
return { () -> String? in
|
|
if bridge.has_value_std__optional_std__string_(self.__sourceBundleIdentifier) {
|
|
let __unwrapped = bridge.get_std__optional_std__string_(self.__sourceBundleIdentifier)
|
|
return String(__unwrapped)
|
|
} else {
|
|
return nil
|
|
}
|
|
}()
|
|
}
|
|
|
|
@inline(__always)
|
|
var deviceName: String? {
|
|
return { () -> String? in
|
|
if bridge.has_value_std__optional_std__string_(self.__deviceName) {
|
|
let __unwrapped = bridge.get_std__optional_std__string_(self.__deviceName)
|
|
return String(__unwrapped)
|
|
} else {
|
|
return nil
|
|
}
|
|
}()
|
|
}
|
|
}
|