All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.upstox.api.ConvertPositionRequest Maven / Gradle / Ivy

/*
 * 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; /** * ConvertPositionRequest */ @javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2023-07-12T20:29:09.823661+05:30[Asia/Kolkata]") public class ConvertPositionRequest { @SerializedName("instrument_token") private String instrumentToken = null; /** * Indicates the new product to use for the convert positions */ @JsonAdapter(NewProductEnum.Adapter.class) public enum NewProductEnum { @SerializedName("I") I("I"), @SerializedName("D") D("D"), @SerializedName("CO") CO("CO"), @SerializedName("OCO") OCO("OCO"), @SerializedName("MTF") MTF("MTF"); private String value; NewProductEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static NewProductEnum fromValue(String input) { for (NewProductEnum b : NewProductEnum.values()) { if (b.value.equals(input)) { return b; } } return null; } public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final NewProductEnum enumeration) throws IOException { jsonWriter.value(String.valueOf(enumeration.getValue())); } @Override public NewProductEnum read(final JsonReader jsonReader) throws IOException { Object value = jsonReader.nextString(); return NewProductEnum.fromValue((String)(value)); } } } @SerializedName("new_product") private NewProductEnum newProduct = null; /** * Indicates the old product to use for the convert positions */ @JsonAdapter(OldProductEnum.Adapter.class) public enum OldProductEnum { @SerializedName("I") I("I"), @SerializedName("D") D("D"), @SerializedName("CO") CO("CO"), @SerializedName("OCO") OCO("OCO"), @SerializedName("MTF") MTF("MTF"); private String value; OldProductEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static OldProductEnum fromValue(String input) { for (OldProductEnum b : OldProductEnum.values()) { if (b.value.equals(input)) { return b; } } return null; } public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final OldProductEnum enumeration) throws IOException { jsonWriter.value(String.valueOf(enumeration.getValue())); } @Override public OldProductEnum read(final JsonReader jsonReader) throws IOException { Object value = jsonReader.nextString(); return OldProductEnum.fromValue((String)(value)); } } } @SerializedName("old_product") private OldProductEnum oldProduct = null; /** * Indicates whether its a buy(b) or sell(s) 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("quantity") private Integer quantity = null; public ConvertPositionRequest instrumentToken(String instrumentToken) { this.instrumentToken = instrumentToken; return this; } /** * Key of the instrument * @return instrumentToken **/ @Schema(example = "151064324", required = true, description = "Key of the instrument") public String getInstrumentToken() { return instrumentToken; } public void setInstrumentToken(String instrumentToken) { this.instrumentToken = instrumentToken; } public ConvertPositionRequest newProduct(NewProductEnum newProduct) { this.newProduct = newProduct; return this; } /** * Indicates the new product to use for the convert positions * @return newProduct **/ @Schema(example = "D", required = true, description = "Indicates the new product to use for the convert positions") public NewProductEnum getNewProduct() { return newProduct; } public void setNewProduct(NewProductEnum newProduct) { this.newProduct = newProduct; } public ConvertPositionRequest oldProduct(OldProductEnum oldProduct) { this.oldProduct = oldProduct; return this; } /** * Indicates the old product to use for the convert positions * @return oldProduct **/ @Schema(example = "I", required = true, description = "Indicates the old product to use for the convert positions") public OldProductEnum getOldProduct() { return oldProduct; } public void setOldProduct(OldProductEnum oldProduct) { this.oldProduct = oldProduct; } public ConvertPositionRequest transactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; return this; } /** * Indicates whether its a buy(b) or sell(s) order * @return transactionType **/ @Schema(example = "BUY", required = true, description = "Indicates whether its a buy(b) or sell(s) order") public TransactionTypeEnum getTransactionType() { return transactionType; } public void setTransactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; } public ConvertPositionRequest quantity(Integer quantity) { this.quantity = quantity; return this; } /** * Quantity with which the position to convert * @return quantity **/ @Schema(example = "1", required = true, description = "Quantity with which the position to convert") public Integer getQuantity() { return quantity; } public void setQuantity(Integer quantity) { this.quantity = quantity; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ConvertPositionRequest convertPositionRequest = (ConvertPositionRequest) o; return Objects.equals(this.instrumentToken, convertPositionRequest.instrumentToken) && Objects.equals(this.newProduct, convertPositionRequest.newProduct) && Objects.equals(this.oldProduct, convertPositionRequest.oldProduct) && Objects.equals(this.transactionType, convertPositionRequest.transactionType) && Objects.equals(this.quantity, convertPositionRequest.quantity); } @Override public int hashCode() { return Objects.hash(instrumentToken, newProduct, oldProduct, transactionType, quantity); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ConvertPositionRequest {\n"); sb.append(" instrumentToken: ").append(toIndentedString(instrumentToken)).append("\n"); sb.append(" newProduct: ").append(toIndentedString(newProduct)).append("\n"); sb.append(" oldProduct: ").append(toIndentedString(oldProduct)).append("\n"); sb.append(" transactionType: ").append(toIndentedString(transactionType)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).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 "); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy