Skip to content

Commit 5b37b32

Browse files
author
BitsAdmin
committed
Merge branch 'tis-Java-2024-07-31-online-950-2025_01_21_10_47_48' into 'integration_2025-01-23_701095353346'
feat: [development task] tis-950-Java (990481) See merge request iaasng/volcengine-java-sdk!367
2 parents 119dd02 + 7ef9144 commit 5b37b32

File tree

6 files changed

+934
-0
lines changed

6 files changed

+934
-0
lines changed

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

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@
2727

2828
import javax.validation.constraints.*;
2929

30+
import com.volcengine.tis.model.BuyResourcePackageRequest;
31+
import com.volcengine.tis.model.BuyResourcePackageResponse;
3032
import com.volcengine.tis.model.GetAccessTokenRequest;
3133
import com.volcengine.tis.model.GetAccessTokenResponse;
34+
import com.volcengine.tis.model.GetQuotaInfoRequest;
35+
import com.volcengine.tis.model.GetQuotaInfoResponse;
3236

3337
import java.lang.reflect.Type;
3438
import java.util.ArrayList;
@@ -55,6 +59,130 @@ public void setApiClient(ApiClient apiClient) {
5559
this.apiClient = apiClient;
5660
}
5761

62+
/**
63+
* Build call for buyResourcePackage
64+
* @param body (required)
65+
* @param progressListener Progress listener
66+
* @param progressRequestListener Progress request listener
67+
* @return Call to execute
68+
* @throws ApiException If fail to serialize the request body object
69+
*/
70+
public com.squareup.okhttp.Call buyResourcePackageCall(BuyResourcePackageRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
71+
Object localVarPostBody = body;
72+
73+
// create path and map variables
74+
String localVarPath = "/BuyResourcePackage/2024-07-31/tis/post/application_json/";
75+
76+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
77+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
78+
79+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
80+
81+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
82+
83+
final String[] localVarAccepts = {
84+
"application/json"
85+
};
86+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
87+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
88+
89+
final String[] localVarContentTypes = {
90+
"text/plain"
91+
};
92+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
93+
localVarHeaderParams.put("Content-Type", localVarContentType);
94+
95+
if(progressListener != null) {
96+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
97+
@Override
98+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
99+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
100+
return originalResponse.newBuilder()
101+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
102+
.build();
103+
}
104+
});
105+
}
106+
107+
String[] localVarAuthNames = new String[] { "volcengineSign" };
108+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
109+
}
110+
111+
@SuppressWarnings("rawtypes")
112+
private com.squareup.okhttp.Call buyResourcePackageValidateBeforeCall(BuyResourcePackageRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
113+
// verify the required parameter 'body' is set
114+
if (body == null) {
115+
throw new ApiException("Missing the required parameter 'body' when calling buyResourcePackage(Async)");
116+
}
117+
118+
com.squareup.okhttp.Call call = buyResourcePackageCall(body, progressListener, progressRequestListener);
119+
return call;
120+
121+
122+
123+
124+
125+
}
126+
127+
/**
128+
*
129+
*
130+
* @param body (required)
131+
* @return BuyResourcePackageResponse
132+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
133+
*/
134+
public BuyResourcePackageResponse buyResourcePackage(BuyResourcePackageRequest body) throws ApiException {
135+
ApiResponse<BuyResourcePackageResponse> resp = buyResourcePackageWithHttpInfo(body);
136+
return resp.getData();
137+
}
138+
139+
/**
140+
*
141+
*
142+
* @param body (required)
143+
* @return ApiResponse&lt;BuyResourcePackageResponse&gt;
144+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
145+
*/
146+
public ApiResponse<BuyResourcePackageResponse> buyResourcePackageWithHttpInfo( @NotNull BuyResourcePackageRequest body) throws ApiException {
147+
com.squareup.okhttp.Call call = buyResourcePackageValidateBeforeCall(body, null, null);
148+
Type localVarReturnType = new TypeToken<BuyResourcePackageResponse>(){}.getType();
149+
return apiClient.execute(call, localVarReturnType);
150+
}
151+
152+
/**
153+
* (asynchronously)
154+
*
155+
* @param body (required)
156+
* @param callback The callback to be executed when the API call finishes
157+
* @return The request call
158+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
159+
*/
160+
public com.squareup.okhttp.Call buyResourcePackageAsync(BuyResourcePackageRequest body, final ApiCallback<BuyResourcePackageResponse> callback) throws ApiException {
161+
162+
ProgressResponseBody.ProgressListener progressListener = null;
163+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
164+
165+
if (callback != null) {
166+
progressListener = new ProgressResponseBody.ProgressListener() {
167+
@Override
168+
public void update(long bytesRead, long contentLength, boolean done) {
169+
callback.onDownloadProgress(bytesRead, contentLength, done);
170+
}
171+
};
172+
173+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
174+
@Override
175+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
176+
callback.onUploadProgress(bytesWritten, contentLength, done);
177+
}
178+
};
179+
}
180+
181+
com.squareup.okhttp.Call call = buyResourcePackageValidateBeforeCall(body, progressListener, progressRequestListener);
182+
Type localVarReturnType = new TypeToken<BuyResourcePackageResponse>(){}.getType();
183+
apiClient.executeAsync(call, localVarReturnType, callback);
184+
return call;
185+
}
58186
/**
59187
* Build call for getAccessToken
60188
* @param body (required)
@@ -179,4 +307,128 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
179307
apiClient.executeAsync(call, localVarReturnType, callback);
180308
return call;
181309
}
310+
/**
311+
* Build call for getQuotaInfo
312+
* @param body (required)
313+
* @param progressListener Progress listener
314+
* @param progressRequestListener Progress request listener
315+
* @return Call to execute
316+
* @throws ApiException If fail to serialize the request body object
317+
*/
318+
public com.squareup.okhttp.Call getQuotaInfoCall(GetQuotaInfoRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
319+
Object localVarPostBody = body;
320+
321+
// create path and map variables
322+
String localVarPath = "/GetQuotaInfo/2024-07-31/tis/post/application_json/";
323+
324+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
325+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
326+
327+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
328+
329+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
330+
331+
final String[] localVarAccepts = {
332+
"application/json"
333+
};
334+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
335+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
336+
337+
final String[] localVarContentTypes = {
338+
"text/plain"
339+
};
340+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
341+
localVarHeaderParams.put("Content-Type", localVarContentType);
342+
343+
if(progressListener != null) {
344+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
345+
@Override
346+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
347+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
348+
return originalResponse.newBuilder()
349+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
350+
.build();
351+
}
352+
});
353+
}
354+
355+
String[] localVarAuthNames = new String[] { "volcengineSign" };
356+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
357+
}
358+
359+
@SuppressWarnings("rawtypes")
360+
private com.squareup.okhttp.Call getQuotaInfoValidateBeforeCall(GetQuotaInfoRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
361+
// verify the required parameter 'body' is set
362+
if (body == null) {
363+
throw new ApiException("Missing the required parameter 'body' when calling getQuotaInfo(Async)");
364+
}
365+
366+
com.squareup.okhttp.Call call = getQuotaInfoCall(body, progressListener, progressRequestListener);
367+
return call;
368+
369+
370+
371+
372+
373+
}
374+
375+
/**
376+
*
377+
*
378+
* @param body (required)
379+
* @return GetQuotaInfoResponse
380+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
381+
*/
382+
public GetQuotaInfoResponse getQuotaInfo(GetQuotaInfoRequest body) throws ApiException {
383+
ApiResponse<GetQuotaInfoResponse> resp = getQuotaInfoWithHttpInfo(body);
384+
return resp.getData();
385+
}
386+
387+
/**
388+
*
389+
*
390+
* @param body (required)
391+
* @return ApiResponse&lt;GetQuotaInfoResponse&gt;
392+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
393+
*/
394+
public ApiResponse<GetQuotaInfoResponse> getQuotaInfoWithHttpInfo( @NotNull GetQuotaInfoRequest body) throws ApiException {
395+
com.squareup.okhttp.Call call = getQuotaInfoValidateBeforeCall(body, null, null);
396+
Type localVarReturnType = new TypeToken<GetQuotaInfoResponse>(){}.getType();
397+
return apiClient.execute(call, localVarReturnType);
398+
}
399+
400+
/**
401+
* (asynchronously)
402+
*
403+
* @param body (required)
404+
* @param callback The callback to be executed when the API call finishes
405+
* @return The request call
406+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
407+
*/
408+
public com.squareup.okhttp.Call getQuotaInfoAsync(GetQuotaInfoRequest body, final ApiCallback<GetQuotaInfoResponse> callback) throws ApiException {
409+
410+
ProgressResponseBody.ProgressListener progressListener = null;
411+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
412+
413+
if (callback != null) {
414+
progressListener = new ProgressResponseBody.ProgressListener() {
415+
@Override
416+
public void update(long bytesRead, long contentLength, boolean done) {
417+
callback.onDownloadProgress(bytesRead, contentLength, done);
418+
}
419+
};
420+
421+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
422+
@Override
423+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
424+
callback.onUploadProgress(bytesWritten, contentLength, done);
425+
}
426+
};
427+
}
428+
429+
com.squareup.okhttp.Call call = getQuotaInfoValidateBeforeCall(body, progressListener, progressRequestListener);
430+
Type localVarReturnType = new TypeToken<GetQuotaInfoResponse>(){}.getType();
431+
apiClient.executeAsync(call, localVarReturnType, callback);
432+
return call;
433+
}
182434
}

0 commit comments

Comments
 (0)