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

public extension InterruptionReason {
  /**
   * Get a InterruptionReason 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 "video-device-not-available-in-background":
        self = .videoDeviceNotAvailableInBackground
      case "audio-device-in-use-by-another-client":
        self = .audioDeviceInUseByAnotherClient
      case "video-device-in-use-by-another-client":
        self = .videoDeviceInUseByAnotherClient
      case "video-device-not-available-with-multiple-foreground-apps":
        self = .videoDeviceNotAvailableWithMultipleForegroundApps
      case "video-device-not-available-due-to-system-pressure":
        self = .videoDeviceNotAvailableDueToSystemPressure
      case "sensitive-content-mitigation-activated":
        self = .sensitiveContentMitigationActivated
      default:
        return nil
    }
  }

  /**
   * Get the String value this InterruptionReason represents.
   */
  var stringValue: String {
    switch self {
      case .unknown:
        return "unknown"
      case .videoDeviceNotAvailableInBackground:
        return "video-device-not-available-in-background"
      case .audioDeviceInUseByAnotherClient:
        return "audio-device-in-use-by-another-client"
      case .videoDeviceInUseByAnotherClient:
        return "video-device-in-use-by-another-client"
      case .videoDeviceNotAvailableWithMultipleForegroundApps:
        return "video-device-not-available-with-multiple-foreground-apps"
      case .videoDeviceNotAvailableDueToSystemPressure:
        return "video-device-not-available-due-to-system-pressure"
      case .sensitiveContentMitigationActivated:
        return "sensitive-content-mitigation-activated"
    }
  }
}
