///
/// ECGQueryOptionsWithSortOrder.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 `ECGQueryOptionsWithSortOrder`, backed by a C++ struct.
 */
public typealias ECGQueryOptionsWithSortOrder = margelo.nitro.healthkit.ECGQueryOptionsWithSortOrder

public extension ECGQueryOptionsWithSortOrder {
  private typealias bridge = margelo.nitro.healthkit.bridge.swift

  /**
   * Create a new instance of `ECGQueryOptionsWithSortOrder`.
   */
  init(includeVoltages: Bool?, ascending: Bool?, filter: FilterForSamples?, limit: Double) {
    self.init({ () -> bridge.std__optional_bool_ in
      if let __unwrappedValue = includeVoltages {
        return bridge.create_std__optional_bool_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_bool_ in
      if let __unwrappedValue = ascending {
        return bridge.create_std__optional_bool_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_FilterForSamples_ in
      if let __unwrappedValue = filter {
        return bridge.create_std__optional_FilterForSamples_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), limit)
  }

  @inline(__always)
  var includeVoltages: Bool? {
    return { () -> Bool? in
      if bridge.has_value_std__optional_bool_(self.__includeVoltages) {
        let __unwrapped = bridge.get_std__optional_bool_(self.__includeVoltages)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var ascending: Bool? {
    return { () -> Bool? in
      if bridge.has_value_std__optional_bool_(self.__ascending) {
        let __unwrapped = bridge.get_std__optional_bool_(self.__ascending)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var filter: FilterForSamples? {
    return self.__filter.value
  }
  
  @inline(__always)
  var limit: Double {
    return self.__limit
  }
}
