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

public extension SubscriptionReplacementModeAndroid {
  /**
   * Get a SubscriptionReplacementModeAndroid for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "unknown-replacement-mode":
        self = .unknownReplacementMode
      case "with-time-proration":
        self = .withTimeProration
      case "charge-prorated-price":
        self = .chargeProratedPrice
      case "charge-full-price":
        self = .chargeFullPrice
      case "without-proration":
        self = .withoutProration
      case "deferred":
        self = .deferred
      case "keep-existing":
        self = .keepExisting
      default:
        return nil
    }
  }

  /**
   * Get the String value this SubscriptionReplacementModeAndroid represents.
   */
  var stringValue: String {
    switch self {
      case .unknownReplacementMode:
        return "unknown-replacement-mode"
      case .withTimeProration:
        return "with-time-proration"
      case .chargeProratedPrice:
        return "charge-prorated-price"
      case .chargeFullPrice:
        return "charge-full-price"
      case .withoutProration:
        return "without-proration"
      case .deferred:
        return "deferred"
      case .keepExisting:
        return "keep-existing"
    }
  }
}
