///
/// DeviceType.swift
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

/**
 * Represents the JS union `DeviceType`, backed by a C++ enum.
 */
public typealias DeviceType = margelo.nitro.camera.DeviceType

public extension DeviceType {
  /**
   * Get a DeviceType for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "unknown":
        self = .unknown
      case "wide-angle":
        self = .wideAngle
      case "ultra-wide-angle":
        self = .ultraWideAngle
      case "telephoto":
        self = .telephoto
      case "dual":
        self = .dual
      case "dual-wide":
        self = .dualWide
      case "triple":
        self = .triple
      case "quad":
        self = .quad
      case "continuity":
        self = .continuity
      case "lidar-depth":
        self = .lidarDepth
      case "true-depth":
        self = .trueDepth
      case "time-of-flight-depth":
        self = .timeOfFlightDepth
      case "external":
        self = .external
      default:
        return nil
    }
  }

  /**
   * Get the String value this DeviceType represents.
   */
  var stringValue: String {
    switch self {
      case .unknown:
        return "unknown"
      case .wideAngle:
        return "wide-angle"
      case .ultraWideAngle:
        return "ultra-wide-angle"
      case .telephoto:
        return "telephoto"
      case .dual:
        return "dual"
      case .dualWide:
        return "dual-wide"
      case .triple:
        return "triple"
      case .quad:
        return "quad"
      case .continuity:
        return "continuity"
      case .lidarDepth:
        return "lidar-depth"
      case .trueDepth:
        return "true-depth"
      case .timeOfFlightDepth:
        return "time-of-flight-depth"
      case .external:
        return "external"
    }
  }
}
