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

public extension SecureStoreAccessibility {
  /**
   * Get a SecureStoreAccessibility for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "always":
        self = .always
      case "afterFirstUnlock":
        self = .afterfirstunlock
      case "afterFirstUnlockThisDeviceOnly":
        self = .afterfirstunlockthisdeviceonly
      case "alwaysThisDeviceOnly":
        self = .alwaysthisdeviceonly
      case "whenPasscodeSetThisDeviceOnly":
        self = .whenpasscodesetthisdeviceonly
      case "whenUnlocked":
        self = .whenunlocked
      case "whenUnlockedThisDeviceOnly":
        self = .whenunlockedthisdeviceonly
      default:
        return nil
    }
  }

  /**
   * Get the String value this SecureStoreAccessibility represents.
   */
  var stringValue: String {
    switch self {
      case .always:
        return "always"
      case .afterfirstunlock:
        return "afterFirstUnlock"
      case .afterfirstunlockthisdeviceonly:
        return "afterFirstUnlockThisDeviceOnly"
      case .alwaysthisdeviceonly:
        return "alwaysThisDeviceOnly"
      case .whenpasscodesetthisdeviceonly:
        return "whenPasscodeSetThisDeviceOnly"
      case .whenunlocked:
        return "whenUnlocked"
      case .whenunlockedthisdeviceonly:
        return "whenUnlockedThisDeviceOnly"
    }
  }
}
