|
87 | 87 | import com.volcengine.bmq.model.PreviewTopicDataResponse; |
88 | 88 | import com.volcengine.bmq.model.ResetSubscriptionOffsetRequest; |
89 | 89 | import com.volcengine.bmq.model.ResetSubscriptionOffsetResponse; |
| 90 | +import com.volcengine.bmq.model.ScaleDownInstanceRequest; |
| 91 | +import com.volcengine.bmq.model.ScaleDownInstanceResponse; |
90 | 92 | import com.volcengine.bmq.model.ScaleUpTopicRequest; |
91 | 93 | import com.volcengine.bmq.model.ScaleUpTopicResponse; |
92 | 94 | import com.volcengine.bmq.model.SearchGroupsRequest; |
|
95 | 97 | import com.volcengine.bmq.model.SearchInstancesResponse; |
96 | 98 | import com.volcengine.bmq.model.SearchTopicsRequest; |
97 | 99 | import com.volcengine.bmq.model.SearchTopicsResponse; |
| 100 | +import com.volcengine.bmq.model.TopicExistRequest; |
| 101 | +import com.volcengine.bmq.model.TopicExistResponse; |
98 | 102 | import com.volcengine.bmq.model.UpdateInstanceMessageRetentionRequest; |
99 | 103 | import com.volcengine.bmq.model.UpdateInstanceMessageRetentionResponse; |
100 | 104 | import com.volcengine.bmq.model.UpdateTopicMessageRetentionRequest; |
@@ -3845,6 +3849,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
3845 | 3849 | apiClient.executeAsync(call, localVarReturnType, callback); |
3846 | 3850 | return call; |
3847 | 3851 | } |
| 3852 | + /** |
| 3853 | + * Build call for scaleDownInstance |
| 3854 | + * @param body (required) |
| 3855 | + * @param progressListener Progress listener |
| 3856 | + * @param progressRequestListener Progress request listener |
| 3857 | + * @return Call to execute |
| 3858 | + * @throws ApiException If fail to serialize the request body object |
| 3859 | + */ |
| 3860 | + public com.squareup.okhttp.Call scaleDownInstanceCall(ScaleDownInstanceRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 3861 | + Object localVarPostBody = body; |
| 3862 | + |
| 3863 | + // create path and map variables |
| 3864 | + String localVarPath = "/ScaleDownInstance/2023-06-01/bmq/post/application_json/"; |
| 3865 | + |
| 3866 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 3867 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 3868 | + |
| 3869 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 3870 | + |
| 3871 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 3872 | + |
| 3873 | + final String[] localVarAccepts = { |
| 3874 | + "application/json" |
| 3875 | + }; |
| 3876 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 3877 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 3878 | + |
| 3879 | + final String[] localVarContentTypes = { |
| 3880 | + "text/plain" |
| 3881 | + }; |
| 3882 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 3883 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 3884 | + |
| 3885 | + if(progressListener != null) { |
| 3886 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 3887 | + @Override |
| 3888 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 3889 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 3890 | + return originalResponse.newBuilder() |
| 3891 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 3892 | + .build(); |
| 3893 | + } |
| 3894 | + }); |
| 3895 | + } |
| 3896 | + |
| 3897 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 3898 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 3899 | + } |
| 3900 | + |
| 3901 | + @SuppressWarnings("rawtypes") |
| 3902 | + private com.squareup.okhttp.Call scaleDownInstanceValidateBeforeCall(ScaleDownInstanceRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 3903 | + // verify the required parameter 'body' is set |
| 3904 | + if (body == null) { |
| 3905 | + throw new ApiException("Missing the required parameter 'body' when calling scaleDownInstance(Async)"); |
| 3906 | + } |
| 3907 | + |
| 3908 | + com.squareup.okhttp.Call call = scaleDownInstanceCall(body, progressListener, progressRequestListener); |
| 3909 | + return call; |
| 3910 | + |
| 3911 | + |
| 3912 | + |
| 3913 | + |
| 3914 | + |
| 3915 | + } |
| 3916 | + |
| 3917 | + /** |
| 3918 | + * |
| 3919 | + * |
| 3920 | + * @param body (required) |
| 3921 | + * @return ScaleDownInstanceResponse |
| 3922 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 3923 | + */ |
| 3924 | + public ScaleDownInstanceResponse scaleDownInstance(ScaleDownInstanceRequest body) throws ApiException { |
| 3925 | + ApiResponse<ScaleDownInstanceResponse> resp = scaleDownInstanceWithHttpInfo(body); |
| 3926 | + return resp.getData(); |
| 3927 | + } |
| 3928 | + |
| 3929 | + /** |
| 3930 | + * |
| 3931 | + * |
| 3932 | + * @param body (required) |
| 3933 | + * @return ApiResponse<ScaleDownInstanceResponse> |
| 3934 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 3935 | + */ |
| 3936 | + public ApiResponse<ScaleDownInstanceResponse> scaleDownInstanceWithHttpInfo( @NotNull ScaleDownInstanceRequest body) throws ApiException { |
| 3937 | + com.squareup.okhttp.Call call = scaleDownInstanceValidateBeforeCall(body, null, null); |
| 3938 | + Type localVarReturnType = new TypeToken<ScaleDownInstanceResponse>(){}.getType(); |
| 3939 | + return apiClient.execute(call, localVarReturnType); |
| 3940 | + } |
| 3941 | + |
| 3942 | + /** |
| 3943 | + * (asynchronously) |
| 3944 | + * |
| 3945 | + * @param body (required) |
| 3946 | + * @param callback The callback to be executed when the API call finishes |
| 3947 | + * @return The request call |
| 3948 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 3949 | + */ |
| 3950 | + public com.squareup.okhttp.Call scaleDownInstanceAsync(ScaleDownInstanceRequest body, final ApiCallback<ScaleDownInstanceResponse> callback) throws ApiException { |
| 3951 | + |
| 3952 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 3953 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 3954 | + |
| 3955 | + if (callback != null) { |
| 3956 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 3957 | + @Override |
| 3958 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 3959 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 3960 | + } |
| 3961 | + }; |
| 3962 | + |
| 3963 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 3964 | + @Override |
| 3965 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 3966 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 3967 | + } |
| 3968 | + }; |
| 3969 | + } |
| 3970 | + |
| 3971 | + com.squareup.okhttp.Call call = scaleDownInstanceValidateBeforeCall(body, progressListener, progressRequestListener); |
| 3972 | + Type localVarReturnType = new TypeToken<ScaleDownInstanceResponse>(){}.getType(); |
| 3973 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 3974 | + return call; |
| 3975 | + } |
3848 | 3976 | /** |
3849 | 3977 | * Build call for scaleUpTopic |
3850 | 3978 | * @param body (required) |
@@ -4341,6 +4469,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
4341 | 4469 | apiClient.executeAsync(call, localVarReturnType, callback); |
4342 | 4470 | return call; |
4343 | 4471 | } |
| 4472 | + /** |
| 4473 | + * Build call for topicExist |
| 4474 | + * @param body (required) |
| 4475 | + * @param progressListener Progress listener |
| 4476 | + * @param progressRequestListener Progress request listener |
| 4477 | + * @return Call to execute |
| 4478 | + * @throws ApiException If fail to serialize the request body object |
| 4479 | + */ |
| 4480 | + public com.squareup.okhttp.Call topicExistCall(TopicExistRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 4481 | + Object localVarPostBody = body; |
| 4482 | + |
| 4483 | + // create path and map variables |
| 4484 | + String localVarPath = "/TopicExist/2023-06-01/bmq/get/text_plain/"; |
| 4485 | + |
| 4486 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 4487 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 4488 | + |
| 4489 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 4490 | + |
| 4491 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 4492 | + |
| 4493 | + final String[] localVarAccepts = { |
| 4494 | + "application/json" |
| 4495 | + }; |
| 4496 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 4497 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 4498 | + |
| 4499 | + final String[] localVarContentTypes = { |
| 4500 | + "text/plain" |
| 4501 | + }; |
| 4502 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 4503 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 4504 | + |
| 4505 | + if(progressListener != null) { |
| 4506 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 4507 | + @Override |
| 4508 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 4509 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 4510 | + return originalResponse.newBuilder() |
| 4511 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 4512 | + .build(); |
| 4513 | + } |
| 4514 | + }); |
| 4515 | + } |
| 4516 | + |
| 4517 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 4518 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 4519 | + } |
| 4520 | + |
| 4521 | + @SuppressWarnings("rawtypes") |
| 4522 | + private com.squareup.okhttp.Call topicExistValidateBeforeCall(TopicExistRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 4523 | + // verify the required parameter 'body' is set |
| 4524 | + if (body == null) { |
| 4525 | + throw new ApiException("Missing the required parameter 'body' when calling topicExist(Async)"); |
| 4526 | + } |
| 4527 | + |
| 4528 | + com.squareup.okhttp.Call call = topicExistCall(body, progressListener, progressRequestListener); |
| 4529 | + return call; |
| 4530 | + |
| 4531 | + |
| 4532 | + |
| 4533 | + |
| 4534 | + |
| 4535 | + } |
| 4536 | + |
| 4537 | + /** |
| 4538 | + * |
| 4539 | + * |
| 4540 | + * @param body (required) |
| 4541 | + * @return TopicExistResponse |
| 4542 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 4543 | + */ |
| 4544 | + public TopicExistResponse topicExist(TopicExistRequest body) throws ApiException { |
| 4545 | + ApiResponse<TopicExistResponse> resp = topicExistWithHttpInfo(body); |
| 4546 | + return resp.getData(); |
| 4547 | + } |
| 4548 | + |
| 4549 | + /** |
| 4550 | + * |
| 4551 | + * |
| 4552 | + * @param body (required) |
| 4553 | + * @return ApiResponse<TopicExistResponse> |
| 4554 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 4555 | + */ |
| 4556 | + public ApiResponse<TopicExistResponse> topicExistWithHttpInfo( @NotNull TopicExistRequest body) throws ApiException { |
| 4557 | + com.squareup.okhttp.Call call = topicExistValidateBeforeCall(body, null, null); |
| 4558 | + Type localVarReturnType = new TypeToken<TopicExistResponse>(){}.getType(); |
| 4559 | + return apiClient.execute(call, localVarReturnType); |
| 4560 | + } |
| 4561 | + |
| 4562 | + /** |
| 4563 | + * (asynchronously) |
| 4564 | + * |
| 4565 | + * @param body (required) |
| 4566 | + * @param callback The callback to be executed when the API call finishes |
| 4567 | + * @return The request call |
| 4568 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 4569 | + */ |
| 4570 | + public com.squareup.okhttp.Call topicExistAsync(TopicExistRequest body, final ApiCallback<TopicExistResponse> callback) throws ApiException { |
| 4571 | + |
| 4572 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 4573 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 4574 | + |
| 4575 | + if (callback != null) { |
| 4576 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 4577 | + @Override |
| 4578 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 4579 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 4580 | + } |
| 4581 | + }; |
| 4582 | + |
| 4583 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 4584 | + @Override |
| 4585 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 4586 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 4587 | + } |
| 4588 | + }; |
| 4589 | + } |
| 4590 | + |
| 4591 | + com.squareup.okhttp.Call call = topicExistValidateBeforeCall(body, progressListener, progressRequestListener); |
| 4592 | + Type localVarReturnType = new TypeToken<TopicExistResponse>(){}.getType(); |
| 4593 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 4594 | + return call; |
| 4595 | + } |
4344 | 4596 | /** |
4345 | 4597 | * Build call for updateInstanceMessageRetention |
4346 | 4598 | * @param body (required) |
|
0 commit comments