|
109 | 109 | import com.volcengine.organization.model.RemoveAccountResponse; |
110 | 110 | import com.volcengine.organization.model.RetryChangeAccountSecureContactInfoRequest; |
111 | 111 | import com.volcengine.organization.model.RetryChangeAccountSecureContactInfoResponse; |
| 112 | +import com.volcengine.organization.model.TagResourcesRequest; |
| 113 | +import com.volcengine.organization.model.TagResourcesResponse; |
| 114 | +import com.volcengine.organization.model.UntagResourcesRequest; |
| 115 | +import com.volcengine.organization.model.UntagResourcesResponse; |
112 | 116 | import com.volcengine.organization.model.UpdateAccountRequest; |
113 | 117 | import com.volcengine.organization.model.UpdateAccountResponse; |
114 | 118 | import com.volcengine.organization.model.UpdateOrganizationalUnitRequest; |
@@ -5225,6 +5229,254 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
5225 | 5229 | apiClient.executeAsync(call, localVarReturnType, callback); |
5226 | 5230 | return call; |
5227 | 5231 | } |
| 5232 | + /** |
| 5233 | + * Build call for tagResources |
| 5234 | + * @param body (required) |
| 5235 | + * @param progressListener Progress listener |
| 5236 | + * @param progressRequestListener Progress request listener |
| 5237 | + * @return Call to execute |
| 5238 | + * @throws ApiException If fail to serialize the request body object |
| 5239 | + */ |
| 5240 | + public com.squareup.okhttp.Call tagResourcesCall(TagResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 5241 | + Object localVarPostBody = body; |
| 5242 | + |
| 5243 | + // create path and map variables |
| 5244 | + String localVarPath = "/TagResources/2022-01-01/organization/get/text_plain/"; |
| 5245 | + |
| 5246 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 5247 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 5248 | + |
| 5249 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 5250 | + |
| 5251 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 5252 | + |
| 5253 | + final String[] localVarAccepts = { |
| 5254 | + "application/json" |
| 5255 | + }; |
| 5256 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 5257 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 5258 | + |
| 5259 | + final String[] localVarContentTypes = { |
| 5260 | + "text/plain" |
| 5261 | + }; |
| 5262 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 5263 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 5264 | + |
| 5265 | + if(progressListener != null) { |
| 5266 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 5267 | + @Override |
| 5268 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 5269 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 5270 | + return originalResponse.newBuilder() |
| 5271 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 5272 | + .build(); |
| 5273 | + } |
| 5274 | + }); |
| 5275 | + } |
| 5276 | + |
| 5277 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 5278 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 5279 | + } |
| 5280 | + |
| 5281 | + @SuppressWarnings("rawtypes") |
| 5282 | + private com.squareup.okhttp.Call tagResourcesValidateBeforeCall(TagResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 5283 | + // verify the required parameter 'body' is set |
| 5284 | + if (body == null) { |
| 5285 | + throw new ApiException("Missing the required parameter 'body' when calling tagResources(Async)"); |
| 5286 | + } |
| 5287 | + |
| 5288 | + com.squareup.okhttp.Call call = tagResourcesCall(body, progressListener, progressRequestListener); |
| 5289 | + return call; |
| 5290 | + |
| 5291 | + |
| 5292 | + |
| 5293 | + |
| 5294 | + |
| 5295 | + } |
| 5296 | + |
| 5297 | + /** |
| 5298 | + * |
| 5299 | + * |
| 5300 | + * @param body (required) |
| 5301 | + * @return TagResourcesResponse |
| 5302 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 5303 | + */ |
| 5304 | + public TagResourcesResponse tagResources(TagResourcesRequest body) throws ApiException { |
| 5305 | + ApiResponse<TagResourcesResponse> resp = tagResourcesWithHttpInfo(body); |
| 5306 | + return resp.getData(); |
| 5307 | + } |
| 5308 | + |
| 5309 | + /** |
| 5310 | + * |
| 5311 | + * |
| 5312 | + * @param body (required) |
| 5313 | + * @return ApiResponse<TagResourcesResponse> |
| 5314 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 5315 | + */ |
| 5316 | + public ApiResponse<TagResourcesResponse> tagResourcesWithHttpInfo( @NotNull TagResourcesRequest body) throws ApiException { |
| 5317 | + com.squareup.okhttp.Call call = tagResourcesValidateBeforeCall(body, null, null); |
| 5318 | + Type localVarReturnType = new TypeToken<TagResourcesResponse>(){}.getType(); |
| 5319 | + return apiClient.execute(call, localVarReturnType); |
| 5320 | + } |
| 5321 | + |
| 5322 | + /** |
| 5323 | + * (asynchronously) |
| 5324 | + * |
| 5325 | + * @param body (required) |
| 5326 | + * @param callback The callback to be executed when the API call finishes |
| 5327 | + * @return The request call |
| 5328 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 5329 | + */ |
| 5330 | + public com.squareup.okhttp.Call tagResourcesAsync(TagResourcesRequest body, final ApiCallback<TagResourcesResponse> callback) throws ApiException { |
| 5331 | + |
| 5332 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 5333 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 5334 | + |
| 5335 | + if (callback != null) { |
| 5336 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 5337 | + @Override |
| 5338 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 5339 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 5340 | + } |
| 5341 | + }; |
| 5342 | + |
| 5343 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 5344 | + @Override |
| 5345 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 5346 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 5347 | + } |
| 5348 | + }; |
| 5349 | + } |
| 5350 | + |
| 5351 | + com.squareup.okhttp.Call call = tagResourcesValidateBeforeCall(body, progressListener, progressRequestListener); |
| 5352 | + Type localVarReturnType = new TypeToken<TagResourcesResponse>(){}.getType(); |
| 5353 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 5354 | + return call; |
| 5355 | + } |
| 5356 | + /** |
| 5357 | + * Build call for untagResources |
| 5358 | + * @param body (required) |
| 5359 | + * @param progressListener Progress listener |
| 5360 | + * @param progressRequestListener Progress request listener |
| 5361 | + * @return Call to execute |
| 5362 | + * @throws ApiException If fail to serialize the request body object |
| 5363 | + */ |
| 5364 | + public com.squareup.okhttp.Call untagResourcesCall(UntagResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 5365 | + Object localVarPostBody = body; |
| 5366 | + |
| 5367 | + // create path and map variables |
| 5368 | + String localVarPath = "/UntagResources/2022-01-01/organization/get/text_plain/"; |
| 5369 | + |
| 5370 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 5371 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 5372 | + |
| 5373 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 5374 | + |
| 5375 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 5376 | + |
| 5377 | + final String[] localVarAccepts = { |
| 5378 | + "application/json" |
| 5379 | + }; |
| 5380 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 5381 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 5382 | + |
| 5383 | + final String[] localVarContentTypes = { |
| 5384 | + "text/plain" |
| 5385 | + }; |
| 5386 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 5387 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 5388 | + |
| 5389 | + if(progressListener != null) { |
| 5390 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 5391 | + @Override |
| 5392 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 5393 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 5394 | + return originalResponse.newBuilder() |
| 5395 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 5396 | + .build(); |
| 5397 | + } |
| 5398 | + }); |
| 5399 | + } |
| 5400 | + |
| 5401 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 5402 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 5403 | + } |
| 5404 | + |
| 5405 | + @SuppressWarnings("rawtypes") |
| 5406 | + private com.squareup.okhttp.Call untagResourcesValidateBeforeCall(UntagResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 5407 | + // verify the required parameter 'body' is set |
| 5408 | + if (body == null) { |
| 5409 | + throw new ApiException("Missing the required parameter 'body' when calling untagResources(Async)"); |
| 5410 | + } |
| 5411 | + |
| 5412 | + com.squareup.okhttp.Call call = untagResourcesCall(body, progressListener, progressRequestListener); |
| 5413 | + return call; |
| 5414 | + |
| 5415 | + |
| 5416 | + |
| 5417 | + |
| 5418 | + |
| 5419 | + } |
| 5420 | + |
| 5421 | + /** |
| 5422 | + * |
| 5423 | + * |
| 5424 | + * @param body (required) |
| 5425 | + * @return UntagResourcesResponse |
| 5426 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 5427 | + */ |
| 5428 | + public UntagResourcesResponse untagResources(UntagResourcesRequest body) throws ApiException { |
| 5429 | + ApiResponse<UntagResourcesResponse> resp = untagResourcesWithHttpInfo(body); |
| 5430 | + return resp.getData(); |
| 5431 | + } |
| 5432 | + |
| 5433 | + /** |
| 5434 | + * |
| 5435 | + * |
| 5436 | + * @param body (required) |
| 5437 | + * @return ApiResponse<UntagResourcesResponse> |
| 5438 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 5439 | + */ |
| 5440 | + public ApiResponse<UntagResourcesResponse> untagResourcesWithHttpInfo( @NotNull UntagResourcesRequest body) throws ApiException { |
| 5441 | + com.squareup.okhttp.Call call = untagResourcesValidateBeforeCall(body, null, null); |
| 5442 | + Type localVarReturnType = new TypeToken<UntagResourcesResponse>(){}.getType(); |
| 5443 | + return apiClient.execute(call, localVarReturnType); |
| 5444 | + } |
| 5445 | + |
| 5446 | + /** |
| 5447 | + * (asynchronously) |
| 5448 | + * |
| 5449 | + * @param body (required) |
| 5450 | + * @param callback The callback to be executed when the API call finishes |
| 5451 | + * @return The request call |
| 5452 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 5453 | + */ |
| 5454 | + public com.squareup.okhttp.Call untagResourcesAsync(UntagResourcesRequest body, final ApiCallback<UntagResourcesResponse> callback) throws ApiException { |
| 5455 | + |
| 5456 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 5457 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 5458 | + |
| 5459 | + if (callback != null) { |
| 5460 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 5461 | + @Override |
| 5462 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 5463 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 5464 | + } |
| 5465 | + }; |
| 5466 | + |
| 5467 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 5468 | + @Override |
| 5469 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 5470 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 5471 | + } |
| 5472 | + }; |
| 5473 | + } |
| 5474 | + |
| 5475 | + com.squareup.okhttp.Call call = untagResourcesValidateBeforeCall(body, progressListener, progressRequestListener); |
| 5476 | + Type localVarReturnType = new TypeToken<UntagResourcesResponse>(){}.getType(); |
| 5477 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 5478 | + return call; |
| 5479 | + } |
5228 | 5480 | /** |
5229 | 5481 | * Build call for updateAccount |
5230 | 5482 | * @param body (required) |
|
0 commit comments