com.konfigthis.client.model.TimeInForceStrict Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snaptrade-java-sdk Show documentation
Show all versions of snaptrade-java-sdk Show documentation
Connect brokerage accounts to your app for live positions and trading
This library was generated by https://konfigthis.com
/*
* SnapTrade
* Connect brokerage accounts to your app for live positions and trading
*
* The version of the OpenAPI document: 1.0.0
* Contact: [email protected]
*
* 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 io.swagger.annotations.ApiModel;
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;
/**
* The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
*/
@JsonAdapter(TimeInForceStrict.Adapter.class)public enum TimeInForceStrict {
FOK("FOK"),
DAY("Day"),
GTC("GTC");
private String value;
TimeInForceStrict(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TimeInForceStrict fromValue(String value) {
for (TimeInForceStrict b : TimeInForceStrict.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final TimeInForceStrict enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TimeInForceStrict read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TimeInForceStrict.fromValue(value);
}
}
}