Skip to content

Commit 0d146fe

Browse files
author
BitsAdmin
committed
Merge branch 'tis-Java-2024-07-31-online-1162-2025_05_14_19_45_31' into 'integration_2025-05-15_905315453698'
feat: [development task] tis-1162-Java (1224787) See merge request iaasng/volcengine-java-sdk!482
2 parents af3fa58 + fa10df9 commit 0d146fe

File tree

3 files changed

+339
-0
lines changed

3 files changed

+339
-0
lines changed

volcengine-java-sdk-tis/src/main/java/com/volcengine/tis/TisApi.java

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import com.volcengine.tis.model.GetAccessTokenResponse;
3434
import com.volcengine.tis.model.GetQuotaInfoRequest;
3535
import com.volcengine.tis.model.GetQuotaInfoResponse;
36+
import com.volcengine.tis.model.TopActionDispatchRequest;
37+
import com.volcengine.tis.model.TopActionDispatchResponse;
3638

3739
import java.lang.reflect.Type;
3840
import java.util.ArrayList;
@@ -431,4 +433,128 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
431433
apiClient.executeAsync(call, localVarReturnType, callback);
432434
return call;
433435
}
436+
/**
437+
* Build call for topActionDispatch
438+
* @param body (required)
439+
* @param progressListener Progress listener
440+
* @param progressRequestListener Progress request listener
441+
* @return Call to execute
442+
* @throws ApiException If fail to serialize the request body object
443+
*/
444+
public com.squareup.okhttp.Call topActionDispatchCall(TopActionDispatchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
445+
Object localVarPostBody = body;
446+
447+
// create path and map variables
448+
String localVarPath = "/TopActionDispatch/2024-07-31/tis/post/application_json/";
449+
450+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
451+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
452+
453+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
454+
455+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
456+
457+
final String[] localVarAccepts = {
458+
"application/json"
459+
};
460+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
461+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
462+
463+
final String[] localVarContentTypes = {
464+
"text/plain"
465+
};
466+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
467+
localVarHeaderParams.put("Content-Type", localVarContentType);
468+
469+
if(progressListener != null) {
470+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
471+
@Override
472+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
473+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
474+
return originalResponse.newBuilder()
475+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
476+
.build();
477+
}
478+
});
479+
}
480+
481+
String[] localVarAuthNames = new String[] { "volcengineSign" };
482+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
483+
}
484+
485+
@SuppressWarnings("rawtypes")
486+
private com.squareup.okhttp.Call topActionDispatchValidateBeforeCall(TopActionDispatchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
487+
// verify the required parameter 'body' is set
488+
if (body == null) {
489+
throw new ApiException("Missing the required parameter 'body' when calling topActionDispatch(Async)");
490+
}
491+
492+
com.squareup.okhttp.Call call = topActionDispatchCall(body, progressListener, progressRequestListener);
493+
return call;
494+
495+
496+
497+
498+
499+
}
500+
501+
/**
502+
*
503+
*
504+
* @param body (required)
505+
* @return TopActionDispatchResponse
506+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
507+
*/
508+
public TopActionDispatchResponse topActionDispatch(TopActionDispatchRequest body) throws ApiException {
509+
ApiResponse<TopActionDispatchResponse> resp = topActionDispatchWithHttpInfo(body);
510+
return resp.getData();
511+
}
512+
513+
/**
514+
*
515+
*
516+
* @param body (required)
517+
* @return ApiResponse&lt;TopActionDispatchResponse&gt;
518+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
519+
*/
520+
public ApiResponse<TopActionDispatchResponse> topActionDispatchWithHttpInfo( @NotNull TopActionDispatchRequest body) throws ApiException {
521+
com.squareup.okhttp.Call call = topActionDispatchValidateBeforeCall(body, null, null);
522+
Type localVarReturnType = new TypeToken<TopActionDispatchResponse>(){}.getType();
523+
return apiClient.execute(call, localVarReturnType);
524+
}
525+
526+
/**
527+
* (asynchronously)
528+
*
529+
* @param body (required)
530+
* @param callback The callback to be executed when the API call finishes
531+
* @return The request call
532+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
533+
*/
534+
public com.squareup.okhttp.Call topActionDispatchAsync(TopActionDispatchRequest body, final ApiCallback<TopActionDispatchResponse> callback) throws ApiException {
535+
536+
ProgressResponseBody.ProgressListener progressListener = null;
537+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
538+
539+
if (callback != null) {
540+
progressListener = new ProgressResponseBody.ProgressListener() {
541+
@Override
542+
public void update(long bytesRead, long contentLength, boolean done) {
543+
callback.onDownloadProgress(bytesRead, contentLength, done);
544+
}
545+
};
546+
547+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
548+
@Override
549+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
550+
callback.onUploadProgress(bytesWritten, contentLength, done);
551+
}
552+
};
553+
}
554+
555+
com.squareup.okhttp.Call call = topActionDispatchValidateBeforeCall(body, progressListener, progressRequestListener);
556+
Type localVarReturnType = new TypeToken<TopActionDispatchResponse>(){}.getType();
557+
apiClient.executeAsync(call, localVarReturnType, callback);
558+
return call;
559+
}
434560
}
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
/*
2+
* tis
3+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4+
*
5+
* OpenAPI spec version: common-version
6+
*
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
package com.volcengine.tis.model;
14+
15+
import java.util.Objects;
16+
import java.util.Arrays;
17+
import com.google.gson.TypeAdapter;
18+
import com.google.gson.annotations.JsonAdapter;
19+
import com.google.gson.annotations.SerializedName;
20+
import com.google.gson.stream.JsonReader;
21+
import com.google.gson.stream.JsonWriter;
22+
import io.swagger.v3.oas.annotations.media.Schema;
23+
import java.io.IOException;
24+
import javax.validation.constraints.*;
25+
import javax.validation.Valid;
26+
/**
27+
* TopActionDispatchRequest
28+
*/
29+
30+
31+
32+
public class TopActionDispatchRequest {
33+
@SerializedName("ActionName")
34+
private String actionName = null;
35+
36+
@SerializedName("RequestJson")
37+
private String requestJson = null;
38+
39+
public TopActionDispatchRequest actionName(String actionName) {
40+
this.actionName = actionName;
41+
return this;
42+
}
43+
44+
/**
45+
* Get actionName
46+
* @return actionName
47+
**/
48+
@NotNull
49+
@Schema(required = true, description = "")
50+
public String getActionName() {
51+
return actionName;
52+
}
53+
54+
public void setActionName(String actionName) {
55+
this.actionName = actionName;
56+
}
57+
58+
public TopActionDispatchRequest requestJson(String requestJson) {
59+
this.requestJson = requestJson;
60+
return this;
61+
}
62+
63+
/**
64+
* Get requestJson
65+
* @return requestJson
66+
**/
67+
@NotNull
68+
@Schema(required = true, description = "")
69+
public String getRequestJson() {
70+
return requestJson;
71+
}
72+
73+
public void setRequestJson(String requestJson) {
74+
this.requestJson = requestJson;
75+
}
76+
77+
78+
@Override
79+
public boolean equals(java.lang.Object o) {
80+
if (this == o) {
81+
return true;
82+
}
83+
if (o == null || getClass() != o.getClass()) {
84+
return false;
85+
}
86+
TopActionDispatchRequest topActionDispatchRequest = (TopActionDispatchRequest) o;
87+
return Objects.equals(this.actionName, topActionDispatchRequest.actionName) &&
88+
Objects.equals(this.requestJson, topActionDispatchRequest.requestJson);
89+
}
90+
91+
@Override
92+
public int hashCode() {
93+
return Objects.hash(actionName, requestJson);
94+
}
95+
96+
97+
@Override
98+
public String toString() {
99+
StringBuilder sb = new StringBuilder();
100+
sb.append("class TopActionDispatchRequest {\n");
101+
102+
sb.append(" actionName: ").append(toIndentedString(actionName)).append("\n");
103+
sb.append(" requestJson: ").append(toIndentedString(requestJson)).append("\n");
104+
sb.append("}");
105+
return sb.toString();
106+
}
107+
108+
/**
109+
* Convert the given object to string with each line indented by 4 spaces
110+
* (except the first line).
111+
*/
112+
private String toIndentedString(java.lang.Object o) {
113+
if (o == null) {
114+
return "null";
115+
}
116+
return o.toString().replace("\n", "\n ");
117+
}
118+
119+
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* tis
3+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4+
*
5+
* OpenAPI spec version: common-version
6+
*
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
package com.volcengine.tis.model;
14+
15+
import java.util.Objects;
16+
import java.util.Arrays;
17+
import com.google.gson.TypeAdapter;
18+
import com.google.gson.annotations.JsonAdapter;
19+
import com.google.gson.annotations.SerializedName;
20+
import com.google.gson.stream.JsonReader;
21+
import com.google.gson.stream.JsonWriter;
22+
import io.swagger.v3.oas.annotations.media.Schema;
23+
import java.io.IOException;
24+
import javax.validation.constraints.*;
25+
import javax.validation.Valid;
26+
/**
27+
* TopActionDispatchResponse
28+
*/
29+
30+
31+
32+
public class TopActionDispatchResponse extends com.volcengine.model.AbstractResponse {
33+
@SerializedName("ResponseJson")
34+
private String responseJson = null;
35+
36+
public TopActionDispatchResponse responseJson(String responseJson) {
37+
this.responseJson = responseJson;
38+
return this;
39+
}
40+
41+
/**
42+
* Get responseJson
43+
* @return responseJson
44+
**/
45+
@Schema(description = "")
46+
public String getResponseJson() {
47+
return responseJson;
48+
}
49+
50+
public void setResponseJson(String responseJson) {
51+
this.responseJson = responseJson;
52+
}
53+
54+
55+
@Override
56+
public boolean equals(java.lang.Object o) {
57+
if (this == o) {
58+
return true;
59+
}
60+
if (o == null || getClass() != o.getClass()) {
61+
return false;
62+
}
63+
TopActionDispatchResponse topActionDispatchResponse = (TopActionDispatchResponse) o;
64+
return Objects.equals(this.responseJson, topActionDispatchResponse.responseJson);
65+
}
66+
67+
@Override
68+
public int hashCode() {
69+
return Objects.hash(responseJson);
70+
}
71+
72+
73+
@Override
74+
public String toString() {
75+
StringBuilder sb = new StringBuilder();
76+
sb.append("class TopActionDispatchResponse {\n");
77+
78+
sb.append(" responseJson: ").append(toIndentedString(responseJson)).append("\n");
79+
sb.append("}");
80+
return sb.toString();
81+
}
82+
83+
/**
84+
* Convert the given object to string with each line indented by 4 spaces
85+
* (except the first line).
86+
*/
87+
private String toIndentedString(java.lang.Object o) {
88+
if (o == null) {
89+
return "null";
90+
}
91+
return o.toString().replace("\n", "\n ");
92+
}
93+
94+
}

0 commit comments

Comments
 (0)