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

public extension PaymentModeIOS {
  /**
   * Get a PaymentModeIOS for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "empty":
        self = .empty
      case "free-trial":
        self = .freeTrial
      case "pay-as-you-go":
        self = .payAsYouGo
      case "pay-up-front":
        self = .payUpFront
      default:
        return nil
    }
  }

  /**
   * Get the String value this PaymentModeIOS represents.
   */
  var stringValue: String {
    switch self {
      case .empty:
        return "empty"
      case .freeTrial:
        return "free-trial"
      case .payAsYouGo:
        return "pay-as-you-go"
      case .payUpFront:
        return "pay-up-front"
    }
  }
}
