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;
/**
* ModifyOrderRequest
*/
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2023-07-12T20:29:09.823661+05:30[Asia/Kolkata]")
public class ModifyOrderRequest {
@SerializedName("quantity")
private Integer quantity = 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("price")
private Float price = null;
@SerializedName("order_id")
private String orderId = null;
/**
* Type of order. It can be one of the following MARKET refers to market order LIMILT refers to Limit Order SL refers to Stop Loss Limit 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("disclosed_quantity")
private Integer disclosedQuantity = null;
@SerializedName("trigger_price")
private Float triggerPrice = null;
public ModifyOrderRequest quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
/**
* 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;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public ModifyOrderRequest validity(ValidityEnum validity) {
this.validity = validity;
return this;
}
/**
* Order validity (DAY- Day and IOC- Immediate or Cancel (IOC) order)
* @return validity
**/
@Schema(example = "DAY", required = true, description = "Order validity (DAY- Day and IOC- Immediate or Cancel (IOC) order)")
public ValidityEnum getValidity() {
return validity;
}
public void setValidity(ValidityEnum validity) {
this.validity = validity;
}
public ModifyOrderRequest price(Float price) {
this.price = price;
return this;
}
/**
* Price at which the order was placed
* @return price
**/
@Schema(example = "120.01", required = true, description = "Price at which the order was placed")
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public ModifyOrderRequest orderId(String orderId) {
this.orderId = orderId;
return this;
}
/**
* The order ID for which the order must be modified
* @return orderId
**/
@Schema(example = "1644490272000", required = true, description = "The order ID for which the order must be modified")
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public ModifyOrderRequest orderType(OrderTypeEnum orderType) {
this.orderType = orderType;
return this;
}
/**
* Type of order. It can be one of the following MARKET refers to market order LIMILT refers to Limit Order SL refers to Stop Loss Limit SL-M refers to Stop Loss Market
* @return orderType
**/
@Schema(example = "MARKET", required = true, description = "Type of order. It can be one of the following MARKET refers to market order LIMILT refers to Limit Order SL refers to Stop Loss Limit SL-M refers to Stop Loss Market")
public OrderTypeEnum getOrderType() {
return orderType;
}
public void setOrderType(OrderTypeEnum orderType) {
this.orderType = orderType;
}
public ModifyOrderRequest disclosedQuantity(Integer disclosedQuantity) {
this.disclosedQuantity = disclosedQuantity;
return this;
}
/**
* The quantity that should be disclosed in the market depth
* @return disclosedQuantity
**/
@Schema(example = "0", description = "The quantity that should be disclosed in the market depth")
public Integer getDisclosedQuantity() {
return disclosedQuantity;
}
public void setDisclosedQuantity(Integer disclosedQuantity) {
this.disclosedQuantity = disclosedQuantity;
}
public ModifyOrderRequest triggerPrice(Float triggerPrice) {
this.triggerPrice = triggerPrice;
return this;
}
/**
* If the order is a stop loss order then the trigger price to be set is mentioned here
* @return triggerPrice
**/
@Schema(example = "0", required = true, description = "If the order is a stop loss order then the trigger price to be set is mentioned here")
public Float getTriggerPrice() {
return triggerPrice;
}
public void setTriggerPrice(Float triggerPrice) {
this.triggerPrice = triggerPrice;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModifyOrderRequest modifyOrderRequest = (ModifyOrderRequest) o;
return Objects.equals(this.quantity, modifyOrderRequest.quantity) &&
Objects.equals(this.validity, modifyOrderRequest.validity) &&
Objects.equals(this.price, modifyOrderRequest.price) &&
Objects.equals(this.orderId, modifyOrderRequest.orderId) &&
Objects.equals(this.orderType, modifyOrderRequest.orderType) &&
Objects.equals(this.disclosedQuantity, modifyOrderRequest.disclosedQuantity) &&
Objects.equals(this.triggerPrice, modifyOrderRequest.triggerPrice);
}
@Override
public int hashCode() {
return Objects.hash(quantity, validity, price, orderId, orderType, disclosedQuantity, triggerPrice);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModifyOrderRequest {\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" validity: ").append(toIndentedString(validity)).append("\n");
sb.append(" price: ").append(toIndentedString(price)).append("\n");
sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n");
sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n");
sb.append(" disclosedQuantity: ").append(toIndentedString(disclosedQuantity)).append("\n");
sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).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 ");
}
}