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

public extension TTSGenerateOptions {
  private typealias bridge = margelo.nitro.mlxreactnative.bridge.swift

  /**
   * Create a new instance of `TTSGenerateOptions`.
   */
  init(voice: String?, speed: Double?) {
    self.init({ () -> bridge.std__optional_std__string_ in
      if let __unwrappedValue = voice {
        return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = speed {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }())
  }

  @inline(__always)
  var voice: String? {
    return { () -> String? in
      if bridge.has_value_std__optional_std__string_(self.__voice) {
        let __unwrapped = bridge.get_std__optional_std__string_(self.__voice)
        return String(__unwrapped)
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var speed: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__speed) {
        let __unwrapped = bridge.get_std__optional_double_(self.__speed)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
}
