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

public extension LocalAuthenticationStatus {
  private typealias bridge = margelo.nitro.one.bridge.swift

  /**
   * Create a new instance of `LocalAuthenticationStatus`.
   */
  init(available: Bool, biometryType: LocalBiometryType, errorCode: Double?) {
    self.init(available, biometryType, { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = errorCode {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }())
  }

  @inline(__always)
  var available: Bool {
    return self.__available
  }
  
  @inline(__always)
  var biometryType: LocalBiometryType {
    return self.__biometryType
  }
  
  @inline(__always)
  var errorCode: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__errorCode) {
        let __unwrapped = bridge.get_std__optional_double_(self.__errorCode)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
}
