Class PortfolioWeightRequestBase

java.lang.Object
markets.alpaca.client.openapi.broker.model.PortfolioWeightRequestBase
All Implemented Interfaces:
Serializable

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.28.0") public class PortfolioWeightRequestBase extends Object implements Serializable
Shared fields for a portfolio weight in a create or update request.
See Also:
  • Field Details

  • Constructor Details

    • PortfolioWeightRequestBase

      public PortfolioWeightRequestBase()
  • Method Details

    • percent

      public PortfolioWeightRequestBase percent(@Nonnull BigDecimal percent)
    • getPercent

      @Nonnull public BigDecimal getPercent()
      Percentage allocated to this weight. Values must be greater than zero, and all supplied weights must total exactly 100.
      Returns:
      percent
    • setPercent

      public void setPercent(@Nonnull BigDecimal percent)
    • symbol

      public PortfolioWeightRequestBase symbol(@Nullable String symbol)
    • getSymbol

      @Nullable public String getSymbol()
      Asset symbol. Required and non-null when `type` is `asset`.
      Returns:
      symbol
    • setSymbol

      public void setSymbol(@Nullable String symbol)
    • type

    • getType

      @Nonnull public PortfolioWeightRequestBase.TypeEnum getType()
      Type of weight entry in a portfolio.
      Returns:
      type
    • setType

      public void setType(@Nonnull PortfolioWeightRequestBase.TypeEnum type)
    • putAdditionalProperty

      public PortfolioWeightRequestBase putAdditionalProperty(String key, Object value)
      Set the additional (undeclared) property with the specified name and value. If the property does not already exist, create it otherwise replace it.
      Parameters:
      key - name of the property
      value - value of the property
      Returns:
      the PortfolioWeightRequestBase instance itself
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
      Return the additional (undeclared) property.
      Returns:
      a map of objects
    • getAdditionalProperty

      public Object getAdditionalProperty(String key)
      Return the additional (undeclared) property with the specified name.
      Parameters:
      key - name of the property
      Returns:
      an object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to PortfolioWeightRequestBase
    • fromJson

      public static PortfolioWeightRequestBase fromJson(String jsonString) throws IOException
      Create an instance of PortfolioWeightRequestBase given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of PortfolioWeightRequestBase
      Throws:
      IOException - if the JSON string is invalid with respect to PortfolioWeightRequestBase
    • toJson

      public String toJson()
      Convert an instance of PortfolioWeightRequestBase to an JSON string
      Returns:
      JSON string