|
73 | 73 | import com.volcengine.cen.model.DisassociateCenBandwidthPackageResponse; |
74 | 74 | import com.volcengine.cen.model.GrantInstanceToCenRequest; |
75 | 75 | import com.volcengine.cen.model.GrantInstanceToCenResponse; |
| 76 | +import com.volcengine.cen.model.ListTagsForResourcesRequest; |
| 77 | +import com.volcengine.cen.model.ListTagsForResourcesResponse; |
76 | 78 | import com.volcengine.cen.model.ModifyCenAttributesRequest; |
77 | 79 | import com.volcengine.cen.model.ModifyCenAttributesResponse; |
78 | 80 | import com.volcengine.cen.model.ModifyCenBandwidthPackageAttributesRequest; |
|
83 | 85 | import com.volcengine.cen.model.RevokeInstanceFromCenResponse; |
84 | 86 | import com.volcengine.cen.model.TagResourcesRequest; |
85 | 87 | import com.volcengine.cen.model.TagResourcesResponse; |
| 88 | +import com.volcengine.cen.model.UntagResourcesRequest; |
| 89 | +import com.volcengine.cen.model.UntagResourcesResponse; |
86 | 90 |
|
87 | 91 | import java.lang.reflect.Type; |
88 | 92 | import java.util.ArrayList; |
@@ -2961,6 +2965,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
2961 | 2965 | apiClient.executeAsync(call, localVarReturnType, callback); |
2962 | 2966 | return call; |
2963 | 2967 | } |
| 2968 | + /** |
| 2969 | + * Build call for listTagsForResources |
| 2970 | + * @param body (required) |
| 2971 | + * @param progressListener Progress listener |
| 2972 | + * @param progressRequestListener Progress request listener |
| 2973 | + * @return Call to execute |
| 2974 | + * @throws ApiException If fail to serialize the request body object |
| 2975 | + */ |
| 2976 | + public com.squareup.okhttp.Call listTagsForResourcesCall(ListTagsForResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 2977 | + Object localVarPostBody = body; |
| 2978 | + |
| 2979 | + // create path and map variables |
| 2980 | + String localVarPath = "/ListTagsForResources/2020-04-01/cen/get/"; |
| 2981 | + |
| 2982 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 2983 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 2984 | + |
| 2985 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 2986 | + |
| 2987 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 2988 | + |
| 2989 | + final String[] localVarAccepts = { |
| 2990 | + "application/json" |
| 2991 | + }; |
| 2992 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 2993 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 2994 | + |
| 2995 | + final String[] localVarContentTypes = { |
| 2996 | + "text/plain" |
| 2997 | + }; |
| 2998 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 2999 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 3000 | + |
| 3001 | + if(progressListener != null) { |
| 3002 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 3003 | + @Override |
| 3004 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 3005 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 3006 | + return originalResponse.newBuilder() |
| 3007 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 3008 | + .build(); |
| 3009 | + } |
| 3010 | + }); |
| 3011 | + } |
| 3012 | + |
| 3013 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 3014 | + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 3015 | + } |
| 3016 | + |
| 3017 | + @SuppressWarnings("rawtypes") |
| 3018 | + private com.squareup.okhttp.Call listTagsForResourcesValidateBeforeCall(ListTagsForResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 3019 | + // verify the required parameter 'body' is set |
| 3020 | + if (body == null) { |
| 3021 | + throw new ApiException("Missing the required parameter 'body' when calling listTagsForResources(Async)"); |
| 3022 | + } |
| 3023 | + |
| 3024 | + com.squareup.okhttp.Call call = listTagsForResourcesCall(body, progressListener, progressRequestListener); |
| 3025 | + return call; |
| 3026 | + |
| 3027 | + |
| 3028 | + |
| 3029 | + |
| 3030 | + |
| 3031 | + } |
| 3032 | + |
| 3033 | + /** |
| 3034 | + * |
| 3035 | + * |
| 3036 | + * @param body (required) |
| 3037 | + * @return ListTagsForResourcesResponse |
| 3038 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 3039 | + */ |
| 3040 | + public ListTagsForResourcesResponse listTagsForResources(ListTagsForResourcesRequest body) throws ApiException { |
| 3041 | + ApiResponse<ListTagsForResourcesResponse> resp = listTagsForResourcesWithHttpInfo(body); |
| 3042 | + return resp.getData(); |
| 3043 | + } |
| 3044 | + |
| 3045 | + /** |
| 3046 | + * |
| 3047 | + * |
| 3048 | + * @param body (required) |
| 3049 | + * @return ApiResponse<ListTagsForResourcesResponse> |
| 3050 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 3051 | + */ |
| 3052 | + public ApiResponse<ListTagsForResourcesResponse> listTagsForResourcesWithHttpInfo( @NotNull ListTagsForResourcesRequest body) throws ApiException { |
| 3053 | + com.squareup.okhttp.Call call = listTagsForResourcesValidateBeforeCall(body, null, null); |
| 3054 | + Type localVarReturnType = new TypeToken<ListTagsForResourcesResponse>(){}.getType(); |
| 3055 | + return apiClient.execute(call, localVarReturnType); |
| 3056 | + } |
| 3057 | + |
| 3058 | + /** |
| 3059 | + * (asynchronously) |
| 3060 | + * |
| 3061 | + * @param body (required) |
| 3062 | + * @param callback The callback to be executed when the API call finishes |
| 3063 | + * @return The request call |
| 3064 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 3065 | + */ |
| 3066 | + public com.squareup.okhttp.Call listTagsForResourcesAsync(ListTagsForResourcesRequest body, final ApiCallback<ListTagsForResourcesResponse> callback) throws ApiException { |
| 3067 | + |
| 3068 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 3069 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 3070 | + |
| 3071 | + if (callback != null) { |
| 3072 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 3073 | + @Override |
| 3074 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 3075 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 3076 | + } |
| 3077 | + }; |
| 3078 | + |
| 3079 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 3080 | + @Override |
| 3081 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 3082 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 3083 | + } |
| 3084 | + }; |
| 3085 | + } |
| 3086 | + |
| 3087 | + com.squareup.okhttp.Call call = listTagsForResourcesValidateBeforeCall(body, progressListener, progressRequestListener); |
| 3088 | + Type localVarReturnType = new TypeToken<ListTagsForResourcesResponse>(){}.getType(); |
| 3089 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 3090 | + return call; |
| 3091 | + } |
2964 | 3092 | /** |
2965 | 3093 | * Build call for modifyCenAttributes |
2966 | 3094 | * @param body (required) |
@@ -3581,4 +3709,128 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
3581 | 3709 | apiClient.executeAsync(call, localVarReturnType, callback); |
3582 | 3710 | return call; |
3583 | 3711 | } |
| 3712 | + /** |
| 3713 | + * Build call for untagResources |
| 3714 | + * @param body (required) |
| 3715 | + * @param progressListener Progress listener |
| 3716 | + * @param progressRequestListener Progress request listener |
| 3717 | + * @return Call to execute |
| 3718 | + * @throws ApiException If fail to serialize the request body object |
| 3719 | + */ |
| 3720 | + public com.squareup.okhttp.Call untagResourcesCall(UntagResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 3721 | + Object localVarPostBody = body; |
| 3722 | + |
| 3723 | + // create path and map variables |
| 3724 | + String localVarPath = "/UntagResources/2020-04-01/cen/get/"; |
| 3725 | + |
| 3726 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 3727 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 3728 | + |
| 3729 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 3730 | + |
| 3731 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 3732 | + |
| 3733 | + final String[] localVarAccepts = { |
| 3734 | + "application/json" |
| 3735 | + }; |
| 3736 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 3737 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 3738 | + |
| 3739 | + final String[] localVarContentTypes = { |
| 3740 | + "text/plain" |
| 3741 | + }; |
| 3742 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 3743 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 3744 | + |
| 3745 | + if(progressListener != null) { |
| 3746 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 3747 | + @Override |
| 3748 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 3749 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 3750 | + return originalResponse.newBuilder() |
| 3751 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 3752 | + .build(); |
| 3753 | + } |
| 3754 | + }); |
| 3755 | + } |
| 3756 | + |
| 3757 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 3758 | + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 3759 | + } |
| 3760 | + |
| 3761 | + @SuppressWarnings("rawtypes") |
| 3762 | + private com.squareup.okhttp.Call untagResourcesValidateBeforeCall(UntagResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 3763 | + // verify the required parameter 'body' is set |
| 3764 | + if (body == null) { |
| 3765 | + throw new ApiException("Missing the required parameter 'body' when calling untagResources(Async)"); |
| 3766 | + } |
| 3767 | + |
| 3768 | + com.squareup.okhttp.Call call = untagResourcesCall(body, progressListener, progressRequestListener); |
| 3769 | + return call; |
| 3770 | + |
| 3771 | + |
| 3772 | + |
| 3773 | + |
| 3774 | + |
| 3775 | + } |
| 3776 | + |
| 3777 | + /** |
| 3778 | + * |
| 3779 | + * |
| 3780 | + * @param body (required) |
| 3781 | + * @return UntagResourcesResponse |
| 3782 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 3783 | + */ |
| 3784 | + public UntagResourcesResponse untagResources(UntagResourcesRequest body) throws ApiException { |
| 3785 | + ApiResponse<UntagResourcesResponse> resp = untagResourcesWithHttpInfo(body); |
| 3786 | + return resp.getData(); |
| 3787 | + } |
| 3788 | + |
| 3789 | + /** |
| 3790 | + * |
| 3791 | + * |
| 3792 | + * @param body (required) |
| 3793 | + * @return ApiResponse<UntagResourcesResponse> |
| 3794 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 3795 | + */ |
| 3796 | + public ApiResponse<UntagResourcesResponse> untagResourcesWithHttpInfo( @NotNull UntagResourcesRequest body) throws ApiException { |
| 3797 | + com.squareup.okhttp.Call call = untagResourcesValidateBeforeCall(body, null, null); |
| 3798 | + Type localVarReturnType = new TypeToken<UntagResourcesResponse>(){}.getType(); |
| 3799 | + return apiClient.execute(call, localVarReturnType); |
| 3800 | + } |
| 3801 | + |
| 3802 | + /** |
| 3803 | + * (asynchronously) |
| 3804 | + * |
| 3805 | + * @param body (required) |
| 3806 | + * @param callback The callback to be executed when the API call finishes |
| 3807 | + * @return The request call |
| 3808 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 3809 | + */ |
| 3810 | + public com.squareup.okhttp.Call untagResourcesAsync(UntagResourcesRequest body, final ApiCallback<UntagResourcesResponse> callback) throws ApiException { |
| 3811 | + |
| 3812 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 3813 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 3814 | + |
| 3815 | + if (callback != null) { |
| 3816 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 3817 | + @Override |
| 3818 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 3819 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 3820 | + } |
| 3821 | + }; |
| 3822 | + |
| 3823 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 3824 | + @Override |
| 3825 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 3826 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 3827 | + } |
| 3828 | + }; |
| 3829 | + } |
| 3830 | + |
| 3831 | + com.squareup.okhttp.Call call = untagResourcesValidateBeforeCall(body, progressListener, progressRequestListener); |
| 3832 | + Type localVarReturnType = new TypeToken<UntagResourcesResponse>(){}.getType(); |
| 3833 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 3834 | + return call; |
| 3835 | + } |
3584 | 3836 | } |
0 commit comments