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

public extension GeneralForm {
  /**
   * Get a GeneralForm for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "device":
        self = .device
      case "unknown":
        self = .unknown
      case "capsule":
        self = .capsule
      case "cream":
        self = .cream
      case "drops":
        self = .drops
      case "foam":
        self = .foam
      case "gel":
        self = .gel
      case "inhaler":
        self = .inhaler
      case "injection":
        self = .injection
      case "liquid":
        self = .liquid
      case "lotion":
        self = .lotion
      case "ointment":
        self = .ointment
      case "patch":
        self = .patch
      case "powder":
        self = .powder
      case "spray":
        self = .spray
      case "suppository":
        self = .suppository
      case "tablet":
        self = .tablet
      case "topical":
        self = .topical
      default:
        return nil
    }
  }

  /**
   * Get the String value this GeneralForm represents.
   */
  var stringValue: String {
    switch self {
      case .device:
        return "device"
      case .unknown:
        return "unknown"
      case .capsule:
        return "capsule"
      case .cream:
        return "cream"
      case .drops:
        return "drops"
      case .foam:
        return "foam"
      case .gel:
        return "gel"
      case .inhaler:
        return "inhaler"
      case .injection:
        return "injection"
      case .liquid:
        return "liquid"
      case .lotion:
        return "lotion"
      case .ointment:
        return "ointment"
      case .patch:
        return "patch"
      case .powder:
        return "powder"
      case .spray:
        return "spray"
      case .suppository:
        return "suppository"
      case .tablet:
        return "tablet"
      case .topical:
        return "topical"
    }
  }
}
