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

public extension HapticPreset {
  /**
   * Get a HapticPreset for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "selection":
        self = .selection
      case "impactLight":
        self = .impactlight
      case "impactMedium":
        self = .impactmedium
      case "impactHeavy":
        self = .impactheavy
      case "impactSoft":
        self = .impactsoft
      case "impactRigid":
        self = .impactrigid
      case "notificationSuccess":
        self = .notificationsuccess
      case "notificationWarning":
        self = .notificationwarning
      case "notificationError":
        self = .notificationerror
      default:
        return nil
    }
  }

  /**
   * Get the String value this HapticPreset represents.
   */
  var stringValue: String {
    switch self {
      case .selection:
        return "selection"
      case .impactlight:
        return "impactLight"
      case .impactmedium:
        return "impactMedium"
      case .impactheavy:
        return "impactHeavy"
      case .impactsoft:
        return "impactSoft"
      case .impactrigid:
        return "impactRigid"
      case .notificationsuccess:
        return "notificationSuccess"
      case .notificationwarning:
        return "notificationWarning"
      case .notificationerror:
        return "notificationError"
    }
  }
}
