|
89 | 89 | import com.volcengine.organization.model.ListOrganizationalUnitsForParentResponse; |
90 | 90 | import com.volcengine.organization.model.ListOrganizationalUnitsRequest; |
91 | 91 | import com.volcengine.organization.model.ListOrganizationalUnitsResponse; |
| 92 | +import com.volcengine.organization.model.ListPoliciesForTargetRequest; |
| 93 | +import com.volcengine.organization.model.ListPoliciesForTargetResponse; |
92 | 94 | import com.volcengine.organization.model.ListServiceControlPoliciesRequest; |
93 | 95 | import com.volcengine.organization.model.ListServiceControlPoliciesResponse; |
| 96 | +import com.volcengine.organization.model.ListTargetsForPolicyRequest; |
| 97 | +import com.volcengine.organization.model.ListTargetsForPolicyResponse; |
94 | 98 | import com.volcengine.organization.model.MoveAccountRequest; |
95 | 99 | import com.volcengine.organization.model.MoveAccountResponse; |
96 | 100 | import com.volcengine.organization.model.QuitOrganizationRequest; |
@@ -3981,6 +3985,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
3981 | 3985 | apiClient.executeAsync(call, localVarReturnType, callback); |
3982 | 3986 | return call; |
3983 | 3987 | } |
| 3988 | + /** |
| 3989 | + * Build call for listPoliciesForTarget |
| 3990 | + * @param body (required) |
| 3991 | + * @param progressListener Progress listener |
| 3992 | + * @param progressRequestListener Progress request listener |
| 3993 | + * @return Call to execute |
| 3994 | + * @throws ApiException If fail to serialize the request body object |
| 3995 | + */ |
| 3996 | + public com.squareup.okhttp.Call listPoliciesForTargetCall(ListPoliciesForTargetRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 3997 | + Object localVarPostBody = body; |
| 3998 | + |
| 3999 | + // create path and map variables |
| 4000 | + String localVarPath = "/ListPoliciesForTarget/2022-01-01/organization/post/application_json/"; |
| 4001 | + |
| 4002 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 4003 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 4004 | + |
| 4005 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 4006 | + |
| 4007 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 4008 | + |
| 4009 | + final String[] localVarAccepts = { |
| 4010 | + "application/json" |
| 4011 | + }; |
| 4012 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 4013 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 4014 | + |
| 4015 | + final String[] localVarContentTypes = { |
| 4016 | + "text/plain" |
| 4017 | + }; |
| 4018 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 4019 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 4020 | + |
| 4021 | + if(progressListener != null) { |
| 4022 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 4023 | + @Override |
| 4024 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 4025 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 4026 | + return originalResponse.newBuilder() |
| 4027 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 4028 | + .build(); |
| 4029 | + } |
| 4030 | + }); |
| 4031 | + } |
| 4032 | + |
| 4033 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 4034 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 4035 | + } |
| 4036 | + |
| 4037 | + @SuppressWarnings("rawtypes") |
| 4038 | + private com.squareup.okhttp.Call listPoliciesForTargetValidateBeforeCall(ListPoliciesForTargetRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 4039 | + // verify the required parameter 'body' is set |
| 4040 | + if (body == null) { |
| 4041 | + throw new ApiException("Missing the required parameter 'body' when calling listPoliciesForTarget(Async)"); |
| 4042 | + } |
| 4043 | + |
| 4044 | + com.squareup.okhttp.Call call = listPoliciesForTargetCall(body, progressListener, progressRequestListener); |
| 4045 | + return call; |
| 4046 | + |
| 4047 | + |
| 4048 | + |
| 4049 | + |
| 4050 | + |
| 4051 | + } |
| 4052 | + |
| 4053 | + /** |
| 4054 | + * |
| 4055 | + * |
| 4056 | + * @param body (required) |
| 4057 | + * @return ListPoliciesForTargetResponse |
| 4058 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 4059 | + */ |
| 4060 | + public ListPoliciesForTargetResponse listPoliciesForTarget(ListPoliciesForTargetRequest body) throws ApiException { |
| 4061 | + ApiResponse<ListPoliciesForTargetResponse> resp = listPoliciesForTargetWithHttpInfo(body); |
| 4062 | + return resp.getData(); |
| 4063 | + } |
| 4064 | + |
| 4065 | + /** |
| 4066 | + * |
| 4067 | + * |
| 4068 | + * @param body (required) |
| 4069 | + * @return ApiResponse<ListPoliciesForTargetResponse> |
| 4070 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 4071 | + */ |
| 4072 | + public ApiResponse<ListPoliciesForTargetResponse> listPoliciesForTargetWithHttpInfo( @NotNull ListPoliciesForTargetRequest body) throws ApiException { |
| 4073 | + com.squareup.okhttp.Call call = listPoliciesForTargetValidateBeforeCall(body, null, null); |
| 4074 | + Type localVarReturnType = new TypeToken<ListPoliciesForTargetResponse>(){}.getType(); |
| 4075 | + return apiClient.execute(call, localVarReturnType); |
| 4076 | + } |
| 4077 | + |
| 4078 | + /** |
| 4079 | + * (asynchronously) |
| 4080 | + * |
| 4081 | + * @param body (required) |
| 4082 | + * @param callback The callback to be executed when the API call finishes |
| 4083 | + * @return The request call |
| 4084 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 4085 | + */ |
| 4086 | + public com.squareup.okhttp.Call listPoliciesForTargetAsync(ListPoliciesForTargetRequest body, final ApiCallback<ListPoliciesForTargetResponse> callback) throws ApiException { |
| 4087 | + |
| 4088 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 4089 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 4090 | + |
| 4091 | + if (callback != null) { |
| 4092 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 4093 | + @Override |
| 4094 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 4095 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 4096 | + } |
| 4097 | + }; |
| 4098 | + |
| 4099 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 4100 | + @Override |
| 4101 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 4102 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 4103 | + } |
| 4104 | + }; |
| 4105 | + } |
| 4106 | + |
| 4107 | + com.squareup.okhttp.Call call = listPoliciesForTargetValidateBeforeCall(body, progressListener, progressRequestListener); |
| 4108 | + Type localVarReturnType = new TypeToken<ListPoliciesForTargetResponse>(){}.getType(); |
| 4109 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 4110 | + return call; |
| 4111 | + } |
3984 | 4112 | /** |
3985 | 4113 | * Build call for listServiceControlPolicies |
3986 | 4114 | * @param body (required) |
@@ -4105,6 +4233,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
4105 | 4233 | apiClient.executeAsync(call, localVarReturnType, callback); |
4106 | 4234 | return call; |
4107 | 4235 | } |
| 4236 | + /** |
| 4237 | + * Build call for listTargetsForPolicy |
| 4238 | + * @param body (required) |
| 4239 | + * @param progressListener Progress listener |
| 4240 | + * @param progressRequestListener Progress request listener |
| 4241 | + * @return Call to execute |
| 4242 | + * @throws ApiException If fail to serialize the request body object |
| 4243 | + */ |
| 4244 | + public com.squareup.okhttp.Call listTargetsForPolicyCall(ListTargetsForPolicyRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 4245 | + Object localVarPostBody = body; |
| 4246 | + |
| 4247 | + // create path and map variables |
| 4248 | + String localVarPath = "/ListTargetsForPolicy/2022-01-01/organization/post/application_json/"; |
| 4249 | + |
| 4250 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 4251 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 4252 | + |
| 4253 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 4254 | + |
| 4255 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 4256 | + |
| 4257 | + final String[] localVarAccepts = { |
| 4258 | + "application/json" |
| 4259 | + }; |
| 4260 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 4261 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 4262 | + |
| 4263 | + final String[] localVarContentTypes = { |
| 4264 | + "text/plain" |
| 4265 | + }; |
| 4266 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 4267 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 4268 | + |
| 4269 | + if(progressListener != null) { |
| 4270 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 4271 | + @Override |
| 4272 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 4273 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 4274 | + return originalResponse.newBuilder() |
| 4275 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 4276 | + .build(); |
| 4277 | + } |
| 4278 | + }); |
| 4279 | + } |
| 4280 | + |
| 4281 | + String[] localVarAuthNames = new String[] { "volcengineSign" }; |
| 4282 | + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 4283 | + } |
| 4284 | + |
| 4285 | + @SuppressWarnings("rawtypes") |
| 4286 | + private com.squareup.okhttp.Call listTargetsForPolicyValidateBeforeCall(ListTargetsForPolicyRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 4287 | + // verify the required parameter 'body' is set |
| 4288 | + if (body == null) { |
| 4289 | + throw new ApiException("Missing the required parameter 'body' when calling listTargetsForPolicy(Async)"); |
| 4290 | + } |
| 4291 | + |
| 4292 | + com.squareup.okhttp.Call call = listTargetsForPolicyCall(body, progressListener, progressRequestListener); |
| 4293 | + return call; |
| 4294 | + |
| 4295 | + |
| 4296 | + |
| 4297 | + |
| 4298 | + |
| 4299 | + } |
| 4300 | + |
| 4301 | + /** |
| 4302 | + * |
| 4303 | + * |
| 4304 | + * @param body (required) |
| 4305 | + * @return ListTargetsForPolicyResponse |
| 4306 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 4307 | + */ |
| 4308 | + public ListTargetsForPolicyResponse listTargetsForPolicy(ListTargetsForPolicyRequest body) throws ApiException { |
| 4309 | + ApiResponse<ListTargetsForPolicyResponse> resp = listTargetsForPolicyWithHttpInfo(body); |
| 4310 | + return resp.getData(); |
| 4311 | + } |
| 4312 | + |
| 4313 | + /** |
| 4314 | + * |
| 4315 | + * |
| 4316 | + * @param body (required) |
| 4317 | + * @return ApiResponse<ListTargetsForPolicyResponse> |
| 4318 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 4319 | + */ |
| 4320 | + public ApiResponse<ListTargetsForPolicyResponse> listTargetsForPolicyWithHttpInfo( @NotNull ListTargetsForPolicyRequest body) throws ApiException { |
| 4321 | + com.squareup.okhttp.Call call = listTargetsForPolicyValidateBeforeCall(body, null, null); |
| 4322 | + Type localVarReturnType = new TypeToken<ListTargetsForPolicyResponse>(){}.getType(); |
| 4323 | + return apiClient.execute(call, localVarReturnType); |
| 4324 | + } |
| 4325 | + |
| 4326 | + /** |
| 4327 | + * (asynchronously) |
| 4328 | + * |
| 4329 | + * @param body (required) |
| 4330 | + * @param callback The callback to be executed when the API call finishes |
| 4331 | + * @return The request call |
| 4332 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 4333 | + */ |
| 4334 | + public com.squareup.okhttp.Call listTargetsForPolicyAsync(ListTargetsForPolicyRequest body, final ApiCallback<ListTargetsForPolicyResponse> callback) throws ApiException { |
| 4335 | + |
| 4336 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 4337 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 4338 | + |
| 4339 | + if (callback != null) { |
| 4340 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 4341 | + @Override |
| 4342 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 4343 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 4344 | + } |
| 4345 | + }; |
| 4346 | + |
| 4347 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 4348 | + @Override |
| 4349 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 4350 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 4351 | + } |
| 4352 | + }; |
| 4353 | + } |
| 4354 | + |
| 4355 | + com.squareup.okhttp.Call call = listTargetsForPolicyValidateBeforeCall(body, progressListener, progressRequestListener); |
| 4356 | + Type localVarReturnType = new TypeToken<ListTargetsForPolicyResponse>(){}.getType(); |
| 4357 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 4358 | + return call; |
| 4359 | + } |
4108 | 4360 | /** |
4109 | 4361 | * Build call for moveAccount |
4110 | 4362 | * @param body (required) |
|
0 commit comments