Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.upstox.api</groupId>
<artifactId>upstox-java-sdk</artifactId>
<version>1.19</version>
<version>1.20</version>
<scope>compile</scope>
</dependency>
```
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>upstox-java-sdk</artifactId>
<packaging>jar</packaging>
<name>upstox-java-sdk</name>
<version>1.19</version>
<version>1.20</version>
<url>https://upstox.com/uplink/</url>
<description>The official Java client for communicating with the Upstox API</description>
<prerequisites>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/upstox/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ public Call buildCall(String path, String method, List<Pair> queryParams, List<P
public Request buildRequest(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
updateParamsForAuth(authNames, queryParams, headerParams);
headerParams.put("X-Upstox-SDK-Language","java");
headerParams.put("X-Upstox-SDK-Version","1.19");
headerParams.put("X-Upstox-SDK-Version","1.20");
final String url = buildUrl(path, queryParams, collectionQueryParams);
final Request.Builder reqBuilder = new Request.Builder().url(url);
processHeaderParams(headerParams, reqBuilder);
Expand Down
27 changes: 25 additions & 2 deletions src/main/java/com/upstox/api/GttRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ public TriggerTypeEnum read(final JsonReader jsonReader) throws IOException {
@SerializedName("trailing_gap")
private Double trailingGap = null;

@SerializedName("market_protection")
private Double marketProtection = null;

public GttRule strategy(StrategyEnum strategy) {
this.strategy = strategy;
return this;
Expand Down Expand Up @@ -202,6 +205,24 @@ public void setTrailingGap(Double trailingGap) {
this.trailingGap = trailingGap;
}

public GttRule marketProtection(Double marketProtection) {
this.marketProtection = marketProtection;
return this;
}

/**
* Market price protection (optional).
* @return marketProtection
**/
@Schema(description = "Market price protection (optional).")
public Double getMarketProtection() {
return marketProtection;
}

public void setMarketProtection(Double marketProtection) {
this.marketProtection = marketProtection;
}


@Override
public boolean equals(java.lang.Object o) {
Expand All @@ -215,12 +236,13 @@ public boolean equals(java.lang.Object o) {
return Objects.equals(this.strategy, gttRule.strategy) &&
Objects.equals(this.triggerType, gttRule.triggerType) &&
Objects.equals(this.triggerPrice, gttRule.triggerPrice) &&
Objects.equals(this.trailingGap, gttRule.trailingGap);
Objects.equals(this.trailingGap, gttRule.trailingGap) &&
Objects.equals(this.marketProtection, gttRule.marketProtection);
}

@Override
public int hashCode() {
return Objects.hash(strategy, triggerType, triggerPrice, trailingGap);
return Objects.hash(strategy, triggerType, triggerPrice, trailingGap, marketProtection);
}


Expand All @@ -233,6 +255,7 @@ public String toString() {
sb.append(" triggerType: ").append(toIndentedString(triggerType)).append("\n");
sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n");
sb.append(" trailingGap: ").append(toIndentedString(trailingGap)).append("\n");
sb.append(" marketProtection: ").append(toIndentedString(marketProtection)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
27 changes: 25 additions & 2 deletions src/main/java/com/upstox/api/ModifyOrderRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ public OrderTypeEnum read(final JsonReader jsonReader) throws IOException {
@SerializedName("trigger_price")
private Float triggerPrice = null;

@SerializedName("market_protection")
private Float marketProtection = null;

public ModifyOrderRequest quantity(Integer quantity) {
this.quantity = quantity;
return this;
Expand Down Expand Up @@ -265,6 +268,24 @@ public void setTriggerPrice(Float triggerPrice) {
this.triggerPrice = triggerPrice;
}

public ModifyOrderRequest marketProtection(Float marketProtection) {
this.marketProtection = marketProtection;
return this;
}

/**
* Market price protection (optional).
* @return marketProtection
**/
@Schema(description = "Market price protection (optional).")
public Float getMarketProtection() {
return marketProtection;
}

public void setMarketProtection(Float marketProtection) {
this.marketProtection = marketProtection;
}


@Override
public boolean equals(java.lang.Object o) {
Expand All @@ -281,12 +302,13 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.orderId, modifyOrderRequest.orderId) &&
Objects.equals(this.orderType, modifyOrderRequest.orderType) &&
Objects.equals(this.disclosedQuantity, modifyOrderRequest.disclosedQuantity) &&
Objects.equals(this.triggerPrice, modifyOrderRequest.triggerPrice);
Objects.equals(this.triggerPrice, modifyOrderRequest.triggerPrice) &&
Objects.equals(this.marketProtection, modifyOrderRequest.marketProtection);
}

@Override
public int hashCode() {
return Objects.hash(quantity, validity, price, orderId, orderType, disclosedQuantity, triggerPrice);
return Objects.hash(quantity, validity, price, orderId, orderType, disclosedQuantity, triggerPrice, marketProtection);
}


Expand All @@ -302,6 +324,7 @@ public String toString() {
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(" marketProtection: ").append(toIndentedString(marketProtection)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
27 changes: 25 additions & 2 deletions src/main/java/com/upstox/api/MultiOrderRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ public TransactionTypeEnum read(final JsonReader jsonReader) throws IOException
@SerializedName("correlation_id")
private String correlationId = null;

@SerializedName("market_protection")
private Float marketProtection = null;

public MultiOrderRequest quantity(Integer quantity) {
this.quantity = quantity;
return this;
Expand Down Expand Up @@ -479,6 +482,24 @@ public void setCorrelationId(String correlationId) {
this.correlationId = correlationId;
}

public MultiOrderRequest marketProtection(Float marketProtection) {
this.marketProtection = marketProtection;
return this;
}

/**
* Market price protection (optional).
* @return marketProtection
**/
@Schema(description = "Market price protection (optional).")
public Float getMarketProtection() {
return marketProtection;
}

public void setMarketProtection(Float marketProtection) {
this.marketProtection = marketProtection;
}


@Override
public boolean equals(java.lang.Object o) {
Expand All @@ -501,12 +522,13 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.disclosedQuantity, multiOrderRequest.disclosedQuantity) &&
Objects.equals(this.triggerPrice, multiOrderRequest.triggerPrice) &&
Objects.equals(this.isAmo, multiOrderRequest.isAmo) &&
Objects.equals(this.correlationId, multiOrderRequest.correlationId);
Objects.equals(this.correlationId, multiOrderRequest.correlationId) &&
Objects.equals(this.marketProtection, multiOrderRequest.marketProtection);
}

@Override
public int hashCode() {
return Objects.hash(quantity, product, validity, price, tag, slice, instrumentToken, orderType, transactionType, disclosedQuantity, triggerPrice, isAmo, correlationId);
return Objects.hash(quantity, product, validity, price, tag, slice, instrumentToken, orderType, transactionType, disclosedQuantity, triggerPrice, isAmo, correlationId, marketProtection);
}


Expand All @@ -528,6 +550,7 @@ public String toString() {
sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n");
sb.append(" isAmo: ").append(toIndentedString(isAmo)).append("\n");
sb.append(" correlationId: ").append(toIndentedString(correlationId)).append("\n");
sb.append(" marketProtection: ").append(toIndentedString(marketProtection)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
27 changes: 25 additions & 2 deletions src/main/java/com/upstox/api/PlaceOrderV3Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ public TransactionTypeEnum read(final JsonReader jsonReader) throws IOException
@SerializedName("is_amo")
private Boolean isAmo = null;

@SerializedName("market_protection")
private Float marketProtection = null;

public PlaceOrderV3Request quantity(Integer quantity) {
this.quantity = quantity;
return this;
Expand Down Expand Up @@ -458,6 +461,24 @@ public void setIsAmo(Boolean isAmo) {
this.isAmo = isAmo;
}

public PlaceOrderV3Request marketProtection(Float marketProtection) {
this.marketProtection = marketProtection;
return this;
}

/**
* Market price protection (optional).
* @return marketProtection
**/
@Schema(description = "Market price protection (optional).")
public Float getMarketProtection() {
return marketProtection;
}

public void setMarketProtection(Float marketProtection) {
this.marketProtection = marketProtection;
}


@Override
public boolean equals(java.lang.Object o) {
Expand All @@ -479,12 +500,13 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.transactionType, placeOrderV3Request.transactionType) &&
Objects.equals(this.disclosedQuantity, placeOrderV3Request.disclosedQuantity) &&
Objects.equals(this.triggerPrice, placeOrderV3Request.triggerPrice) &&
Objects.equals(this.isAmo, placeOrderV3Request.isAmo);
Objects.equals(this.isAmo, placeOrderV3Request.isAmo) &&
Objects.equals(this.marketProtection, placeOrderV3Request.marketProtection);
}

@Override
public int hashCode() {
return Objects.hash(quantity, product, validity, price, tag, slice, instrumentToken, orderType, transactionType, disclosedQuantity, triggerPrice, isAmo);
return Objects.hash(quantity, product, validity, price, tag, slice, instrumentToken, orderType, transactionType, disclosedQuantity, triggerPrice, isAmo, marketProtection);
}


Expand All @@ -505,6 +527,7 @@ public String toString() {
sb.append(" disclosedQuantity: ").append(toIndentedString(disclosedQuantity)).append("\n");
sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n");
sb.append(" isAmo: ").append(toIndentedString(isAmo)).append("\n");
sb.append(" marketProtection: ").append(toIndentedString(marketProtection)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
27 changes: 25 additions & 2 deletions src/main/java/com/upstox/api/TokenRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public class TokenRequest {
@SerializedName("grant_type")
private String grantType = null;

@SerializedName("refresh_extended_token")
private Boolean refreshExtendedToken = null;

public TokenRequest code(String code) {
this.code = code;
return this;
Expand Down Expand Up @@ -133,6 +136,24 @@ public void setGrantType(String grantType) {
this.grantType = grantType;
}

public TokenRequest refreshExtendedToken(Boolean refreshExtendedToken) {
this.refreshExtendedToken = refreshExtendedToken;
return this;
}

/**
* Whether to generate an extended token along with the access token
* @return refreshExtendedToken
**/
@Schema(description = "Whether to generate an extended token along with the access token")
public Boolean isRefreshExtendedToken() {
return refreshExtendedToken;
}

public void setRefreshExtendedToken(Boolean refreshExtendedToken) {
this.refreshExtendedToken = refreshExtendedToken;
}


@Override
public boolean equals(java.lang.Object o) {
Expand All @@ -147,12 +168,13 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.clientId, tokenRequest.clientId) &&
Objects.equals(this.clientSecret, tokenRequest.clientSecret) &&
Objects.equals(this.redirectUri, tokenRequest.redirectUri) &&
Objects.equals(this.grantType, tokenRequest.grantType);
Objects.equals(this.grantType, tokenRequest.grantType) &&
Objects.equals(this.refreshExtendedToken, tokenRequest.refreshExtendedToken);
}

@Override
public int hashCode() {
return Objects.hash(code, clientId, clientSecret, redirectUri, grantType);
return Objects.hash(code, clientId, clientSecret, redirectUri, grantType, refreshExtendedToken);
}


Expand All @@ -166,6 +188,7 @@ public String toString() {
sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n");
sb.append(" redirectUri: ").append(toIndentedString(redirectUri)).append("\n");
sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n");
sb.append(" refreshExtendedToken: ").append(toIndentedString(refreshExtendedToken)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
Loading
Loading