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

extension TradeAssetKind {
  /**
   * Get a TradeAssetKind for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  public init?(fromString string: String) {
    switch string {
    case "stock":
      self = .stock
    case "crypto":
      self = .crypto
    case "fiat":
      self = .fiat
    case "transport":
      self = .transport
    case "other":
      self = .other
    case "nothing":
      self = .nothing
    default:
      return nil
    }
  }

  /**
   * Get the String value this TradeAssetKind represents.
   */
  public var stringValue: String {
    switch self {
    case .stock:
      return "stock"
    case .crypto:
      return "crypto"
    case .fiat:
      return "fiat"
    case .transport:
      return "transport"
    case .other:
      return "other"
    case .nothing:
      return "nothing"
    }
  }
}
