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

public extension AudioSessionCategory {
  /**
   * Get a AudioSessionCategory for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "ambient":
        self = .ambient
      case "soloAmbient":
        self = .soloambient
      case "playback":
        self = .playback
      case "playAndRecord":
        self = .playandrecord
      default:
        return nil
    }
  }

  /**
   * Get the String value this AudioSessionCategory represents.
   */
  var stringValue: String {
    switch self {
      case .ambient:
        return "ambient"
      case .soloambient:
        return "soloAmbient"
      case .playback:
        return "playback"
      case .playandrecord:
        return "playAndRecord"
    }
  }
}
