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

public extension StorageBackend {
  /**
   * Get a StorageBackend for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "keychain":
        self = .keychain
      case "androidKeystore":
        self = .androidkeystore
      case "encryptedSharedPreferences":
        self = .encryptedsharedpreferences
      default:
        return nil
    }
  }

  /**
   * Get the String value this StorageBackend represents.
   */
  var stringValue: String {
    switch self {
      case .keychain:
        return "keychain"
      case .androidkeystore:
        return "androidKeystore"
      case .encryptedsharedpreferences:
        return "encryptedSharedPreferences"
    }
  }
}
