///
/// NitroDeviceType.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 `NitroDeviceType`, backed by a C++ enum.
 */
public typealias NitroDeviceType = margelo.nitro.nitrodeviceinfo.NitroDeviceType

public extension NitroDeviceType {
  /**
   * Get a NitroDeviceType for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "Handset":
        self = .handset
      case "Tablet":
        self = .tablet
      case "Tv":
        self = .tv
      case "Desktop":
        self = .desktop
      case "GamingConsole":
        self = .gamingconsole
      case "unknown":
        self = .unknown
      default:
        return nil
    }
  }

  /**
   * Get the String value this NitroDeviceType represents.
   */
  var stringValue: String {
    switch self {
      case .handset:
        return "Handset"
      case .tablet:
        return "Tablet"
      case .tv:
        return "Tv"
      case .desktop:
        return "Desktop"
      case .gamingconsole:
        return "GamingConsole"
      case .unknown:
        return "unknown"
    }
  }
}
