sdks/java/src/main/java/com/konfigthis/client/model/AccountOrderRecordStatus.java
/*
 * SnapTrade
 * Connect brokerage accounts to your app for live positions and trading
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: efpyi@example.com
 *
 * NOTE: This class is auto generated by Konfig (https://konfigthis.com).
 * Do not edit the class manually.
 */


package com.konfigthis.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.annotations.SerializedName;

import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;

/**
 * Gets or Sets AccountOrderRecordStatus
 */
@JsonAdapter(AccountOrderRecordStatus.Adapter.class)
public enum AccountOrderRecordStatus {
  
  NONE("NONE"),
  
  PENDING("PENDING"),
  
  ACCEPTED("ACCEPTED"),
  
  FAILED("FAILED"),
  
  REJECTED("REJECTED"),
  
  CANCELED("CANCELED"),
  
  PARTIAL_CANCELED("PARTIAL_CANCELED"),
  
  CANCEL_PENDING("CANCEL_PENDING"),
  
  EXECUTED("EXECUTED"),
  
  PARTIAL("PARTIAL"),
  
  REPLACE_PENDING("REPLACE_PENDING"),
  
  REPLACED("REPLACED"),
  
  STOPPED("STOPPED"),
  
  SUSPENDED("SUSPENDED"),
  
  EXPIRED("EXPIRED"),
  
  QUEUED("QUEUED"),
  
  TRIGGERED("TRIGGERED"),
  
  ACTIVATED("ACTIVATED"),
  
  PENDING_RISK_REVIEW("PENDING_RISK_REVIEW"),
  
  CONTINGENT_ORDER("CONTINGENT_ORDER");

  private String value;

  AccountOrderRecordStatus(String value) {
    this.value = value;
  }

  public String getValue() {
    return value;
  }

  @Override
  public String toString() {
    return String.valueOf(value);
  }

  public static AccountOrderRecordStatus fromValue(String value) {
    for (AccountOrderRecordStatus b : AccountOrderRecordStatus.values()) {
      if (b.value.equals(value)) {
        return b;
      }
    }
    throw new IllegalArgumentException("Unexpected value '" + value + "'");
  }

  public static class Adapter extends TypeAdapter<AccountOrderRecordStatus> {
    @Override
    public void write(final JsonWriter jsonWriter, final AccountOrderRecordStatus enumeration) throws IOException {
      jsonWriter.value(enumeration.getValue());
    }

    @Override
    public AccountOrderRecordStatus read(final JsonReader jsonReader) throws IOException {
      String value = jsonReader.nextString();
      return AccountOrderRecordStatus.fromValue(value);
    }
  }
}

