forked from aws/aws-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAWSCloudControlApiClient.java
More file actions
1037 lines (927 loc) · 57.5 KB
/
AWSCloudControlApiClient.java
File metadata and controls
1037 lines (927 loc) · 57.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.cloudcontrolapi;
import org.w3c.dom.*;
import java.net.*;
import java.util.*;
import javax.annotation.Generated;
import org.apache.commons.logging.*;
import com.amazonaws.*;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.internal.auth.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.client.AwsSyncClientParams;
import com.amazonaws.client.builder.AdvancedConfig;
import com.amazonaws.services.cloudcontrolapi.AWSCloudControlApiClientBuilder;
import com.amazonaws.services.cloudcontrolapi.waiters.AWSCloudControlApiWaiters;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.cloudcontrolapi.model.*;
import com.amazonaws.services.cloudcontrolapi.model.transform.*;
/**
* Client for accessing CloudControlApi. All service calls made using this client are blocking, and will not return
* until the service call completes.
* <p>
* <p>
* For more information about Amazon Web Services Cloud Control API, see the <a
* href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/what-is-cloudcontrolapi.html">Amazon Web Services
* Cloud Control API User Guide</a>.
* </p>
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSCloudControlApiClient extends AmazonWebServiceClient implements AWSCloudControlApi {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AWSCloudControlApi.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "cloudcontrolapi";
private volatile AWSCloudControlApiWaiters waiters;
/** Client configuration factory providing ClientConfigurations tailored to this client */
protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
private final AdvancedConfig advancedConfig;
private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory(
new JsonClientMetadata()
.withProtocolVersion("1.0")
.withSupportsCbor(false)
.withSupportsIon(false)
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ConcurrentModificationException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.ConcurrentModificationExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("HandlerFailureException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.HandlerFailureExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("HandlerInternalFailureException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.HandlerInternalFailureExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ServiceLimitExceededException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.ServiceLimitExceededExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ServiceInternalErrorException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.ServiceInternalErrorExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("PrivateTypeException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.PrivateTypeExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("RequestTokenNotFoundException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.RequestTokenNotFoundExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ClientTokenConflictException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.ClientTokenConflictExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InvalidRequestException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.InvalidRequestExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("NetworkFailureException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.NetworkFailureExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("AlreadyExistsException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.AlreadyExistsExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ConcurrentOperationException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.ConcurrentOperationExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("UnsupportedActionException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.UnsupportedActionExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("NotStabilizedException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.NotStabilizedExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ResourceConflictException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.ResourceConflictExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InvalidCredentialsException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.InvalidCredentialsExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("GeneralServiceException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.GeneralServiceExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("TypeNotFoundException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.TypeNotFoundExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ThrottlingException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.ThrottlingExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("NotUpdatableException").withExceptionUnmarshaller(
com.amazonaws.services.cloudcontrolapi.model.transform.NotUpdatableExceptionUnmarshaller.getInstance()))
.withBaseServiceExceptionClass(com.amazonaws.services.cloudcontrolapi.model.AWSCloudControlApiException.class));
public static AWSCloudControlApiClientBuilder builder() {
return AWSCloudControlApiClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on CloudControlApi using the specified parameters.
*
* <p>
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AWSCloudControlApiClient(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on CloudControlApi using the specified parameters.
*
* <p>
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AWSCloudControlApiClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) {
super(clientParams);
this.awsCredentialsProvider = clientParams.getCredentialsProvider();
this.advancedConfig = clientParams.getAdvancedConfig();
init();
}
private void init() {
setServiceNameIntern(DEFAULT_SIGNING_NAME);
setEndpointPrefix(ENDPOINT_PREFIX);
// calling this.setEndPoint(...) will also modify the signer accordingly
setEndpoint("cloudcontrolapi.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/cloudcontrolapi/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/cloudcontrolapi/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
* <p>
* Cancels the specified resource operation request. For more information, see <a href=
* "https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-cancel"
* >Canceling resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.
* </p>
* <p>
* Only resource operations requests with a status of <code>PENDING</code> or <code>IN_PROGRESS</code> can be
* canceled.
* </p>
*
* @param cancelResourceRequestRequest
* @return Result of the CancelResourceRequest operation returned by the service.
* @throws ConcurrentModificationException
* The resource is currently being modified by another operation.
* @throws RequestTokenNotFoundException
* A resource operation with the specified request token can't be found.
* @sample AWSCloudControlApi.CancelResourceRequest
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudcontrol-2021-09-30/CancelResourceRequest"
* target="_top">AWS API Documentation</a>
*/
@Override
public CancelResourceRequestResult cancelResourceRequest(CancelResourceRequestRequest request) {
request = beforeClientExecution(request);
return executeCancelResourceRequest(request);
}
@SdkInternalApi
final CancelResourceRequestResult executeCancelResourceRequest(CancelResourceRequestRequest cancelResourceRequestRequest) {
ExecutionContext executionContext = createExecutionContext(cancelResourceRequestRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<CancelResourceRequestRequest> request = null;
Response<CancelResourceRequestResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelResourceRequestRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(cancelResourceRequestRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudControl");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelResourceRequest");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<CancelResourceRequestResult>> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new CancelResourceRequestResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Creates the specified resource. For more information, see <a
* href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-create.html">Creating a
* resource</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.
* </p>
* <p>
* After you have initiated a resource creation request, you can monitor the progress of your request by calling <a
* href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">
* GetResourceRequestStatus</a> using the <code>RequestToken</code> of the <code>ProgressEvent</code> type returned
* by <code>CreateResource</code>.
* </p>
*
* @param createResourceRequest
* @return Result of the CreateResource operation returned by the service.
* @throws AlreadyExistsException
* The resource with the name requested already exists.
* @throws HandlerInternalFailureException
* The resource handler has returned that an unexpected error occurred within the resource handler.
* @throws GeneralServiceException
* The resource handler has returned that the downstream service generated an error that doesn't map to any
* other handler error code.
* @throws NotUpdatableException
* One or more properties included in this resource operation are defined as create-only, and therefore
* can't be updated.
* @throws TypeNotFoundException
* The specified extension doesn't exist in the CloudFormation registry.
* @throws ConcurrentOperationException
* Another resource operation is currently being performed on this resource.
* @throws InvalidRequestException
* The resource handler has returned that invalid input from the user has generated a generic exception.
* @throws PrivateTypeException
* Cloud Control API hasn't received a valid response from the resource handler, due to a configuration
* error. This includes issues such as the resource handler returning an invalid response, or timing out.
* @throws ResourceNotFoundException
* A resource with the specified identifier can't be found.
* @throws NetworkFailureException
* The resource handler has returned that the request couldn't be completed due to networking issues, such
* as a failure to receive a response from the server.
* @throws UnsupportedActionException
* The specified resource doesn't support this resource operation.
* @throws NotStabilizedException
* The resource handler has returned that the downstream resource failed to complete all of its ready-state
* checks.
* @throws ServiceInternalErrorException
* The resource handler has returned that the downstream service returned an internal error, typically with
* a <code>5XX HTTP</code> status code.
* @throws HandlerFailureException
* The resource handler has failed without a returning a more specific error code. This can include
* timeouts.
* @throws ServiceLimitExceededException
* The resource handler has returned that a non-transient resource limit was reached on the service side.
* @throws InvalidCredentialsException
* The resource handler has returned that the credentials provided by the user are invalid.
* @throws ResourceConflictException
* The resource is temporarily unavailable to be acted upon. For example, if the resource is currently
* undergoing an operation and can't be acted upon until that operation is finished.
* @throws ClientTokenConflictException
* The specified client token has already been used in another resource request.</p>
* <p>
* It's best practice for client tokens to be unique for each resource operation request. However, client
* token expire after 36 hours.
* @throws ThrottlingException
* The request was denied due to request throttling.
* @sample AWSCloudControlApi.CreateResource
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudcontrol-2021-09-30/CreateResource" target="_top">AWS
* API Documentation</a>
*/
@Override
public CreateResourceResult createResource(CreateResourceRequest request) {
request = beforeClientExecution(request);
return executeCreateResource(request);
}
@SdkInternalApi
final CreateResourceResult executeCreateResource(CreateResourceRequest createResourceRequest) {
ExecutionContext executionContext = createExecutionContext(createResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<CreateResourceRequest> request = null;
Response<CreateResourceResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudControl");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<CreateResourceResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Deletes the specified resource. For details, see <a
* href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-delete.html">Deleting a
* resource</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.
* </p>
* <p>
* After you have initiated a resource deletion request, you can monitor the progress of your request by calling <a
* href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">
* GetResourceRequestStatus</a> using the <code>RequestToken</code> of the <code>ProgressEvent</code> returned by
* <code>DeleteResource</code>.
* </p>
*
* @param deleteResourceRequest
* @return Result of the DeleteResource operation returned by the service.
* @throws AlreadyExistsException
* The resource with the name requested already exists.
* @throws HandlerInternalFailureException
* The resource handler has returned that an unexpected error occurred within the resource handler.
* @throws GeneralServiceException
* The resource handler has returned that the downstream service generated an error that doesn't map to any
* other handler error code.
* @throws NotUpdatableException
* One or more properties included in this resource operation are defined as create-only, and therefore
* can't be updated.
* @throws TypeNotFoundException
* The specified extension doesn't exist in the CloudFormation registry.
* @throws ConcurrentOperationException
* Another resource operation is currently being performed on this resource.
* @throws InvalidRequestException
* The resource handler has returned that invalid input from the user has generated a generic exception.
* @throws PrivateTypeException
* Cloud Control API hasn't received a valid response from the resource handler, due to a configuration
* error. This includes issues such as the resource handler returning an invalid response, or timing out.
* @throws ResourceNotFoundException
* A resource with the specified identifier can't be found.
* @throws NetworkFailureException
* The resource handler has returned that the request couldn't be completed due to networking issues, such
* as a failure to receive a response from the server.
* @throws UnsupportedActionException
* The specified resource doesn't support this resource operation.
* @throws NotStabilizedException
* The resource handler has returned that the downstream resource failed to complete all of its ready-state
* checks.
* @throws ServiceInternalErrorException
* The resource handler has returned that the downstream service returned an internal error, typically with
* a <code>5XX HTTP</code> status code.
* @throws HandlerFailureException
* The resource handler has failed without a returning a more specific error code. This can include
* timeouts.
* @throws ServiceLimitExceededException
* The resource handler has returned that a non-transient resource limit was reached on the service side.
* @throws InvalidCredentialsException
* The resource handler has returned that the credentials provided by the user are invalid.
* @throws ResourceConflictException
* The resource is temporarily unavailable to be acted upon. For example, if the resource is currently
* undergoing an operation and can't be acted upon until that operation is finished.
* @throws ClientTokenConflictException
* The specified client token has already been used in another resource request.</p>
* <p>
* It's best practice for client tokens to be unique for each resource operation request. However, client
* token expire after 36 hours.
* @throws ThrottlingException
* The request was denied due to request throttling.
* @sample AWSCloudControlApi.DeleteResource
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudcontrol-2021-09-30/DeleteResource" target="_top">AWS
* API Documentation</a>
*/
@Override
public DeleteResourceResult deleteResource(DeleteResourceRequest request) {
request = beforeClientExecution(request);
return executeDeleteResource(request);
}
@SdkInternalApi
final DeleteResourceResult executeDeleteResource(DeleteResourceRequest deleteResourceRequest) {
ExecutionContext executionContext = createExecutionContext(deleteResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<DeleteResourceRequest> request = null;
Response<DeleteResourceResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudControl");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<DeleteResourceResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Returns information about the current state of the specified resource. For details, see <a
* href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-read.html">Reading a
* resource's current state</a>.
* </p>
* <p>
* You can use this action to return information about an existing resource in your account and Amazon Web Services
* Region, whether those resources were provisioned using Cloud Control API.
* </p>
*
* @param getResourceRequest
* @return Result of the GetResource operation returned by the service.
* @throws AlreadyExistsException
* The resource with the name requested already exists.
* @throws HandlerInternalFailureException
* The resource handler has returned that an unexpected error occurred within the resource handler.
* @throws GeneralServiceException
* The resource handler has returned that the downstream service generated an error that doesn't map to any
* other handler error code.
* @throws NotUpdatableException
* One or more properties included in this resource operation are defined as create-only, and therefore
* can't be updated.
* @throws TypeNotFoundException
* The specified extension doesn't exist in the CloudFormation registry.
* @throws InvalidRequestException
* The resource handler has returned that invalid input from the user has generated a generic exception.
* @throws PrivateTypeException
* Cloud Control API hasn't received a valid response from the resource handler, due to a configuration
* error. This includes issues such as the resource handler returning an invalid response, or timing out.
* @throws ResourceNotFoundException
* A resource with the specified identifier can't be found.
* @throws NetworkFailureException
* The resource handler has returned that the request couldn't be completed due to networking issues, such
* as a failure to receive a response from the server.
* @throws UnsupportedActionException
* The specified resource doesn't support this resource operation.
* @throws NotStabilizedException
* The resource handler has returned that the downstream resource failed to complete all of its ready-state
* checks.
* @throws ServiceInternalErrorException
* The resource handler has returned that the downstream service returned an internal error, typically with
* a <code>5XX HTTP</code> status code.
* @throws HandlerFailureException
* The resource handler has failed without a returning a more specific error code. This can include
* timeouts.
* @throws ServiceLimitExceededException
* The resource handler has returned that a non-transient resource limit was reached on the service side.
* @throws InvalidCredentialsException
* The resource handler has returned that the credentials provided by the user are invalid.
* @throws ResourceConflictException
* The resource is temporarily unavailable to be acted upon. For example, if the resource is currently
* undergoing an operation and can't be acted upon until that operation is finished.
* @throws ThrottlingException
* The request was denied due to request throttling.
* @sample AWSCloudControlApi.GetResource
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudcontrol-2021-09-30/GetResource" target="_top">AWS API
* Documentation</a>
*/
@Override
public GetResourceResult getResource(GetResourceRequest request) {
request = beforeClientExecution(request);
return executeGetResource(request);
}
@SdkInternalApi
final GetResourceResult executeGetResource(GetResourceRequest getResourceRequest) {
ExecutionContext executionContext = createExecutionContext(getResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<GetResourceRequest> request = null;
Response<GetResourceResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudControl");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<GetResourceResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Returns the current status of a resource operation request. For more information, see <a href=
* "https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-track"
* >Tracking the progress of resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User
* Guide</i>.
* </p>
*
* @param getResourceRequestStatusRequest
* @return Result of the GetResourceRequestStatus operation returned by the service.
* @throws RequestTokenNotFoundException
* A resource operation with the specified request token can't be found.
* @sample AWSCloudControlApi.GetResourceRequestStatus
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudcontrol-2021-09-30/GetResourceRequestStatus"
* target="_top">AWS API Documentation</a>
*/
@Override
public GetResourceRequestStatusResult getResourceRequestStatus(GetResourceRequestStatusRequest request) {
request = beforeClientExecution(request);
return executeGetResourceRequestStatus(request);
}
@SdkInternalApi
final GetResourceRequestStatusResult executeGetResourceRequestStatus(GetResourceRequestStatusRequest getResourceRequestStatusRequest) {
ExecutionContext executionContext = createExecutionContext(getResourceRequestStatusRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<GetResourceRequestStatusRequest> request = null;
Response<GetResourceRequestStatusResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetResourceRequestStatusRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(getResourceRequestStatusRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudControl");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetResourceRequestStatus");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<GetResourceRequestStatusResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new GetResourceRequestStatusResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Returns existing resource operation requests. This includes requests of all status types. For more information,
* see <a href=
* "https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html#resource-operations-manage-requests-list"
* >Listing active resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.
* </p>
* <note>
* <p>
* Resource operation requests expire after 7 days.
* </p>
* </note>
*
* @param listResourceRequestsRequest
* @return Result of the ListResourceRequests operation returned by the service.
* @sample AWSCloudControlApi.ListResourceRequests
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudcontrol-2021-09-30/ListResourceRequests"
* target="_top">AWS API Documentation</a>
*/
@Override
public ListResourceRequestsResult listResourceRequests(ListResourceRequestsRequest request) {
request = beforeClientExecution(request);
return executeListResourceRequests(request);
}
@SdkInternalApi
final ListResourceRequestsResult executeListResourceRequests(ListResourceRequestsRequest listResourceRequestsRequest) {
ExecutionContext executionContext = createExecutionContext(listResourceRequestsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<ListResourceRequestsRequest> request = null;
Response<ListResourceRequestsResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListResourceRequestsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listResourceRequestsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudControl");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListResourceRequests");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<ListResourceRequestsResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListResourceRequestsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Returns information about the specified resources. For more information, see <a
* href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-list.html">Discovering
* resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.
* </p>
* <p>
* You can use this action to return information about existing resources in your account and Amazon Web Services
* Region, whether those resources were provisioned using Cloud Control API.
* </p>
*
* @param listResourcesRequest
* @return Result of the ListResources operation returned by the service.
* @throws AlreadyExistsException
* The resource with the name requested already exists.
* @throws HandlerInternalFailureException
* The resource handler has returned that an unexpected error occurred within the resource handler.
* @throws GeneralServiceException
* The resource handler has returned that the downstream service generated an error that doesn't map to any
* other handler error code.
* @throws NotUpdatableException
* One or more properties included in this resource operation are defined as create-only, and therefore
* can't be updated.
* @throws TypeNotFoundException
* The specified extension doesn't exist in the CloudFormation registry.
* @throws InvalidRequestException
* The resource handler has returned that invalid input from the user has generated a generic exception.
* @throws PrivateTypeException
* Cloud Control API hasn't received a valid response from the resource handler, due to a configuration
* error. This includes issues such as the resource handler returning an invalid response, or timing out.
* @throws ResourceNotFoundException
* A resource with the specified identifier can't be found.
* @throws NetworkFailureException
* The resource handler has returned that the request couldn't be completed due to networking issues, such
* as a failure to receive a response from the server.
* @throws UnsupportedActionException
* The specified resource doesn't support this resource operation.
* @throws NotStabilizedException
* The resource handler has returned that the downstream resource failed to complete all of its ready-state
* checks.
* @throws ServiceInternalErrorException
* The resource handler has returned that the downstream service returned an internal error, typically with
* a <code>5XX HTTP</code> status code.
* @throws HandlerFailureException
* The resource handler has failed without a returning a more specific error code. This can include
* timeouts.
* @throws ServiceLimitExceededException
* The resource handler has returned that a non-transient resource limit was reached on the service side.
* @throws InvalidCredentialsException
* The resource handler has returned that the credentials provided by the user are invalid.
* @throws ResourceConflictException
* The resource is temporarily unavailable to be acted upon. For example, if the resource is currently
* undergoing an operation and can't be acted upon until that operation is finished.
* @throws ThrottlingException
* The request was denied due to request throttling.
* @sample AWSCloudControlApi.ListResources
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudcontrol-2021-09-30/ListResources" target="_top">AWS API
* Documentation</a>
*/
@Override
public ListResourcesResult listResources(ListResourcesRequest request) {
request = beforeClientExecution(request);
return executeListResources(request);
}
@SdkInternalApi
final ListResourcesResult executeListResources(ListResourcesRequest listResourcesRequest) {
ExecutionContext executionContext = createExecutionContext(listResourcesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<ListResourcesRequest> request = null;
Response<ListResourcesResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListResourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listResourcesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudControl");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListResources");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<ListResourcesResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListResourcesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* <p>
* Updates the specified property values in the resource.
* </p>
* <p>
* You specify your resource property updates as a list of patch operations contained in a JSON patch document that
* adheres to the <a href="https://datatracker.ietf.org/doc/html/rfc6902"> <i>RFC 6902 - JavaScript Object Notation
* (JSON) Patch</i> </a> standard.
* </p>
* <p>
* For details on how Cloud Control API performs resource update operations, see <a
* href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-update.html">Updating a
* resource</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.
* </p>
* <p>
* After you have initiated a resource update request, you can monitor the progress of your request by calling <a
* href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">
* GetResourceRequestStatus</a> using the <code>RequestToken</code> of the <code>ProgressEvent</code> returned by
* <code>UpdateResource</code>.
* </p>
* <p>
* For more information about the properties of a specific resource, refer to the related topic for the resource in
* the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">
* Resource and property types reference</a> in the <i>CloudFormation Users Guide</i>.
* </p>
*
* @param updateResourceRequest
* @return Result of the UpdateResource operation returned by the service.
* @throws AlreadyExistsException
* The resource with the name requested already exists.
* @throws HandlerInternalFailureException
* The resource handler has returned that an unexpected error occurred within the resource handler.
* @throws GeneralServiceException
* The resource handler has returned that the downstream service generated an error that doesn't map to any
* other handler error code.
* @throws NotUpdatableException
* One or more properties included in this resource operation are defined as create-only, and therefore
* can't be updated.
* @throws TypeNotFoundException
* The specified extension doesn't exist in the CloudFormation registry.
* @throws ConcurrentOperationException
* Another resource operation is currently being performed on this resource.
* @throws InvalidRequestException
* The resource handler has returned that invalid input from the user has generated a generic exception.
* @throws PrivateTypeException
* Cloud Control API hasn't received a valid response from the resource handler, due to a configuration
* error. This includes issues such as the resource handler returning an invalid response, or timing out.
* @throws ResourceNotFoundException
* A resource with the specified identifier can't be found.
* @throws NetworkFailureException
* The resource handler has returned that the request couldn't be completed due to networking issues, such
* as a failure to receive a response from the server.
* @throws UnsupportedActionException
* The specified resource doesn't support this resource operation.
* @throws NotStabilizedException
* The resource handler has returned that the downstream resource failed to complete all of its ready-state
* checks.
* @throws ServiceInternalErrorException
* The resource handler has returned that the downstream service returned an internal error, typically with
* a <code>5XX HTTP</code> status code.
* @throws HandlerFailureException
* The resource handler has failed without a returning a more specific error code. This can include
* timeouts.
* @throws ServiceLimitExceededException
* The resource handler has returned that a non-transient resource limit was reached on the service side.
* @throws InvalidCredentialsException
* The resource handler has returned that the credentials provided by the user are invalid.
* @throws ResourceConflictException
* The resource is temporarily unavailable to be acted upon. For example, if the resource is currently
* undergoing an operation and can't be acted upon until that operation is finished.
* @throws ClientTokenConflictException
* The specified client token has already been used in another resource request.</p>
* <p>
* It's best practice for client tokens to be unique for each resource operation request. However, client
* token expire after 36 hours.
* @throws ThrottlingException
* The request was denied due to request throttling.
* @sample AWSCloudControlApi.UpdateResource
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudcontrol-2021-09-30/UpdateResource" target="_top">AWS
* API Documentation</a>
*/
@Override
public UpdateResourceResult updateResource(UpdateResourceRequest request) {
request = beforeClientExecution(request);
return executeUpdateResource(request);
}
@SdkInternalApi
final UpdateResourceResult executeUpdateResource(UpdateResourceRequest updateResourceRequest) {
ExecutionContext executionContext = createExecutionContext(updateResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<UpdateResourceRequest> request = null;
Response<UpdateResourceResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudControl");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler<AmazonWebServiceResponse<UpdateResourceResult>> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Returns additional metadata for a previously executed successful, request, typically used for debugging issues
* where a service isn't acting as expected. This data isn't considered part of the result data returned by an
* operation, so it's available through this separate, diagnostic interface.
* <p>
* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic
* information for an executed request, you should use this method to retrieve it as soon as possible after
* executing the request.
*
* @param request
* The originally executed request
*
* @return The response metadata for the specified request, or null if none is available.
*/
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
return client.getResponseMetadataForRequest(request);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
ExecutionContext executionContext) {
return invoke(request, responseHandler, executionContext, null, null);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {
executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));
return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);
}
/**
* Invoke with no authentication. Credentials are not required and any credentials set on the client or request will
* be ignored for this operation.
**/
private <X, Y extends AmazonWebServiceRequest> Response<X> anonymousInvoke(Request<Y> request,
HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext) {
return doInvoke(request, responseHandler, executionContext, null, null);
}
/**
* Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
* ExecutionContext beforehand.
**/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
if (discoveredEndpoint != null) {
request.setEndpoint(discoveredEndpoint);
request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
} else if (uriFromEndpointTrait != null) {
request.setEndpoint(uriFromEndpointTrait);