|
31 | 31 | import com.volcengine.tis.model.BuyResourcePackageResponse; |
32 | 32 | import com.volcengine.tis.model.ClearDeviceLongMemoryRequest; |
33 | 33 | import com.volcengine.tis.model.ClearDeviceLongMemoryResponse; |
34 | | -import com.volcengine.tis.model.GetAccessTokenRequest; |
35 | | -import com.volcengine.tis.model.GetAccessTokenResponse; |
36 | 34 | import com.volcengine.tis.model.GetAgentListRequest; |
37 | 35 | import com.volcengine.tis.model.GetAgentListResponse; |
38 | 36 | import com.volcengine.tis.model.GetQuotaInfoRequest; |
@@ -317,130 +315,6 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
317 | 315 | apiClient.executeAsync(call, localVarReturnType, callback); |
318 | 316 | return call; |
319 | 317 | } |
320 | | - /** |
321 | | - * Build call for getAccessToken |
322 | | - * @param body (required) |
323 | | - * @param progressListener Progress listener |
324 | | - * @param progressRequestListener Progress request listener |
325 | | - * @return Call to execute |
326 | | - * @throws ApiException If fail to serialize the request body object |
327 | | - */ |
328 | | - public com.squareup.okhttp.Call getAccessTokenCall(GetAccessTokenRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
329 | | - Object localVarPostBody = body; |
330 | | - |
331 | | - // create path and map variables |
332 | | - String localVarPath = "/GetAccessToken/2024-07-31/tis/post/application_json/"; |
333 | | - |
334 | | - List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
335 | | - List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
336 | | - |
337 | | - Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
338 | | - |
339 | | - Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
340 | | - |
341 | | - final String[] localVarAccepts = { |
342 | | - "application/json" |
343 | | - }; |
344 | | - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
345 | | - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
346 | | - |
347 | | - final String[] localVarContentTypes = { |
348 | | - "text/plain" |
349 | | - }; |
350 | | - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
351 | | - localVarHeaderParams.put("Content-Type", localVarContentType); |
352 | | - |
353 | | - if(progressListener != null) { |
354 | | - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
355 | | - @Override |
356 | | - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
357 | | - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
358 | | - return originalResponse.newBuilder() |
359 | | - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
360 | | - .build(); |
361 | | - } |
362 | | - }); |
363 | | - } |
364 | | - |
365 | | - String[] localVarAuthNames = new String[] { "volcengineSign" }; |
366 | | - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
367 | | - } |
368 | | - |
369 | | - @SuppressWarnings("rawtypes") |
370 | | - private com.squareup.okhttp.Call getAccessTokenValidateBeforeCall(GetAccessTokenRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
371 | | - // verify the required parameter 'body' is set |
372 | | - if (body == null) { |
373 | | - throw new ApiException("Missing the required parameter 'body' when calling getAccessToken(Async)"); |
374 | | - } |
375 | | - |
376 | | - com.squareup.okhttp.Call call = getAccessTokenCall(body, progressListener, progressRequestListener); |
377 | | - return call; |
378 | | - |
379 | | - |
380 | | - |
381 | | - |
382 | | - |
383 | | - } |
384 | | - |
385 | | - /** |
386 | | - * |
387 | | - * |
388 | | - * @param body (required) |
389 | | - * @return GetAccessTokenResponse |
390 | | - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
391 | | - */ |
392 | | - public GetAccessTokenResponse getAccessToken(GetAccessTokenRequest body) throws ApiException { |
393 | | - ApiResponse<GetAccessTokenResponse> resp = getAccessTokenWithHttpInfo(body); |
394 | | - return resp.getData(); |
395 | | - } |
396 | | - |
397 | | - /** |
398 | | - * |
399 | | - * |
400 | | - * @param body (required) |
401 | | - * @return ApiResponse<GetAccessTokenResponse> |
402 | | - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
403 | | - */ |
404 | | - public ApiResponse<GetAccessTokenResponse> getAccessTokenWithHttpInfo( @NotNull GetAccessTokenRequest body) throws ApiException { |
405 | | - com.squareup.okhttp.Call call = getAccessTokenValidateBeforeCall(body, null, null); |
406 | | - Type localVarReturnType = new TypeToken<GetAccessTokenResponse>(){}.getType(); |
407 | | - return apiClient.execute(call, localVarReturnType); |
408 | | - } |
409 | | - |
410 | | - /** |
411 | | - * (asynchronously) |
412 | | - * |
413 | | - * @param body (required) |
414 | | - * @param callback The callback to be executed when the API call finishes |
415 | | - * @return The request call |
416 | | - * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
417 | | - */ |
418 | | - public com.squareup.okhttp.Call getAccessTokenAsync(GetAccessTokenRequest body, final ApiCallback<GetAccessTokenResponse> callback) throws ApiException { |
419 | | - |
420 | | - ProgressResponseBody.ProgressListener progressListener = null; |
421 | | - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
422 | | - |
423 | | - if (callback != null) { |
424 | | - progressListener = new ProgressResponseBody.ProgressListener() { |
425 | | - @Override |
426 | | - public void update(long bytesRead, long contentLength, boolean done) { |
427 | | - callback.onDownloadProgress(bytesRead, contentLength, done); |
428 | | - } |
429 | | - }; |
430 | | - |
431 | | - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
432 | | - @Override |
433 | | - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
434 | | - callback.onUploadProgress(bytesWritten, contentLength, done); |
435 | | - } |
436 | | - }; |
437 | | - } |
438 | | - |
439 | | - com.squareup.okhttp.Call call = getAccessTokenValidateBeforeCall(body, progressListener, progressRequestListener); |
440 | | - Type localVarReturnType = new TypeToken<GetAccessTokenResponse>(){}.getType(); |
441 | | - apiClient.executeAsync(call, localVarReturnType, callback); |
442 | | - return call; |
443 | | - } |
444 | 318 | /** |
445 | 319 | * Build call for getAgentList |
446 | 320 | * @param body (required) |
|
0 commit comments