Enum Class TradingApiEnvironment

java.lang.Object
java.lang.Enum<TradingApiEnvironment>
markets.alpaca.client.TradingApiEnvironment
All Implemented Interfaces:
Serializable, Comparable<TradingApiEnvironment>, Constable

public enum TradingApiEnvironment extends Enum<TradingApiEnvironment>
Selects between the Alpaca paper and production Trading REST API endpoints.
  • Enum Constant Details

    • PAPER

      public static final TradingApiEnvironment PAPER
      paper-api.alpaca.markets — paper trading account endpoint.
    • PRODUCTION

      public static final TradingApiEnvironment PRODUCTION
      api.alpaca.markets — live trading account endpoint.
  • Method Details

    • values

      public static TradingApiEnvironment[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TradingApiEnvironment valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • baseUrl

      public String baseUrl()
      Returns the REST API base URL for this environment.
    • from

      public static TradingApiEnvironment from(String value)
      Parses a user-provided environment value.

      Accepted values are paper, production, prod, and live.