Skip to content

Commit 16cc202

Browse files
author
BitsAdmin
committed
Merge 'tis-Java-2024-07-31-online-2284-2026_02_25_16_10_47' into 'integration_2026-02-26_1118052561922'
feat: [development task] tis-2284-Java (2130096) See merge request: !890
2 parents 07f97ac + e221753 commit 16cc202

File tree

5 files changed

+677
-0
lines changed

5 files changed

+677
-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.BuyResourcePackageResponse;
3434
import com.volcengine.tis.model.ClearDeviceLongMemoryRequest;
3535
import com.volcengine.tis.model.ClearDeviceLongMemoryResponse;
36+
import com.volcengine.tis.model.CreateDeviceWithoutApprovalRequest;
37+
import com.volcengine.tis.model.CreateDeviceWithoutApprovalResponse;
3638
import com.volcengine.tis.model.GetAgentListRequest;
3739
import com.volcengine.tis.model.GetAgentListResponse;
3840
import com.volcengine.tis.model.GetDeviceBindTcOrderIDRequest;
@@ -447,6 +449,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
447449
apiClient.executeAsync(call, localVarReturnType, callback);
448450
return call;
449451
}
452+
/**
453+
* Build call for createDeviceWithoutApproval
454+
* @param body (required)
455+
* @param progressListener Progress listener
456+
* @param progressRequestListener Progress request listener
457+
* @return Call to execute
458+
* @throws ApiException If fail to serialize the request body object
459+
*/
460+
public com.squareup.okhttp.Call createDeviceWithoutApprovalCall(CreateDeviceWithoutApprovalRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
461+
Object localVarPostBody = body;
462+
463+
// create path and map variables
464+
String localVarPath = "/CreateDeviceWithoutApproval/2024-07-31/tis/post/application_json/";
465+
466+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
467+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
468+
469+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
470+
471+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
472+
473+
final String[] localVarAccepts = {
474+
"application/json"
475+
};
476+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
477+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
478+
479+
final String[] localVarContentTypes = {
480+
"text/plain"
481+
};
482+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
483+
localVarHeaderParams.put("Content-Type", localVarContentType);
484+
485+
if(progressListener != null) {
486+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
487+
@Override
488+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
489+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
490+
return originalResponse.newBuilder()
491+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
492+
.build();
493+
}
494+
});
495+
}
496+
497+
String[] localVarAuthNames = new String[] { "volcengineSign" };
498+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
499+
}
500+
501+
@SuppressWarnings("rawtypes")
502+
private com.squareup.okhttp.Call createDeviceWithoutApprovalValidateBeforeCall(CreateDeviceWithoutApprovalRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
503+
// verify the required parameter 'body' is set
504+
if (body == null) {
505+
throw new ApiException("Missing the required parameter 'body' when calling createDeviceWithoutApproval(Async)");
506+
}
507+
508+
com.squareup.okhttp.Call call = createDeviceWithoutApprovalCall(body, progressListener, progressRequestListener);
509+
return call;
510+
511+
512+
513+
514+
515+
}
516+
517+
/**
518+
*
519+
*
520+
* @param body (required)
521+
* @return CreateDeviceWithoutApprovalResponse
522+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
523+
*/
524+
public CreateDeviceWithoutApprovalResponse createDeviceWithoutApproval(CreateDeviceWithoutApprovalRequest body) throws ApiException {
525+
ApiResponse<CreateDeviceWithoutApprovalResponse> resp = createDeviceWithoutApprovalWithHttpInfo(body);
526+
return resp.getData();
527+
}
528+
529+
/**
530+
*
531+
*
532+
* @param body (required)
533+
* @return ApiResponse&lt;CreateDeviceWithoutApprovalResponse&gt;
534+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
535+
*/
536+
public ApiResponse<CreateDeviceWithoutApprovalResponse> createDeviceWithoutApprovalWithHttpInfo( @NotNull CreateDeviceWithoutApprovalRequest body) throws ApiException {
537+
com.squareup.okhttp.Call call = createDeviceWithoutApprovalValidateBeforeCall(body, null, null);
538+
Type localVarReturnType = new TypeToken<CreateDeviceWithoutApprovalResponse>(){}.getType();
539+
return apiClient.execute(call, localVarReturnType);
540+
}
541+
542+
/**
543+
* (asynchronously)
544+
*
545+
* @param body (required)
546+
* @param callback The callback to be executed when the API call finishes
547+
* @return The request call
548+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
549+
*/
550+
public com.squareup.okhttp.Call createDeviceWithoutApprovalAsync(CreateDeviceWithoutApprovalRequest body, final ApiCallback<CreateDeviceWithoutApprovalResponse> callback) throws ApiException {
551+
552+
ProgressResponseBody.ProgressListener progressListener = null;
553+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
554+
555+
if (callback != null) {
556+
progressListener = new ProgressResponseBody.ProgressListener() {
557+
@Override
558+
public void update(long bytesRead, long contentLength, boolean done) {
559+
callback.onDownloadProgress(bytesRead, contentLength, done);
560+
}
561+
};
562+
563+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
564+
@Override
565+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
566+
callback.onUploadProgress(bytesWritten, contentLength, done);
567+
}
568+
};
569+
}
570+
571+
com.squareup.okhttp.Call call = createDeviceWithoutApprovalValidateBeforeCall(body, progressListener, progressRequestListener);
572+
Type localVarReturnType = new TypeToken<CreateDeviceWithoutApprovalResponse>(){}.getType();
573+
apiClient.executeAsync(call, localVarReturnType, callback);
574+
return call;
575+
}
450576
/**
451577
* Build call for getAgentList
452578
* @param body (required)
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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 com.volcengine.tis.model.DeviceListForCreateDeviceWithoutApprovalInput;
23+
import io.swagger.v3.oas.annotations.media.Schema;
24+
import java.io.IOException;
25+
import java.util.ArrayList;
26+
import java.util.List;
27+
import javax.validation.constraints.*;
28+
import javax.validation.Valid;
29+
/**
30+
* CreateDeviceWithoutApprovalRequest
31+
*/
32+
33+
34+
35+
public class CreateDeviceWithoutApprovalRequest {
36+
@SerializedName("DeviceList")
37+
private List<DeviceListForCreateDeviceWithoutApprovalInput> deviceList = null;
38+
39+
@SerializedName("ProductKey")
40+
private String productKey = null;
41+
42+
@SerializedName("ProjectId")
43+
private String projectId = null;
44+
45+
@SerializedName("TcId")
46+
private String tcId = null;
47+
48+
public CreateDeviceWithoutApprovalRequest deviceList(List<DeviceListForCreateDeviceWithoutApprovalInput> deviceList) {
49+
this.deviceList = deviceList;
50+
return this;
51+
}
52+
53+
public CreateDeviceWithoutApprovalRequest addDeviceListItem(DeviceListForCreateDeviceWithoutApprovalInput deviceListItem) {
54+
if (this.deviceList == null) {
55+
this.deviceList = new ArrayList<DeviceListForCreateDeviceWithoutApprovalInput>();
56+
}
57+
this.deviceList.add(deviceListItem);
58+
return this;
59+
}
60+
61+
/**
62+
* Get deviceList
63+
* @return deviceList
64+
**/
65+
@Valid
66+
@Schema(description = "")
67+
public List<DeviceListForCreateDeviceWithoutApprovalInput> getDeviceList() {
68+
return deviceList;
69+
}
70+
71+
public void setDeviceList(List<DeviceListForCreateDeviceWithoutApprovalInput> deviceList) {
72+
this.deviceList = deviceList;
73+
}
74+
75+
public CreateDeviceWithoutApprovalRequest productKey(String productKey) {
76+
this.productKey = productKey;
77+
return this;
78+
}
79+
80+
/**
81+
* Get productKey
82+
* @return productKey
83+
**/
84+
@NotNull
85+
@Schema(required = true, description = "")
86+
public String getProductKey() {
87+
return productKey;
88+
}
89+
90+
public void setProductKey(String productKey) {
91+
this.productKey = productKey;
92+
}
93+
94+
public CreateDeviceWithoutApprovalRequest projectId(String projectId) {
95+
this.projectId = projectId;
96+
return this;
97+
}
98+
99+
/**
100+
* Get projectId
101+
* @return projectId
102+
**/
103+
@NotNull
104+
@Schema(required = true, description = "")
105+
public String getProjectId() {
106+
return projectId;
107+
}
108+
109+
public void setProjectId(String projectId) {
110+
this.projectId = projectId;
111+
}
112+
113+
public CreateDeviceWithoutApprovalRequest tcId(String tcId) {
114+
this.tcId = tcId;
115+
return this;
116+
}
117+
118+
/**
119+
* Get tcId
120+
* @return tcId
121+
**/
122+
@NotNull
123+
@Schema(required = true, description = "")
124+
public String getTcId() {
125+
return tcId;
126+
}
127+
128+
public void setTcId(String tcId) {
129+
this.tcId = tcId;
130+
}
131+
132+
133+
@Override
134+
public boolean equals(java.lang.Object o) {
135+
if (this == o) {
136+
return true;
137+
}
138+
if (o == null || getClass() != o.getClass()) {
139+
return false;
140+
}
141+
CreateDeviceWithoutApprovalRequest createDeviceWithoutApprovalRequest = (CreateDeviceWithoutApprovalRequest) o;
142+
return Objects.equals(this.deviceList, createDeviceWithoutApprovalRequest.deviceList) &&
143+
Objects.equals(this.productKey, createDeviceWithoutApprovalRequest.productKey) &&
144+
Objects.equals(this.projectId, createDeviceWithoutApprovalRequest.projectId) &&
145+
Objects.equals(this.tcId, createDeviceWithoutApprovalRequest.tcId);
146+
}
147+
148+
@Override
149+
public int hashCode() {
150+
return Objects.hash(deviceList, productKey, projectId, tcId);
151+
}
152+
153+
154+
@Override
155+
public String toString() {
156+
StringBuilder sb = new StringBuilder();
157+
sb.append("class CreateDeviceWithoutApprovalRequest {\n");
158+
159+
sb.append(" deviceList: ").append(toIndentedString(deviceList)).append("\n");
160+
sb.append(" productKey: ").append(toIndentedString(productKey)).append("\n");
161+
sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n");
162+
sb.append(" tcId: ").append(toIndentedString(tcId)).append("\n");
163+
sb.append("}");
164+
return sb.toString();
165+
}
166+
167+
/**
168+
* Convert the given object to string with each line indented by 4 spaces
169+
* (except the first line).
170+
*/
171+
private String toIndentedString(java.lang.Object o) {
172+
if (o == null) {
173+
return "null";
174+
}
175+
return o.toString().replace("\n", "\n ");
176+
}
177+
178+
}

0 commit comments

Comments
 (0)