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

public extension NativeTriggerType {
  /**
   * Get a NativeTriggerType 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 "timeInterval":
        self = .timeinterval
      case "date":
        self = .date
      case "push":
        self = .push
      default:
        return nil
    }
  }

  /**
   * Get the String value this NativeTriggerType represents.
   */
  var stringValue: String {
    switch self {
      case .unknown:
        return "unknown"
      case .timeinterval:
        return "timeInterval"
      case .date:
        return "date"
      case .push:
        return "push"
    }
  }
}
