///
/// AppleAuthOperation.swift
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///

/**
 * Represents the JS enum `AppleAuthOperation`, backed by a C++ enum.
 */
public typealias AppleAuthOperation = margelo.nitro.appleauth.AppleAuthOperation

public extension AppleAuthOperation {
  /**
   * Get a AppleAuthOperation for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "LOGIN":
        self = .login
      case "LOGOUT":
        self = .logout
      case "IMPLICIT":
        self = .implicit
      default:
        return nil
    }
  }

  /**
   * Get the String value this AppleAuthOperation represents.
   */
  var stringValue: String {
    switch self {
      case .login:
        return "LOGIN"
      case .logout:
        return "LOGOUT"
      case .implicit:
        return "IMPLICIT"
    }
  }
}
