|
37 | 37 | import com.volcengine.cen.model.CreateCenInterRegionBandwidthResponse; |
38 | 38 | import com.volcengine.cen.model.CreateCenRequest; |
39 | 39 | import com.volcengine.cen.model.CreateCenResponse; |
| 40 | +import com.volcengine.cen.model.CreateCenServiceRouteEntryRequest; |
| 41 | +import com.volcengine.cen.model.CreateCenServiceRouteEntryResponse; |
40 | 42 | import com.volcengine.cen.model.DeleteCenBandwidthPackageRequest; |
41 | 43 | import com.volcengine.cen.model.DeleteCenBandwidthPackageResponse; |
42 | 44 | import com.volcengine.cen.model.DeleteCenInterRegionBandwidthRequest; |
|
79 | 81 | import com.volcengine.cen.model.ModifyCenInterRegionBandwidthAttributesResponse; |
80 | 82 | import com.volcengine.cen.model.RevokeInstanceFromCenRequest; |
81 | 83 | import com.volcengine.cen.model.RevokeInstanceFromCenResponse; |
| 84 | +import com.volcengine.cen.model.TagResourcesRequest; |
| 85 | +import com.volcengine.cen.model.TagResourcesResponse; |
82 | 86 |
|
83 | 87 | import java.lang.reflect.Type; |
84 | 88 | import java.util.ArrayList; |
@@ -725,6 +729,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
725 | 729 | apiClient.executeAsync(call, localVarReturnType, callback); |
726 | 730 | return call; |
727 | 731 | } |
| 732 | + /** |
| 733 | + * Build call for createCenServiceRouteEntry |
| 734 | + * @param body (required) |
| 735 | + * @param progressListener Progress listener |
| 736 | + * @param progressRequestListener Progress request listener |
| 737 | + * @return Call to execute |
| 738 | + * @throws ApiException If fail to serialize the request body object |
| 739 | + */ |
| 740 | + public com.squareup.okhttp.Call createCenServiceRouteEntryCall(CreateCenServiceRouteEntryRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 741 | + Object localVarPostBody = body; |
| 742 | + |
| 743 | + // create path and map variables |
| 744 | + String localVarPath = "/CreateCenServiceRouteEntry/2020-04-01/cen/get/"; |
| 745 | + |
| 746 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 747 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 748 | + |
| 749 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 750 | + |
| 751 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 752 | + |
| 753 | + final String[] localVarAccepts = { |
| 754 | + "application/json" |
| 755 | + }; |
| 756 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 757 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 758 | + |
| 759 | + final String[] localVarContentTypes = { |
| 760 | + "text/plain" |
| 761 | + }; |
| 762 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 763 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 764 | + |
| 765 | + if(progressListener != null) { |
| 766 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 767 | + @Override |
| 768 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 769 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 770 | + return originalResponse.newBuilder() |
| 771 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 772 | + .build(); |
| 773 | + } |
| 774 | + }); |
| 775 | + } |
| 776 | + |
| 777 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 778 | + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 779 | + } |
| 780 | + |
| 781 | + @SuppressWarnings("rawtypes") |
| 782 | + private com.squareup.okhttp.Call createCenServiceRouteEntryValidateBeforeCall(CreateCenServiceRouteEntryRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 783 | + // verify the required parameter 'body' is set |
| 784 | + if (body == null) { |
| 785 | + throw new ApiException("Missing the required parameter 'body' when calling createCenServiceRouteEntry(Async)"); |
| 786 | + } |
| 787 | + |
| 788 | + com.squareup.okhttp.Call call = createCenServiceRouteEntryCall(body, progressListener, progressRequestListener); |
| 789 | + return call; |
| 790 | + |
| 791 | + |
| 792 | + |
| 793 | + |
| 794 | + |
| 795 | + } |
| 796 | + |
| 797 | + /** |
| 798 | + * |
| 799 | + * |
| 800 | + * @param body (required) |
| 801 | + * @return CreateCenServiceRouteEntryResponse |
| 802 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 803 | + */ |
| 804 | + public CreateCenServiceRouteEntryResponse createCenServiceRouteEntry(CreateCenServiceRouteEntryRequest body) throws ApiException { |
| 805 | + ApiResponse<CreateCenServiceRouteEntryResponse> resp = createCenServiceRouteEntryWithHttpInfo(body); |
| 806 | + return resp.getData(); |
| 807 | + } |
| 808 | + |
| 809 | + /** |
| 810 | + * |
| 811 | + * |
| 812 | + * @param body (required) |
| 813 | + * @return ApiResponse<CreateCenServiceRouteEntryResponse> |
| 814 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 815 | + */ |
| 816 | + public ApiResponse<CreateCenServiceRouteEntryResponse> createCenServiceRouteEntryWithHttpInfo( @NotNull CreateCenServiceRouteEntryRequest body) throws ApiException { |
| 817 | + com.squareup.okhttp.Call call = createCenServiceRouteEntryValidateBeforeCall(body, null, null); |
| 818 | + Type localVarReturnType = new TypeToken<CreateCenServiceRouteEntryResponse>(){}.getType(); |
| 819 | + return apiClient.execute(call, localVarReturnType); |
| 820 | + } |
| 821 | + |
| 822 | + /** |
| 823 | + * (asynchronously) |
| 824 | + * |
| 825 | + * @param body (required) |
| 826 | + * @param callback The callback to be executed when the API call finishes |
| 827 | + * @return The request call |
| 828 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 829 | + */ |
| 830 | + public com.squareup.okhttp.Call createCenServiceRouteEntryAsync(CreateCenServiceRouteEntryRequest body, final ApiCallback<CreateCenServiceRouteEntryResponse> callback) throws ApiException { |
| 831 | + |
| 832 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 833 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 834 | + |
| 835 | + if (callback != null) { |
| 836 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 837 | + @Override |
| 838 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 839 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 840 | + } |
| 841 | + }; |
| 842 | + |
| 843 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 844 | + @Override |
| 845 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 846 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 847 | + } |
| 848 | + }; |
| 849 | + } |
| 850 | + |
| 851 | + com.squareup.okhttp.Call call = createCenServiceRouteEntryValidateBeforeCall(body, progressListener, progressRequestListener); |
| 852 | + Type localVarReturnType = new TypeToken<CreateCenServiceRouteEntryResponse>(){}.getType(); |
| 853 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 854 | + return call; |
| 855 | + } |
728 | 856 | /** |
729 | 857 | * Build call for deleteCen |
730 | 858 | * @param body (required) |
@@ -3329,4 +3457,128 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
3329 | 3457 | apiClient.executeAsync(call, localVarReturnType, callback); |
3330 | 3458 | return call; |
3331 | 3459 | } |
| 3460 | + /** |
| 3461 | + * Build call for tagResources |
| 3462 | + * @param body (required) |
| 3463 | + * @param progressListener Progress listener |
| 3464 | + * @param progressRequestListener Progress request listener |
| 3465 | + * @return Call to execute |
| 3466 | + * @throws ApiException If fail to serialize the request body object |
| 3467 | + */ |
| 3468 | + public com.squareup.okhttp.Call tagResourcesCall(TagResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 3469 | + Object localVarPostBody = body; |
| 3470 | + |
| 3471 | + // create path and map variables |
| 3472 | + String localVarPath = "/TagResources/2020-04-01/cen/get/"; |
| 3473 | + |
| 3474 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 3475 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 3476 | + |
| 3477 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 3478 | + |
| 3479 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 3480 | + |
| 3481 | + final String[] localVarAccepts = { |
| 3482 | + "application/json" |
| 3483 | + }; |
| 3484 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 3485 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 3486 | + |
| 3487 | + final String[] localVarContentTypes = { |
| 3488 | + "text/plain" |
| 3489 | + }; |
| 3490 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 3491 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 3492 | + |
| 3493 | + if(progressListener != null) { |
| 3494 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 3495 | + @Override |
| 3496 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 3497 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 3498 | + return originalResponse.newBuilder() |
| 3499 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 3500 | + .build(); |
| 3501 | + } |
| 3502 | + }); |
| 3503 | + } |
| 3504 | + |
| 3505 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 3506 | + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 3507 | + } |
| 3508 | + |
| 3509 | + @SuppressWarnings("rawtypes") |
| 3510 | + private com.squareup.okhttp.Call tagResourcesValidateBeforeCall(TagResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 3511 | + // verify the required parameter 'body' is set |
| 3512 | + if (body == null) { |
| 3513 | + throw new ApiException("Missing the required parameter 'body' when calling tagResources(Async)"); |
| 3514 | + } |
| 3515 | + |
| 3516 | + com.squareup.okhttp.Call call = tagResourcesCall(body, progressListener, progressRequestListener); |
| 3517 | + return call; |
| 3518 | + |
| 3519 | + |
| 3520 | + |
| 3521 | + |
| 3522 | + |
| 3523 | + } |
| 3524 | + |
| 3525 | + /** |
| 3526 | + * |
| 3527 | + * |
| 3528 | + * @param body (required) |
| 3529 | + * @return TagResourcesResponse |
| 3530 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 3531 | + */ |
| 3532 | + public TagResourcesResponse tagResources(TagResourcesRequest body) throws ApiException { |
| 3533 | + ApiResponse<TagResourcesResponse> resp = tagResourcesWithHttpInfo(body); |
| 3534 | + return resp.getData(); |
| 3535 | + } |
| 3536 | + |
| 3537 | + /** |
| 3538 | + * |
| 3539 | + * |
| 3540 | + * @param body (required) |
| 3541 | + * @return ApiResponse<TagResourcesResponse> |
| 3542 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 3543 | + */ |
| 3544 | + public ApiResponse<TagResourcesResponse> tagResourcesWithHttpInfo( @NotNull TagResourcesRequest body) throws ApiException { |
| 3545 | + com.squareup.okhttp.Call call = tagResourcesValidateBeforeCall(body, null, null); |
| 3546 | + Type localVarReturnType = new TypeToken<TagResourcesResponse>(){}.getType(); |
| 3547 | + return apiClient.execute(call, localVarReturnType); |
| 3548 | + } |
| 3549 | + |
| 3550 | + /** |
| 3551 | + * (asynchronously) |
| 3552 | + * |
| 3553 | + * @param body (required) |
| 3554 | + * @param callback The callback to be executed when the API call finishes |
| 3555 | + * @return The request call |
| 3556 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 3557 | + */ |
| 3558 | + public com.squareup.okhttp.Call tagResourcesAsync(TagResourcesRequest body, final ApiCallback<TagResourcesResponse> callback) throws ApiException { |
| 3559 | + |
| 3560 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 3561 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 3562 | + |
| 3563 | + if (callback != null) { |
| 3564 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 3565 | + @Override |
| 3566 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 3567 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 3568 | + } |
| 3569 | + }; |
| 3570 | + |
| 3571 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 3572 | + @Override |
| 3573 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 3574 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 3575 | + } |
| 3576 | + }; |
| 3577 | + } |
| 3578 | + |
| 3579 | + com.squareup.okhttp.Call call = tagResourcesValidateBeforeCall(body, progressListener, progressRequestListener); |
| 3580 | + Type localVarReturnType = new TypeToken<TagResourcesResponse>(){}.getType(); |
| 3581 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 3582 | + return call; |
| 3583 | + } |
3332 | 3584 | } |
0 commit comments