///
/// CounterpartyKind.swift
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///

/// Represents the JS union `CounterpartyKind`, backed by a C++ enum.
public typealias CounterpartyKind = margelo.nitro.rncandle.CounterpartyKind

extension CounterpartyKind {
  /**
   * Get a CounterpartyKind for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  public init?(fromString string: String) {
    switch string {
    case "merchant":
      self = .merchant
    case "user":
      self = .user
    case "service":
      self = .service
    default:
      return nil
    }
  }

  /**
   * Get the String value this CounterpartyKind represents.
   */
  public var stringValue: String {
    switch self {
    case .merchant:
      return "merchant"
    case .user:
      return "user"
    case .service:
      return "service"
    }
  }
}
