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

public extension NetworkStateType {
  /**
   * Get a NetworkStateType 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 "none":
        self = .none
      case "cellular":
        self = .cellular
      case "wifi":
        self = .wifi
      case "bluetooth":
        self = .bluetooth
      case "ethernet":
        self = .ethernet
      case "wimax":
        self = .wimax
      case "vpn":
        self = .vpn
      case "other":
        self = .other
      default:
        return nil
    }
  }

  /**
   * Get the String value this NetworkStateType represents.
   */
  var stringValue: String {
    switch self {
      case .unknown:
        return "unknown"
      case .none:
        return "none"
      case .cellular:
        return "cellular"
      case .wifi:
        return "wifi"
      case .bluetooth:
        return "bluetooth"
      case .ethernet:
        return "ethernet"
      case .wimax:
        return "wimax"
      case .vpn:
        return "vpn"
      case .other:
        return "other"
    }
  }
}
