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

public extension ScannedObjectType {
  /**
   * Get a ScannedObjectType 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 "codabar":
        self = .codabar
      case "code-39":
        self = .code39
      case "code-39-mod-43":
        self = .code39Mod43
      case "code-93":
        self = .code93
      case "code-128":
        self = .code128
      case "ean-8":
        self = .ean8
      case "ean-13":
        self = .ean13
      case "gs1-data-bar":
        self = .gs1DataBar
      case "gs1-data-bar-expanded":
        self = .gs1DataBarExpanded
      case "gs1-data-bar-limited":
        self = .gs1DataBarLimited
      case "interleaved-2-of-5":
        self = .interleaved2Of5
      case "itf-14":
        self = .itf14
      case "upc-e":
        self = .upcE
      case "aztec":
        self = .aztec
      case "data-matrix":
        self = .dataMatrix
      case "micro-pdf-417":
        self = .microPdf417
      case "micro-qr":
        self = .microQr
      case "pdf-417":
        self = .pdf417
      case "qr":
        self = .qr
      case "human-body":
        self = .humanBody
      case "human-full-body":
        self = .humanFullBody
      case "dog-head":
        self = .dogHead
      case "dog-body":
        self = .dogBody
      case "cat-head":
        self = .catHead
      case "cat-body":
        self = .catBody
      case "face":
        self = .face
      case "salient-object":
        self = .salientObject
      default:
        return nil
    }
  }

  /**
   * Get the String value this ScannedObjectType represents.
   */
  var stringValue: String {
    switch self {
      case .unknown:
        return "unknown"
      case .codabar:
        return "codabar"
      case .code39:
        return "code-39"
      case .code39Mod43:
        return "code-39-mod-43"
      case .code93:
        return "code-93"
      case .code128:
        return "code-128"
      case .ean8:
        return "ean-8"
      case .ean13:
        return "ean-13"
      case .gs1DataBar:
        return "gs1-data-bar"
      case .gs1DataBarExpanded:
        return "gs1-data-bar-expanded"
      case .gs1DataBarLimited:
        return "gs1-data-bar-limited"
      case .interleaved2Of5:
        return "interleaved-2-of-5"
      case .itf14:
        return "itf-14"
      case .upcE:
        return "upc-e"
      case .aztec:
        return "aztec"
      case .dataMatrix:
        return "data-matrix"
      case .microPdf417:
        return "micro-pdf-417"
      case .microQr:
        return "micro-qr"
      case .pdf417:
        return "pdf-417"
      case .qr:
        return "qr"
      case .humanBody:
        return "human-body"
      case .humanFullBody:
        return "human-full-body"
      case .dogHead:
        return "dog-head"
      case .dogBody:
        return "dog-body"
      case .catHead:
        return "cat-head"
      case .catBody:
        return "cat-body"
      case .face:
        return "face"
      case .salientObject:
        return "salient-object"
    }
  }
}
