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

public extension BarcodeValueType {
  /**
   * Get a BarcodeValueType 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 "contact-info":
        self = .contactInfo
      case "email":
        self = .email
      case "isbn":
        self = .isbn
      case "phone":
        self = .phone
      case "product":
        self = .product
      case "sms":
        self = .sms
      case "text":
        self = .text
      case "url":
        self = .url
      case "wifi":
        self = .wifi
      case "geo":
        self = .geo
      case "calendar-event":
        self = .calendarEvent
      case "driver-license":
        self = .driverLicense
      default:
        return nil
    }
  }

  /**
   * Get the String value this BarcodeValueType represents.
   */
  var stringValue: String {
    switch self {
      case .unknown:
        return "unknown"
      case .contactInfo:
        return "contact-info"
      case .email:
        return "email"
      case .isbn:
        return "isbn"
      case .phone:
        return "phone"
      case .product:
        return "product"
      case .sms:
        return "sms"
      case .text:
        return "text"
      case .url:
        return "url"
      case .wifi:
        return "wifi"
      case .geo:
        return "geo"
      case .calendarEvent:
        return "calendar-event"
      case .driverLicense:
        return "driver-license"
    }
  }
}
