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

public extension PermissionStatus {
  /**
   * Get a PermissionStatus for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "not-determined":
        self = .notDetermined
      case "authorized":
        self = .authorized
      case "denied":
        self = .denied
      case "restricted":
        self = .restricted
      default:
        return nil
    }
  }

  /**
   * Get the String value this PermissionStatus represents.
   */
  var stringValue: String {
    switch self {
      case .notDetermined:
        return "not-determined"
      case .authorized:
        return "authorized"
      case .denied:
        return "denied"
      case .restricted:
        return "restricted"
    }
  }
}
