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

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

  /**
   * Create a new instance of `QueryOptionsWithAnchor`.
   */
  init(anchor: String?, filter: FilterForSamples?, limit: Double) {
    self.init({ () -> bridge.std__optional_std__string_ in
      if let __unwrappedValue = anchor {
        return bridge.create_std__optional_std__string_(std.string(__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 anchor: String? {
    return { () -> String? in
      if bridge.has_value_std__optional_std__string_(self.__anchor) {
        let __unwrapped = bridge.get_std__optional_std__string_(self.__anchor)
        return String(__unwrapped)
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var filter: FilterForSamples? {
    return self.__filter.value
  }
  
  @inline(__always)
  var limit: Double {
    return self.__limit
  }
}
