Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Upstox Developer API
* Build your App on the Upstox platform ![Banner](https://api-v2.upstox.com/api-docs/images/banner.jpg \"banner\") # Introduction Upstox API is a set of rest APIs that provide data required to build a complete investment and trading platform. Execute orders in real time, manage user portfolio, stream live market data (using Websocket), and more, with the easy to understand API collection. All requests are over HTTPS and the requests are sent with the content-type ‘application/json’. Developers have the option of choosing the response type as JSON or CSV for a few API calls. To be able to use these APIs you need to create an App in the Developer Console and generate your **apiKey** and **apiSecret**. You can use a redirect URL which will be called after the login flow. If you are a **trader**, you can directly create apps from Upstox mobile app or the desktop platform itself from **Apps** sections inside the **Account** Tab. Head over to account.upstox.com/developer/apps. If you are a **business** looking to integrate Upstox APIs, reach out to us and we will get a custom app created for you in no time. It is highly recommended that you do not embed the **apiSecret** in your frontend app. Create a remote backend which does the handshake on behalf of the frontend app. Marking the apiSecret in the frontend app will make your app vulnerable to threats and potential issues.
*
* OpenAPI spec version: v2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.upstox.api;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
/**
* Response data for order details
*/
@Schema(description = "Response data for order details")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2023-07-12T20:29:09.823661+05:30[Asia/Kolkata]")
public class OrderData {
/**
* Exchange to which the order is associated
*/
@JsonAdapter(ExchangeEnum.Adapter.class)
public enum ExchangeEnum {
@SerializedName("NSE")
NSE("NSE"),
@SerializedName("NFO")
NFO("NFO"),
@SerializedName("CDS")
CDS("CDS"),
@SerializedName("BSE")
BSE("BSE"),
@SerializedName("BCD")
BCD("BCD"),
@SerializedName("BFO")
BFO("BFO"),
@SerializedName("MCX")
MCX("MCX");
private String value;
ExchangeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ExchangeEnum fromValue(String input) {
for (ExchangeEnum b : ExchangeEnum.values()) {
if (b.value.equals(input)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final ExchangeEnum enumeration) throws IOException {
jsonWriter.value(String.valueOf(enumeration.getValue()));
}
@Override
public ExchangeEnum read(final JsonReader jsonReader) throws IOException {
Object value = jsonReader.nextString();
return ExchangeEnum.fromValue((String)(value));
}
}
} @SerializedName("exchange")
private ExchangeEnum exchange = null;
@SerializedName("price")
private Float price = null;
/**
* Shows if the order was either Intraday, Delivery, CoverOrder or OneCancelsOther
*/
@JsonAdapter(ProductEnum.Adapter.class)
public enum ProductEnum {
@SerializedName("I")
I("I"),
@SerializedName("D")
D("D"),
@SerializedName("CO")
CO("CO"),
@SerializedName("OCO")
OCO("OCO"),
@SerializedName("MTF")
MTF("MTF");
private String value;
ProductEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ProductEnum fromValue(String input) {
for (ProductEnum b : ProductEnum.values()) {
if (b.value.equals(input)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final ProductEnum enumeration) throws IOException {
jsonWriter.value(String.valueOf(enumeration.getValue()));
}
@Override
public ProductEnum read(final JsonReader jsonReader) throws IOException {
Object value = jsonReader.nextString();
return ProductEnum.fromValue((String)(value));
}
}
} @SerializedName("product")
private ProductEnum product = null;
@SerializedName("quantity")
private Integer quantity = null;
@SerializedName("status")
private String status = null;
@SerializedName("tag")
private String tag = null;
/**
* Order validity (DAY- Day and IOC- Immediate or Cancel (IOC) order)
*/
@JsonAdapter(ValidityEnum.Adapter.class)
public enum ValidityEnum {
@SerializedName("DAY")
DAY("DAY"),
@SerializedName("IOC")
IOC("IOC");
private String value;
ValidityEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ValidityEnum fromValue(String input) {
for (ValidityEnum b : ValidityEnum.values()) {
if (b.value.equals(input)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final ValidityEnum enumeration) throws IOException {
jsonWriter.value(String.valueOf(enumeration.getValue()));
}
@Override
public ValidityEnum read(final JsonReader jsonReader) throws IOException {
Object value = jsonReader.nextString();
return ValidityEnum.fromValue((String)(value));
}
}
} @SerializedName("validity")
private ValidityEnum validity = null;
@SerializedName("average_price")
private Float averagePrice = null;
@SerializedName("disclosed_quantity")
private Integer disclosedQuantity = null;
@SerializedName("exchange_order_id")
private String exchangeOrderId = null;
@SerializedName("exchange_timestamp")
private String exchangeTimestamp = null;
@SerializedName("instrument_token")
private String instrumentToken = null;
@SerializedName("is_amo")
private Boolean isAmo = null;
@SerializedName("status_message")
private String statusMessage = null;
@SerializedName("order_id")
private String orderId = null;
@SerializedName("order_request_id")
private String orderRequestId = null;
/**
* Type of order. It can be one of the following MARKET refers to market order<br>LIMIT refers to Limit Order<br>SL refers to Stop Loss Limit<br>SL-M refers to Stop loss market
*/
@JsonAdapter(OrderTypeEnum.Adapter.class)
public enum OrderTypeEnum {
@SerializedName("MARKET")
MARKET("MARKET"),
@SerializedName("LIMIT")
LIMIT("LIMIT"),
@SerializedName("SL")
SL("SL"),
@SerializedName("SL-M")
SL_M("SL-M");
private String value;
OrderTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static OrderTypeEnum fromValue(String input) {
for (OrderTypeEnum b : OrderTypeEnum.values()) {
if (b.value.equals(input)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final OrderTypeEnum enumeration) throws IOException {
jsonWriter.value(String.valueOf(enumeration.getValue()));
}
@Override
public OrderTypeEnum read(final JsonReader jsonReader) throws IOException {
Object value = jsonReader.nextString();
return OrderTypeEnum.fromValue((String)(value));
}
}
} @SerializedName("order_type")
private OrderTypeEnum orderType = null;
@SerializedName("parent_order_id")
private String parentOrderId = null;
@SerializedName("tradingsymbol")
private String tradingsymbol = null;
@SerializedName("trading_symbol")
private String tradingSymbol = null;
@SerializedName("order_timestamp")
private String orderTimestamp = null;
@SerializedName("filled_quantity")
private Integer filledQuantity = null;
/**
* Indicates whether the order was a buy or sell order
*/
@JsonAdapter(TransactionTypeEnum.Adapter.class)
public enum TransactionTypeEnum {
@SerializedName("BUY")
BUY("BUY"),
@SerializedName("SELL")
SELL("SELL");
private String value;
TransactionTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TransactionTypeEnum fromValue(String input) {
for (TransactionTypeEnum b : TransactionTypeEnum.values()) {
if (b.value.equals(input)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final TransactionTypeEnum enumeration) throws IOException {
jsonWriter.value(String.valueOf(enumeration.getValue()));
}
@Override
public TransactionTypeEnum read(final JsonReader jsonReader) throws IOException {
Object value = jsonReader.nextString();
return TransactionTypeEnum.fromValue((String)(value));
}
}
} @SerializedName("transaction_type")
private TransactionTypeEnum transactionType = null;
@SerializedName("trigger_price")
private Float triggerPrice = null;
@SerializedName("placed_by")
private String placedBy = null;
@SerializedName("variety")
private String variety = null;
/**
* Exchange to which the order is associated
* @return exchange
**/
@Schema(example = "NSE", description = "Exchange to which the order is associated")
public ExchangeEnum getExchange() {
return exchange;
}
/**
* Price at which the order was placed
* @return price
**/
@Schema(example = "120.01", description = "Price at which the order was placed")
public Float getPrice() {
return price;
}
/**
* Shows if the order was either Intraday, Delivery, CoverOrder or OneCancelsOther
* @return product
**/
@Schema(example = "D", description = "Shows if the order was either Intraday, Delivery, CoverOrder or OneCancelsOther")
public ProductEnum getProduct() {
return product;
}
/**
* Quantity with which the order was placed
* @return quantity
**/
@Schema(example = "1", description = "Quantity with which the order was placed")
public Integer getQuantity() {
return quantity;
}
/**
* Indicates the current status of the order. Valid order status’ are outlined in the table below
* @return status
**/
@Schema(example = "complete", description = "Indicates the current status of the order. Valid order status’ are outlined in the table below")
public String getStatus() {
return status;
}
/**
* Tag to uniquely identify an order
* @return tag
**/
@Schema(description = "Tag to uniquely identify an order")
public String getTag() {
return tag;
}
/**
* Order validity (DAY- Day and IOC- Immediate or Cancel (IOC) order)
* @return validity
**/
@Schema(example = "DAY", description = "Order validity (DAY- Day and IOC- Immediate or Cancel (IOC) order)")
public ValidityEnum getValidity() {
return validity;
}
/**
* Average price at which the qty got traded
* @return averagePrice
**/
@Schema(example = "120.01", description = "Average price at which the qty got traded")
public Float getAveragePrice() {
return averagePrice;
}
/**
* The quantity that should be disclosed in the market depth
* @return disclosedQuantity
**/
@Schema(example = "1", description = "The quantity that should be disclosed in the market depth")
public Integer getDisclosedQuantity() {
return disclosedQuantity;
}
/**
* Unique order ID assigned by the exchange for the order placed
* @return exchangeOrderId
**/
@Schema(example = "221013001021540", description = "Unique order ID assigned by the exchange for the order placed")
public String getExchangeOrderId() {
return exchangeOrderId;
}
/**
* User readable time at which the order was placed or updated
* @return exchangeTimestamp
**/
@Schema(example = "03-Aug-2017 15:03:42", description = "User readable time at which the order was placed or updated")
public String getExchangeTimestamp() {
return exchangeTimestamp;
}
/**
* Identifier issued by Upstox used for subscribing to live market quotes
* @return instrumentToken
**/
@Schema(example = "151064324", description = "Identifier issued by Upstox used for subscribing to live market quotes")
public String getInstrumentToken() {
return instrumentToken;
}
/**
* Signifies if the order is an After Market Order
* @return isAmo
**/
@Schema(example = "false", description = "Signifies if the order is an After Market Order")
public Boolean isIsAmo() {
return isAmo;
}
/**
* Indicates the reason when any order is rejected, not modified or cancelled
* @return statusMessage
**/
@Schema(description = "Indicates the reason when any order is rejected, not modified or cancelled")
public String getStatusMessage() {
return statusMessage;
}
/**
* Unique order ID assigned internally for the order placed
* @return orderId
**/
@Schema(example = "221013001021541", description = "Unique order ID assigned internally for the order placed")
public String getOrderId() {
return orderId;
}
/**
* Apart from 1st order it shows the count of how many requests were sent
* @return orderRequestId
**/
@Schema(example = "221013001021542", description = "Apart from 1st order it shows the count of how many requests were sent")
public String getOrderRequestId() {
return orderRequestId;
}
/**
* Type of order. It can be one of the following MARKET refers to market order<br>LIMIT refers to Limit Order<br>SL refers to Stop Loss Limit<br>SL-M refers to Stop loss market
* @return orderType
**/
@Schema(example = "MARKET", description = "Type of order. It can be one of the following MARKET refers to market order LIMIT refers to Limit Order SL refers to Stop Loss Limit SL-M refers to Stop loss market")
public OrderTypeEnum getOrderType() {
return orderType;
}
/**
* In case the order is part of the second or third leg of a CO or OCO, the parent order ID is indicated here
* @return parentOrderId
**/
@Schema(example = "221013001021543", description = "In case the order is part of the second or third leg of a CO or OCO, the parent order ID is indicated here")
public String getParentOrderId() {
return parentOrderId;
}
/**
* Shows the trading symbol of the instrument
* @return tradingsymbol
**/
@Schema(example = "GMR", description = "Shows the trading symbol of the instrument")
public String getTradingsymbol() {
return tradingsymbol;
}
/**
* Shows the trading symbol of the instrument
* @return tradingSymbol
**/
@Schema(example = "GMR", description = "Shows the trading symbol of the instrument")
public String getTradingSymbol() {
return tradingSymbol;
}
/**
* User readable timestamp at which the order was placed
* @return orderTimestamp
**/
@Schema(example = "23-Apr-2021 14:22:06", description = "User readable timestamp at which the order was placed")
public String getOrderTimestamp() {
return orderTimestamp;
}
/**
* The total quantity traded from this particular order
* @return filledQuantity
**/
@Schema(example = "1", description = "The total quantity traded from this particular order")
public Integer getFilledQuantity() {
return filledQuantity;
}
/**
* Indicates whether the order was a buy or sell order
* @return transactionType
**/
@Schema(example = "BUY", description = "Indicates whether the order was a buy or sell order")
public TransactionTypeEnum getTransactionType() {
return transactionType;
}
/**
* If the order was a stop loss order then the trigger price set is mentioned here
* @return triggerPrice
**/
@Schema(example = "120.01", description = "If the order was a stop loss order then the trigger price set is mentioned here")
public Float getTriggerPrice() {
return triggerPrice;
}
/**
* Uniquely identifies the user
* @return placedBy
**/
@Schema(example = "200123", description = "Uniquely identifies the user")
public String getPlacedBy() {
return placedBy;
}
/**
* Order complexity
* @return variety
**/
@Schema(example = "SIMPLE", description = "Order complexity")
public String getVariety() {
return variety;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OrderData orderData = (OrderData) o;
return Objects.equals(this.exchange, orderData.exchange) &&
Objects.equals(this.price, orderData.price) &&
Objects.equals(this.product, orderData.product) &&
Objects.equals(this.quantity, orderData.quantity) &&
Objects.equals(this.status, orderData.status) &&
Objects.equals(this.tag, orderData.tag) &&
Objects.equals(this.validity, orderData.validity) &&
Objects.equals(this.averagePrice, orderData.averagePrice) &&
Objects.equals(this.disclosedQuantity, orderData.disclosedQuantity) &&
Objects.equals(this.exchangeOrderId, orderData.exchangeOrderId) &&
Objects.equals(this.exchangeTimestamp, orderData.exchangeTimestamp) &&
Objects.equals(this.instrumentToken, orderData.instrumentToken) &&
Objects.equals(this.isAmo, orderData.isAmo) &&
Objects.equals(this.statusMessage, orderData.statusMessage) &&
Objects.equals(this.orderId, orderData.orderId) &&
Objects.equals(this.orderRequestId, orderData.orderRequestId) &&
Objects.equals(this.orderType, orderData.orderType) &&
Objects.equals(this.parentOrderId, orderData.parentOrderId) &&
Objects.equals(this.tradingsymbol, orderData.tradingsymbol) &&
Objects.equals(this.tradingSymbol, orderData.tradingSymbol) &&
Objects.equals(this.orderTimestamp, orderData.orderTimestamp) &&
Objects.equals(this.filledQuantity, orderData.filledQuantity) &&
Objects.equals(this.transactionType, orderData.transactionType) &&
Objects.equals(this.triggerPrice, orderData.triggerPrice) &&
Objects.equals(this.placedBy, orderData.placedBy) &&
Objects.equals(this.variety, orderData.variety);
}
@Override
public int hashCode() {
return Objects.hash(exchange, price, product, quantity, status, tag, validity, averagePrice, disclosedQuantity, exchangeOrderId, exchangeTimestamp, instrumentToken, isAmo, statusMessage, orderId, orderRequestId, orderType, parentOrderId, tradingsymbol, tradingSymbol, orderTimestamp, filledQuantity, transactionType, triggerPrice, placedBy, variety);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OrderData {\n");
sb.append(" exchange: ").append(toIndentedString(exchange)).append("\n");
sb.append(" price: ").append(toIndentedString(price)).append("\n");
sb.append(" product: ").append(toIndentedString(product)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" tag: ").append(toIndentedString(tag)).append("\n");
sb.append(" validity: ").append(toIndentedString(validity)).append("\n");
sb.append(" averagePrice: ").append(toIndentedString(averagePrice)).append("\n");
sb.append(" disclosedQuantity: ").append(toIndentedString(disclosedQuantity)).append("\n");
sb.append(" exchangeOrderId: ").append(toIndentedString(exchangeOrderId)).append("\n");
sb.append(" exchangeTimestamp: ").append(toIndentedString(exchangeTimestamp)).append("\n");
sb.append(" instrumentToken: ").append(toIndentedString(instrumentToken)).append("\n");
sb.append(" isAmo: ").append(toIndentedString(isAmo)).append("\n");
sb.append(" statusMessage: ").append(toIndentedString(statusMessage)).append("\n");
sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n");
sb.append(" orderRequestId: ").append(toIndentedString(orderRequestId)).append("\n");
sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n");
sb.append(" parentOrderId: ").append(toIndentedString(parentOrderId)).append("\n");
sb.append(" tradingsymbol: ").append(toIndentedString(tradingsymbol)).append("\n");
sb.append(" tradingSymbol: ").append(toIndentedString(tradingSymbol)).append("\n");
sb.append(" orderTimestamp: ").append(toIndentedString(orderTimestamp)).append("\n");
sb.append(" filledQuantity: ").append(toIndentedString(filledQuantity)).append("\n");
sb.append(" transactionType: ").append(toIndentedString(transactionType)).append("\n");
sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n");
sb.append(" placedBy: ").append(toIndentedString(placedBy)).append("\n");
sb.append(" variety: ").append(toIndentedString(variety)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}