1 /*
2  * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5  * the License. A copy of the License is located at
6  * 
7  * http://aws.amazon.com/apache2.0
8  * 
9  * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10  * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11  * and limitations under the License.
12  */

13 package com.amazonaws.services.cloudformation;
14
15 import org.w3c.dom.*;
16
17 import java.net.*;
18 import java.util.*;
19
20 import javax.annotation.Generated;
21
22 import org.apache.commons.logging.*;
23
24 import com.amazonaws.*;
25 import com.amazonaws.annotation.SdkInternalApi;
26 import com.amazonaws.auth.*;
27
28 import com.amazonaws.handlers.*;
29 import com.amazonaws.http.*;
30 import com.amazonaws.internal.*;
31 import com.amazonaws.internal.auth.*;
32 import com.amazonaws.metrics.*;
33 import com.amazonaws.regions.*;
34 import com.amazonaws.transform.*;
35 import com.amazonaws.util.*;
36 import com.amazonaws.protocol.json.*;
37 import com.amazonaws.util.AWSRequestMetrics.Field;
38 import com.amazonaws.annotation.ThreadSafe;
39 import com.amazonaws.client.AwsSyncClientParams;
40 import com.amazonaws.client.builder.AdvancedConfig;
41
42 import com.amazonaws.services.cloudformation.AmazonCloudFormationClientBuilder;
43 import com.amazonaws.services.cloudformation.waiters.AmazonCloudFormationWaiters;
44
45 import com.amazonaws.AmazonServiceException;
46
47 import com.amazonaws.services.cloudformation.model.*;
48 import com.amazonaws.services.cloudformation.model.transform.*;
49
50 /**
51  * Client for accessing AWS CloudFormation. All service calls made using this client are blocking, and will not return
52  * until the service call completes.
53  * <p>
54  * <fullname>AWS CloudFormation</fullname>
55  * <p>
56  * AWS CloudFormation allows you to create and manage AWS infrastructure deployments predictably and repeatedly. You can
57  * use AWS CloudFormation to leverage AWS products, such as Amazon Elastic Compute Cloud, Amazon Elastic Block Store,
58  * Amazon Simple Notification Service, Elastic Load Balancing, and Auto Scaling to build highly-reliable, highly
59  * scalable, cost-effective applications without creating or configuring the underlying AWS infrastructure.
60  * </p>
61  * <p>
62  * With AWS CloudFormation, you declare all of your resources and dependencies in a template file. The template defines
63  * a collection of resources as a single unit called a stack. AWS CloudFormation creates and deletes all member
64  * resources of the stack together and manages all dependencies between the resources for you.
65  * </p>
66  * <p>
67  * For more information about AWS CloudFormation, see the <a href="http://aws.amazon.com/cloudformation/">AWS
68  * CloudFormation Product Page</a>.
69  * </p>
70  * <p>
71  * Amazon CloudFormation makes use of other AWS products. If you need additional technical information about a specific
72  * AWS product, you can find the product's technical documentation at <a
73  * href="https://docs.aws.amazon.com/">docs.aws.amazon.com</a>.
74  * </p>
75  */

76 @ThreadSafe
77 @Generated("com.amazonaws:aws-java-sdk-code-generator")
78 public class AmazonCloudFormationClient extends AmazonWebServiceClient implements AmazonCloudFormation {
79
80     /** Provider for AWS credentials. */
81     private final AWSCredentialsProvider awsCredentialsProvider;
82
83     private static final Log log = LogFactory.getLog(AmazonCloudFormation.class);
84
85     /** Default signing name for the service. */
86     private static final String DEFAULT_SIGNING_NAME = "cloudformation";
87
88     private volatile AmazonCloudFormationWaiters waiters;
89
90     /** Client configuration factory providing ClientConfigurations tailored to this client */
91     protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
92
93     private final AdvancedConfig advancedConfig;
94
95     /**
96      * List of exception unmarshallers for all modeled exceptions
97      */

98     protected final List<Unmarshaller<AmazonServiceException, Node>> exceptionUnmarshallers = new ArrayList<Unmarshaller<AmazonServiceException, Node>>();
99
100     /**
101      * Constructs a new client to invoke service methods on AWS CloudFormation. A credentials provider chain will be
102      * used that searches for credentials in this order:
103      * <ul>
104      * <li>Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY</li>
105      * <li>Java System Properties - aws.accessKeyId and aws.secretKey</li>
106      * <li>Instance profile credentials delivered through the Amazon EC2 metadata service</li>
107      * </ul>
108      *
109      * <p>
110      * All service calls made using this new client object are blocking, and will not return until the service call
111      * completes.
112      *
113      * @see DefaultAWSCredentialsProviderChain
114      * @deprecated use {@link AmazonCloudFormationClientBuilder#defaultClient()}
115      */

116     @Deprecated
117     public AmazonCloudFormationClient() {
118         this(DefaultAWSCredentialsProviderChain.getInstance(), configFactory.getConfig());
119     }
120
121     /**
122      * Constructs a new client to invoke service methods on AWS CloudFormation. A credentials provider chain will be
123      * used that searches for credentials in this order:
124      * <ul>
125      * <li>Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY</li>
126      * <li>Java System Properties - aws.accessKeyId and aws.secretKey</li>
127      * <li>Instance profile credentials delivered through the Amazon EC2 metadata service</li>
128      * </ul>
129      *
130      * <p>
131      * All service calls made using this new client object are blocking, and will not return until the service call
132      * completes.
133      *
134      * @param clientConfiguration
135      *        The client configuration options controlling how this client connects to AWS CloudFormation (ex: proxy
136      *        settings, retry counts, etc.).
137      *
138      * @see DefaultAWSCredentialsProviderChain
139      * @deprecated use {@link AmazonCloudFormationClientBuilder#withClientConfiguration(ClientConfiguration)}
140      */

141     @Deprecated
142     public AmazonCloudFormationClient(ClientConfiguration clientConfiguration) {
143         this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration);
144     }
145
146     /**
147      * Constructs a new client to invoke service methods on AWS CloudFormation using the specified AWS account
148      * credentials.
149      *
150      * <p>
151      * All service calls made using this new client object are blocking, and will not return until the service call
152      * completes.
153      *
154      * @param awsCredentials
155      *        The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
156      * @deprecated use {@link AmazonCloudFormationClientBuilder#withCredentials(AWSCredentialsProvider)} for example:
157      *             {@code AmazonCloudFormationClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();}
158      */

159     @Deprecated
160     public AmazonCloudFormationClient(AWSCredentials awsCredentials) {
161         this(awsCredentials, configFactory.getConfig());
162     }
163
164     /**
165      * Constructs a new client to invoke service methods on AWS CloudFormation using the specified AWS account
166      * credentials and client configuration options.
167      *
168      * <p>
169      * All service calls made using this new client object are blocking, and will not return until the service call
170      * completes.
171      *
172      * @param awsCredentials
173      *        The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
174      * @param clientConfiguration
175      *        The client configuration options controlling how this client connects to AWS CloudFormation (ex: proxy
176      *        settings, retry counts, etc.).
177      * @deprecated use {@link AmazonCloudFormationClientBuilder#withCredentials(AWSCredentialsProvider)} and
178      *             {@link AmazonCloudFormationClientBuilder#withClientConfiguration(ClientConfiguration)}
179      */

180     @Deprecated
181     public AmazonCloudFormationClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) {
182         super(clientConfiguration);
183         this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials);
184         this.advancedConfig = AdvancedConfig.EMPTY;
185         init();
186     }
187
188     /**
189      * Constructs a new client to invoke service methods on AWS CloudFormation using the specified AWS account
190      * credentials provider.
191      *
192      * <p>
193      * All service calls made using this new client object are blocking, and will not return until the service call
194      * completes.
195      *
196      * @param awsCredentialsProvider
197      *        The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
198      * @deprecated use {@link AmazonCloudFormationClientBuilder#withCredentials(AWSCredentialsProvider)}
199      */

200     @Deprecated
201     public AmazonCloudFormationClient(AWSCredentialsProvider awsCredentialsProvider) {
202         this(awsCredentialsProvider, configFactory.getConfig());
203     }
204
205     /**
206      * Constructs a new client to invoke service methods on AWS CloudFormation using the specified AWS account
207      * credentials provider and client configuration options.
208      *
209      * <p>
210      * All service calls made using this new client object are blocking, and will not return until the service call
211      * completes.
212      *
213      * @param awsCredentialsProvider
214      *        The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
215      * @param clientConfiguration
216      *        The client configuration options controlling how this client connects to AWS CloudFormation (ex: proxy
217      *        settings, retry counts, etc.).
218      * @deprecated use {@link AmazonCloudFormationClientBuilder#withCredentials(AWSCredentialsProvider)} and
219      *             {@link AmazonCloudFormationClientBuilder#withClientConfiguration(ClientConfiguration)}
220      */

221     @Deprecated
222     public AmazonCloudFormationClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {
223         this(awsCredentialsProvider, clientConfiguration, null);
224     }
225
226     /**
227      * Constructs a new client to invoke service methods on AWS CloudFormation using the specified AWS account
228      * credentials provider, client configuration options, and request metric collector.
229      *
230      * <p>
231      * All service calls made using this new client object are blocking, and will not return until the service call
232      * completes.
233      *
234      * @param awsCredentialsProvider
235      *        The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
236      * @param clientConfiguration
237      *        The client configuration options controlling how this client connects to AWS CloudFormation (ex: proxy
238      *        settings, retry counts, etc.).
239      * @param requestMetricCollector
240      *        optional request metric collector
241      * @deprecated use {@link AmazonCloudFormationClientBuilder#withCredentials(AWSCredentialsProvider)} and
242      *             {@link AmazonCloudFormationClientBuilder#withClientConfiguration(ClientConfiguration)} and
243      *             {@link AmazonCloudFormationClientBuilder#withMetricsCollector(RequestMetricCollector)}
244      */

245     @Deprecated
246     public AmazonCloudFormationClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration,
247             RequestMetricCollector requestMetricCollector) {
248         super(clientConfiguration, requestMetricCollector);
249         this.awsCredentialsProvider = awsCredentialsProvider;
250         this.advancedConfig = AdvancedConfig.EMPTY;
251         init();
252     }
253
254     public static AmazonCloudFormationClientBuilder builder() {
255         return AmazonCloudFormationClientBuilder.standard();
256     }
257
258     /**
259      * Constructs a new client to invoke service methods on AWS CloudFormation using the specified parameters.
260      *
261      * <p>
262      * All service calls made using this new client object are blocking, and will not return until the service call
263      * completes.
264      *
265      * @param clientParams
266      *        Object providing client parameters.
267      */

268     AmazonCloudFormationClient(AwsSyncClientParams clientParams) {
269         this(clientParams, false);
270     }
271
272     /**
273      * Constructs a new client to invoke service methods on AWS CloudFormation using the specified parameters.
274      *
275      * <p>
276      * All service calls made using this new client object are blocking, and will not return until the service call
277      * completes.
278      *
279      * @param clientParams
280      *        Object providing client parameters.
281      */

282     AmazonCloudFormationClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) {
283         super(clientParams);
284         this.awsCredentialsProvider = clientParams.getCredentialsProvider();
285         this.advancedConfig = clientParams.getAdvancedConfig();
286         init();
287     }
288
289     private void init() {
290         exceptionUnmarshallers.add(new InvalidOperationExceptionUnmarshaller());
291         exceptionUnmarshallers.add(new TokenAlreadyExistsExceptionUnmarshaller());
292         exceptionUnmarshallers.add(new OperationStatusCheckFailedExceptionUnmarshaller());
293         exceptionUnmarshallers.add(new NameAlreadyExistsExceptionUnmarshaller());
294         exceptionUnmarshallers.add(new LimitExceededExceptionUnmarshaller());
295         exceptionUnmarshallers.add(new OperationNotFoundExceptionUnmarshaller());
296         exceptionUnmarshallers.add(new StackSetNotFoundExceptionUnmarshaller());
297         exceptionUnmarshallers.add(new InsufficientCapabilitiesExceptionUnmarshaller());
298         exceptionUnmarshallers.add(new AlreadyExistsExceptionUnmarshaller());
299         exceptionUnmarshallers.add(new OperationInProgressExceptionUnmarshaller());
300         exceptionUnmarshallers.add(new StaleRequestExceptionUnmarshaller());
301         exceptionUnmarshallers.add(new InvalidChangeSetStatusExceptionUnmarshaller());
302         exceptionUnmarshallers.add(new StackSetNotEmptyExceptionUnmarshaller());
303         exceptionUnmarshallers.add(new ChangeSetNotFoundExceptionUnmarshaller());
304         exceptionUnmarshallers.add(new StackInstanceNotFoundExceptionUnmarshaller());
305         exceptionUnmarshallers.add(new CFNRegistryExceptionUnmarshaller());
306         exceptionUnmarshallers.add(new InvalidStateTransitionExceptionUnmarshaller());
307         exceptionUnmarshallers.add(new OperationIdAlreadyExistsExceptionUnmarshaller());
308         exceptionUnmarshallers.add(new TypeNotFoundExceptionUnmarshaller());
309         exceptionUnmarshallers.add(new CreatedButModifiedExceptionUnmarshaller());
310         exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.cloudformation.model.AmazonCloudFormationException.class));
311
312         setServiceNameIntern(DEFAULT_SIGNING_NAME);
313         setEndpointPrefix(ENDPOINT_PREFIX);
314         // calling this.setEndPoint(...) will also modify the signer accordingly
315         this.setEndpoint("https://cloudformation.us-east-1.amazonaws.com");
316         HandlerChainFactory chainFactory = new HandlerChainFactory();
317         requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/cloudformation/request.handlers"));
318         requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/cloudformation/request.handler2s"));
319         requestHandler2s.addAll(chainFactory.getGlobalHandlers());
320     }
321
322     /**
323      * <p>
324      * Cancels an update on the specified stack. If the call completes successfully, the stack rolls back the update and
325      * reverts to the previous stack configuration.
326      * </p>
327      * <note>
328      * <p>
329      * You can cancel only stacks that are in the UPDATE_IN_PROGRESS state.
330      * </p>
331      * </note>
332      * 
333      * @param cancelUpdateStackRequest
334      *        The input for the <a>CancelUpdateStack</a> action.
335      * @return Result of the CancelUpdateStack operation returned by the service.
336      * @throws TokenAlreadyExistsException
337      *         A client request token already exists.
338      * @sample AmazonCloudFormation.CancelUpdateStack
339      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CancelUpdateStack"
340      *      target="_top">AWS API Documentation</a>
341      */

342     @Override
343     public CancelUpdateStackResult cancelUpdateStack(CancelUpdateStackRequest request) {
344         request = beforeClientExecution(request);
345         return executeCancelUpdateStack(request);
346     }
347
348     @SdkInternalApi
349     final CancelUpdateStackResult executeCancelUpdateStack(CancelUpdateStackRequest cancelUpdateStackRequest) {
350
351         ExecutionContext executionContext = createExecutionContext(cancelUpdateStackRequest);
352         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
353         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
354         Request<CancelUpdateStackRequest> request = null;
355         Response<CancelUpdateStackResult> response = null;
356
357         try {
358             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
359             try {
360                 request = new CancelUpdateStackRequestMarshaller().marshall(super.beforeMarshalling(cancelUpdateStackRequest));
361                 // Binds the request metrics to the current request.
362                 request.setAWSRequestMetrics(awsRequestMetrics);
363                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
364                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
365                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelUpdateStack");
366                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
367
368             } finally {
369                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
370             }
371
372             StaxResponseHandler<CancelUpdateStackResult> responseHandler = new StaxResponseHandler<CancelUpdateStackResult>(
373                     new CancelUpdateStackResultStaxUnmarshaller());
374             response = invoke(request, responseHandler, executionContext);
375
376             return response.getAwsResponse();
377
378         } finally {
379
380             endClientExecution(awsRequestMetrics, request, response);
381         }
382     }
383
384     /**
385      * <p>
386      * For a specified stack that is in the <code>UPDATE_ROLLBACK_FAILED</code> state, continues rolling it back to the
387      * <code>UPDATE_ROLLBACK_COMPLETE</code> state. Depending on the cause of the failure, you can manually <a href=
388      * "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed"
389      * > fix the error</a> and continue the rollback. By continuing the rollback, you can return your stack to a working
390      * state (the <code>UPDATE_ROLLBACK_COMPLETE</code> state), and then try to update the stack again.
391      * </p>
392      * <p>
393      * A stack goes into the <code>UPDATE_ROLLBACK_FAILED</code> state when AWS CloudFormation cannot roll back all
394      * changes after a failed stack update. For example, you might have a stack that is rolling back to an old database
395      * instance that was deleted outside of AWS CloudFormation. Because AWS CloudFormation doesn't know the database was
396      * deleted, it assumes that the database instance still exists and attempts to roll back to it, causing the update
397      * rollback to fail.
398      * </p>
399      * 
400      * @param continueUpdateRollbackRequest
401      *        The input for the <a>ContinueUpdateRollback</a> action.
402      * @return Result of the ContinueUpdateRollback operation returned by the service.
403      * @throws TokenAlreadyExistsException
404      *         A client request token already exists.
405      * @sample AmazonCloudFormation.ContinueUpdateRollback
406      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ContinueUpdateRollback"
407      *      target="_top">AWS API Documentation</a>
408      */

409     @Override
410     public ContinueUpdateRollbackResult continueUpdateRollback(ContinueUpdateRollbackRequest request) {
411         request = beforeClientExecution(request);
412         return executeContinueUpdateRollback(request);
413     }
414
415     @SdkInternalApi
416     final ContinueUpdateRollbackResult executeContinueUpdateRollback(ContinueUpdateRollbackRequest continueUpdateRollbackRequest) {
417
418         ExecutionContext executionContext = createExecutionContext(continueUpdateRollbackRequest);
419         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
420         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
421         Request<ContinueUpdateRollbackRequest> request = null;
422         Response<ContinueUpdateRollbackResult> response = null;
423
424         try {
425             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
426             try {
427                 request = new ContinueUpdateRollbackRequestMarshaller().marshall(super.beforeMarshalling(continueUpdateRollbackRequest));
428                 // Binds the request metrics to the current request.
429                 request.setAWSRequestMetrics(awsRequestMetrics);
430                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
431                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
432                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ContinueUpdateRollback");
433                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
434
435             } finally {
436                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
437             }
438
439             StaxResponseHandler<ContinueUpdateRollbackResult> responseHandler = new StaxResponseHandler<ContinueUpdateRollbackResult>(
440                     new ContinueUpdateRollbackResultStaxUnmarshaller());
441             response = invoke(request, responseHandler, executionContext);
442
443             return response.getAwsResponse();
444
445         } finally {
446
447             endClientExecution(awsRequestMetrics, request, response);
448         }
449     }
450
451     /**
452      * <p>
453      * Creates a list of changes that will be applied to a stack so that you can review the changes before executing
454      * them. You can create a change set for a stack that doesn't exist or an existing stack. If you create a change set
455      * for a stack that doesn't exist, the change set shows all of the resources that AWS CloudFormation will create. If
456      * you create a change set for an existing stack, AWS CloudFormation compares the stack's information with the
457      * information that you submit in the change set and lists the differences. Use change sets to understand which
458      * resources AWS CloudFormation will create or change, and how it will change resources in an existing stack, before
459      * you create or update a stack.
460      * </p>
461      * <p>
462      * To create a change set for a stack that doesn't exist, for the <code>ChangeSetType</code> parameter, specify
463      * <code>CREATE</code>. To create a change set for an existing stack, specify <code>UPDATE</code> for the
464      * <code>ChangeSetType</code> parameter. To create a change set for an import operation, specify <code>IMPORT</code>
465      * for the <code>ChangeSetType</code> parameter. After the <code>CreateChangeSet</code> call successfully completes,
466      * AWS CloudFormation starts creating the change set. To check the status of the change set or to review it, use the
467      * <a>DescribeChangeSet</a> action.
468      * </p>
469      * <p>
470      * When you are satisfied with the changes the change set will make, execute the change set by using the
471      * <a>ExecuteChangeSet</a> action. AWS CloudFormation doesn't make changes until you execute the change set.
472      * </p>
473      * 
474      * @param createChangeSetRequest
475      *        The input for the <a>CreateChangeSet</a> action.
476      * @return Result of the CreateChangeSet operation returned by the service.
477      * @throws AlreadyExistsException
478      *         The resource with the name requested already exists.
479      * @throws InsufficientCapabilitiesException
480      *         The template contains resources with capabilities that weren't specified in the Capabilities parameter.
481      * @throws LimitExceededException
482      *         The quota for the resource has already been reached.</p>
483      *         <p>
484      *         For information on resource and stack limitations, see <a
485      *         href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html"
486      *         >Limits</a> in the <i>AWS CloudFormation User Guide</i>.
487      * @sample AmazonCloudFormation.CreateChangeSet
488      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet" target="_top">AWS
489      *      API Documentation</a>
490      */

491     @Override
492     public CreateChangeSetResult createChangeSet(CreateChangeSetRequest request) {
493         request = beforeClientExecution(request);
494         return executeCreateChangeSet(request);
495     }
496
497     @SdkInternalApi
498     final CreateChangeSetResult executeCreateChangeSet(CreateChangeSetRequest createChangeSetRequest) {
499
500         ExecutionContext executionContext = createExecutionContext(createChangeSetRequest);
501         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
502         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
503         Request<CreateChangeSetRequest> request = null;
504         Response<CreateChangeSetResult> response = null;
505
506         try {
507             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
508             try {
509                 request = new CreateChangeSetRequestMarshaller().marshall(super.beforeMarshalling(createChangeSetRequest));
510                 // Binds the request metrics to the current request.
511                 request.setAWSRequestMetrics(awsRequestMetrics);
512                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
513                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
514                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateChangeSet");
515                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
516
517             } finally {
518                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
519             }
520
521             StaxResponseHandler<CreateChangeSetResult> responseHandler = new StaxResponseHandler<CreateChangeSetResult>(
522                     new CreateChangeSetResultStaxUnmarshaller());
523             response = invoke(request, responseHandler, executionContext);
524
525             return response.getAwsResponse();
526
527         } finally {
528
529             endClientExecution(awsRequestMetrics, request, response);
530         }
531     }
532
533     /**
534      * <p>
535      * Creates a stack as specified in the template. After the call completes successfully, the stack creation starts.
536      * You can check the status of the stack via the <a>DescribeStacks</a> API.
537      * </p>
538      * 
539      * @param createStackRequest
540      *        The input for <a>CreateStack</a> action.
541      * @return Result of the CreateStack operation returned by the service.
542      * @throws LimitExceededException
543      *         The quota for the resource has already been reached.</p>
544      *         <p>
545      *         For information on resource and stack limitations, see <a
546      *         href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html"
547      *         >Limits</a> in the <i>AWS CloudFormation User Guide</i>.
548      * @throws AlreadyExistsException
549      *         The resource with the name requested already exists.
550      * @throws TokenAlreadyExistsException
551      *         A client request token already exists.
552      * @throws InsufficientCapabilitiesException
553      *         The template contains resources with capabilities that weren't specified in the Capabilities parameter.
554      * @sample AmazonCloudFormation.CreateStack
555      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateStack" target="_top">AWS API
556      *      Documentation</a>
557      */

558     @Override
559     public CreateStackResult createStack(CreateStackRequest request) {
560         request = beforeClientExecution(request);
561         return executeCreateStack(request);
562     }
563
564     @SdkInternalApi
565     final CreateStackResult executeCreateStack(CreateStackRequest createStackRequest) {
566
567         ExecutionContext executionContext = createExecutionContext(createStackRequest);
568         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
569         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
570         Request<CreateStackRequest> request = null;
571         Response<CreateStackResult> response = null;
572
573         try {
574             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
575             try {
576                 request = new CreateStackRequestMarshaller().marshall(super.beforeMarshalling(createStackRequest));
577                 // Binds the request metrics to the current request.
578                 request.setAWSRequestMetrics(awsRequestMetrics);
579                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
580                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
581                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateStack");
582                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
583
584             } finally {
585                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
586             }
587
588             StaxResponseHandler<CreateStackResult> responseHandler = new StaxResponseHandler<CreateStackResult>(new CreateStackResultStaxUnmarshaller());
589             response = invoke(request, responseHandler, executionContext);
590
591             return response.getAwsResponse();
592
593         } finally {
594
595             endClientExecution(awsRequestMetrics, request, response);
596         }
597     }
598
599     /**
600      * <p>
601      * Creates stack instances for the specified accounts, within the specified Regions. A stack instance refers to a
602      * stack in a specific account and Region. You must specify at least one value for either <code>Accounts</code> or
603      * <code>DeploymentTargets</code>, and you must specify at least one value for <code>Regions</code>.
604      * </p>
605      * 
606      * @param createStackInstancesRequest
607      * @return Result of the CreateStackInstances operation returned by the service.
608      * @throws StackSetNotFoundException
609      *         The specified stack set doesn't exist.
610      * @throws OperationInProgressException
611      *         Another operation is currently in progress for this stack set. Only one operation can be performed for a
612      *         stack set at a given time.
613      * @throws OperationIdAlreadyExistsException
614      *         The specified operation ID already exists.
615      * @throws StaleRequestException
616      *         Another operation has been performed on this stack set since the specified operation was performed.
617      * @throws InvalidOperationException
618      *         The specified operation isn't valid.
619      * @throws LimitExceededException
620      *         The quota for the resource has already been reached.</p>
621      *         <p>
622      *         For information on resource and stack limitations, see <a
623      *         href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html"
624      *         >Limits</a> in the <i>AWS CloudFormation User Guide</i>.
625      * @sample AmazonCloudFormation.CreateStackInstances
626      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateStackInstances"
627      *      target="_top">AWS API Documentation</a>
628      */

629     @Override
630     public CreateStackInstancesResult createStackInstances(CreateStackInstancesRequest request) {
631         request = beforeClientExecution(request);
632         return executeCreateStackInstances(request);
633     }
634
635     @SdkInternalApi
636     final CreateStackInstancesResult executeCreateStackInstances(CreateStackInstancesRequest createStackInstancesRequest) {
637
638         ExecutionContext executionContext = createExecutionContext(createStackInstancesRequest);
639         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
640         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
641         Request<CreateStackInstancesRequest> request = null;
642         Response<CreateStackInstancesResult> response = null;
643
644         try {
645             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
646             try {
647                 request = new CreateStackInstancesRequestMarshaller().marshall(super.beforeMarshalling(createStackInstancesRequest));
648                 // Binds the request metrics to the current request.
649                 request.setAWSRequestMetrics(awsRequestMetrics);
650                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
651                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
652                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateStackInstances");
653                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
654
655             } finally {
656                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
657             }
658
659             StaxResponseHandler<CreateStackInstancesResult> responseHandler = new StaxResponseHandler<CreateStackInstancesResult>(
660                     new CreateStackInstancesResultStaxUnmarshaller());
661             response = invoke(request, responseHandler, executionContext);
662
663             return response.getAwsResponse();
664
665         } finally {
666
667             endClientExecution(awsRequestMetrics, request, response);
668         }
669     }
670
671     /**
672      * <p>
673      * Creates a stack set.
674      * </p>
675      * 
676      * @param createStackSetRequest
677      * @return Result of the CreateStackSet operation returned by the service.
678      * @throws NameAlreadyExistsException
679      *         The specified name is already in use.
680      * @throws CreatedButModifiedException
681      *         The specified resource exists, but has been changed.
682      * @throws LimitExceededException
683      *         The quota for the resource has already been reached.</p>
684      *         <p>
685      *         For information on resource and stack limitations, see <a
686      *         href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html"
687      *         >Limits</a> in the <i>AWS CloudFormation User Guide</i>.
688      * @sample AmazonCloudFormation.CreateStackSet
689      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateStackSet" target="_top">AWS
690      *      API Documentation</a>
691      */

692     @Override
693     public CreateStackSetResult createStackSet(CreateStackSetRequest request) {
694         request = beforeClientExecution(request);
695         return executeCreateStackSet(request);
696     }
697
698     @SdkInternalApi
699     final CreateStackSetResult executeCreateStackSet(CreateStackSetRequest createStackSetRequest) {
700
701         ExecutionContext executionContext = createExecutionContext(createStackSetRequest);
702         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
703         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
704         Request<CreateStackSetRequest> request = null;
705         Response<CreateStackSetResult> response = null;
706
707         try {
708             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
709             try {
710                 request = new CreateStackSetRequestMarshaller().marshall(super.beforeMarshalling(createStackSetRequest));
711                 // Binds the request metrics to the current request.
712                 request.setAWSRequestMetrics(awsRequestMetrics);
713                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
714                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
715                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateStackSet");
716                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
717
718             } finally {
719                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
720             }
721
722             StaxResponseHandler<CreateStackSetResult> responseHandler = new StaxResponseHandler<CreateStackSetResult>(
723                     new CreateStackSetResultStaxUnmarshaller());
724             response = invoke(request, responseHandler, executionContext);
725
726             return response.getAwsResponse();
727
728         } finally {
729
730             endClientExecution(awsRequestMetrics, request, response);
731         }
732     }
733
734     /**
735      * <p>
736      * Deletes the specified change set. Deleting change sets ensures that no one executes the wrong change set.
737      * </p>
738      * <p>
739      * If the call successfully completes, AWS CloudFormation successfully deleted the change set.
740      * </p>
741      * 
742      * @param deleteChangeSetRequest
743      *        The input for the <a>DeleteChangeSet</a> action.
744      * @return Result of the DeleteChangeSet operation returned by the service.
745      * @throws InvalidChangeSetStatusException
746      *         The specified change set can't be used to update the stack. For example, the change set status might be
747      *         <code>CREATE_IN_PROGRESS</code>, or the stack status might be <code>UPDATE_IN_PROGRESS</code>.
748      * @sample AmazonCloudFormation.DeleteChangeSet
749      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteChangeSet" target="_top">AWS
750      *      API Documentation</a>
751      */

752     @Override
753     public DeleteChangeSetResult deleteChangeSet(DeleteChangeSetRequest request) {
754         request = beforeClientExecution(request);
755         return executeDeleteChangeSet(request);
756     }
757
758     @SdkInternalApi
759     final DeleteChangeSetResult executeDeleteChangeSet(DeleteChangeSetRequest deleteChangeSetRequest) {
760
761         ExecutionContext executionContext = createExecutionContext(deleteChangeSetRequest);
762         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
763         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
764         Request<DeleteChangeSetRequest> request = null;
765         Response<DeleteChangeSetResult> response = null;
766
767         try {
768             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
769             try {
770                 request = new DeleteChangeSetRequestMarshaller().marshall(super.beforeMarshalling(deleteChangeSetRequest));
771                 // Binds the request metrics to the current request.
772                 request.setAWSRequestMetrics(awsRequestMetrics);
773                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
774                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
775                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteChangeSet");
776                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
777
778             } finally {
779                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
780             }
781
782             StaxResponseHandler<DeleteChangeSetResult> responseHandler = new StaxResponseHandler<DeleteChangeSetResult>(
783                     new DeleteChangeSetResultStaxUnmarshaller());
784             response = invoke(request, responseHandler, executionContext);
785
786             return response.getAwsResponse();
787
788         } finally {
789
790             endClientExecution(awsRequestMetrics, request, response);
791         }
792     }
793
794     /**
795      * <p>
796      * Deletes a specified stack. Once the call completes successfully, stack deletion starts. Deleted stacks do not
797      * show up in the <a>DescribeStacks</a> API if the deletion has been completed successfully.
798      * </p>
799      * 
800      * @param deleteStackRequest
801      *        The input for <a>DeleteStack</a> action.
802      * @return Result of the DeleteStack operation returned by the service.
803      * @throws TokenAlreadyExistsException
804      *         A client request token already exists.
805      * @sample AmazonCloudFormation.DeleteStack
806      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteStack" target="_top">AWS API
807      *      Documentation</a>
808      */

809     @Override
810     public DeleteStackResult deleteStack(DeleteStackRequest request) {
811         request = beforeClientExecution(request);
812         return executeDeleteStack(request);
813     }
814
815     @SdkInternalApi
816     final DeleteStackResult executeDeleteStack(DeleteStackRequest deleteStackRequest) {
817
818         ExecutionContext executionContext = createExecutionContext(deleteStackRequest);
819         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
820         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
821         Request<DeleteStackRequest> request = null;
822         Response<DeleteStackResult> response = null;
823
824         try {
825             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
826             try {
827                 request = new DeleteStackRequestMarshaller().marshall(super.beforeMarshalling(deleteStackRequest));
828                 // Binds the request metrics to the current request.
829                 request.setAWSRequestMetrics(awsRequestMetrics);
830                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
831                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
832                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteStack");
833                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
834
835             } finally {
836                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
837             }
838
839             StaxResponseHandler<DeleteStackResult> responseHandler = new StaxResponseHandler<DeleteStackResult>(new DeleteStackResultStaxUnmarshaller());
840             response = invoke(request, responseHandler, executionContext);
841
842             return response.getAwsResponse();
843
844         } finally {
845
846             endClientExecution(awsRequestMetrics, request, response);
847         }
848     }
849
850     /**
851      * <p>
852      * Deletes stack instances for the specified accounts, in the specified Regions.
853      * </p>
854      * 
855      * @param deleteStackInstancesRequest
856      * @return Result of the DeleteStackInstances operation returned by the service.
857      * @throws StackSetNotFoundException
858      *         The specified stack set doesn't exist.
859      * @throws OperationInProgressException
860      *         Another operation is currently in progress for this stack set. Only one operation can be performed for a
861      *         stack set at a given time.
862      * @throws OperationIdAlreadyExistsException
863      *         The specified operation ID already exists.
864      * @throws StaleRequestException
865      *         Another operation has been performed on this stack set since the specified operation was performed.
866      * @throws InvalidOperationException
867      *         The specified operation isn't valid.
868      * @sample AmazonCloudFormation.DeleteStackInstances
869      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteStackInstances"
870      *      target="_top">AWS API Documentation</a>
871      */

872     @Override
873     public DeleteStackInstancesResult deleteStackInstances(DeleteStackInstancesRequest request) {
874         request = beforeClientExecution(request);
875         return executeDeleteStackInstances(request);
876     }
877
878     @SdkInternalApi
879     final DeleteStackInstancesResult executeDeleteStackInstances(DeleteStackInstancesRequest deleteStackInstancesRequest) {
880
881         ExecutionContext executionContext = createExecutionContext(deleteStackInstancesRequest);
882         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
883         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
884         Request<DeleteStackInstancesRequest> request = null;
885         Response<DeleteStackInstancesResult> response = null;
886
887         try {
888             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
889             try {
890                 request = new DeleteStackInstancesRequestMarshaller().marshall(super.beforeMarshalling(deleteStackInstancesRequest));
891                 // Binds the request metrics to the current request.
892                 request.setAWSRequestMetrics(awsRequestMetrics);
893                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
894                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
895                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteStackInstances");
896                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
897
898             } finally {
899                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
900             }
901
902             StaxResponseHandler<DeleteStackInstancesResult> responseHandler = new StaxResponseHandler<DeleteStackInstancesResult>(
903                     new DeleteStackInstancesResultStaxUnmarshaller());
904             response = invoke(request, responseHandler, executionContext);
905
906             return response.getAwsResponse();
907
908         } finally {
909
910             endClientExecution(awsRequestMetrics, request, response);
911         }
912     }
913
914     /**
915      * <p>
916      * Deletes a stack set. Before you can delete a stack set, all of its member stack instances must be deleted. For
917      * more information about how to do this, see <a>DeleteStackInstances</a>.
918      * </p>
919      * 
920      * @param deleteStackSetRequest
921      * @return Result of the DeleteStackSet operation returned by the service.
922      * @throws StackSetNotEmptyException
923      *         You can't yet delete this stack set, because it still contains one or more stack instances. Delete all
924      *         stack instances from the stack set before deleting the stack set.
925      * @throws OperationInProgressException
926      *         Another operation is currently in progress for this stack set. Only one operation can be performed for a
927      *         stack set at a given time.
928      * @sample AmazonCloudFormation.DeleteStackSet
929      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteStackSet" target="_top">AWS
930      *      API Documentation</a>
931      */

932     @Override
933     public DeleteStackSetResult deleteStackSet(DeleteStackSetRequest request) {
934         request = beforeClientExecution(request);
935         return executeDeleteStackSet(request);
936     }
937
938     @SdkInternalApi
939     final DeleteStackSetResult executeDeleteStackSet(DeleteStackSetRequest deleteStackSetRequest) {
940
941         ExecutionContext executionContext = createExecutionContext(deleteStackSetRequest);
942         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
943         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
944         Request<DeleteStackSetRequest> request = null;
945         Response<DeleteStackSetResult> response = null;
946
947         try {
948             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
949             try {
950                 request = new DeleteStackSetRequestMarshaller().marshall(super.beforeMarshalling(deleteStackSetRequest));
951                 // Binds the request metrics to the current request.
952                 request.setAWSRequestMetrics(awsRequestMetrics);
953                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
954                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
955                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteStackSet");
956                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
957
958             } finally {
959                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
960             }
961
962             StaxResponseHandler<DeleteStackSetResult> responseHandler = new StaxResponseHandler<DeleteStackSetResult>(
963                     new DeleteStackSetResultStaxUnmarshaller());
964             response = invoke(request, responseHandler, executionContext);
965
966             return response.getAwsResponse();
967
968         } finally {
969
970             endClientExecution(awsRequestMetrics, request, response);
971         }
972     }
973
974     /**
975      * <p>
976      * Removes a type or type version from active use in the CloudFormation registry. If a type or type version is
977      * deregistered, it cannot be used in CloudFormation operations.
978      * </p>
979      * <p>
980      * To deregister a type, you must individually deregister all registered versions of that type. If a type has only a
981      * single registered version, deregistering that version results in the type itself being deregistered.
982      * </p>
983      * <p>
984      * You cannot deregister the default version of a type, unless it is the only registered version of that type, in
985      * which case the type itself is deregistered as well.
986      * </p>
987      * 
988      * @param deregisterTypeRequest
989      * @return Result of the DeregisterType operation returned by the service.
990      * @throws CFNRegistryException
991      *         An error occurred during a CloudFormation registry operation.
992      * @throws TypeNotFoundException
993      *         The specified type does not exist in the CloudFormation registry.
994      * @sample AmazonCloudFormation.DeregisterType
995      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeregisterType" target="_top">AWS
996      *      API Documentation</a>
997      */

998     @Override
999     public DeregisterTypeResult deregisterType(DeregisterTypeRequest request) {
1000         request = beforeClientExecution(request);
1001         return executeDeregisterType(request);
1002     }
1003
1004     @SdkInternalApi
1005     final DeregisterTypeResult executeDeregisterType(DeregisterTypeRequest deregisterTypeRequest) {
1006
1007         ExecutionContext executionContext = createExecutionContext(deregisterTypeRequest);
1008         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1009         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1010         Request<DeregisterTypeRequest> request = null;
1011         Response<DeregisterTypeResult> response = null;
1012
1013         try {
1014             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1015             try {
1016                 request = new DeregisterTypeRequestMarshaller().marshall(super.beforeMarshalling(deregisterTypeRequest));
1017                 // Binds the request metrics to the current request.
1018                 request.setAWSRequestMetrics(awsRequestMetrics);
1019                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1020                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1021                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeregisterType");
1022                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1023
1024             } finally {
1025                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1026             }
1027
1028             StaxResponseHandler<DeregisterTypeResult> responseHandler = new StaxResponseHandler<DeregisterTypeResult>(
1029                     new DeregisterTypeResultStaxUnmarshaller());
1030             response = invoke(request, responseHandler, executionContext);
1031
1032             return response.getAwsResponse();
1033
1034         } finally {
1035
1036             endClientExecution(awsRequestMetrics, request, response);
1037         }
1038     }
1039
1040     /**
1041      * <p>
1042      * Retrieves your account's AWS CloudFormation limits, such as the maximum number of stacks that you can create in
1043      * your account. For more information about account limits, see <a
1044      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html">AWS
1045      * CloudFormation Limits</a> in the <i>AWS CloudFormation User Guide</i>.
1046      * </p>
1047      * 
1048      * @param describeAccountLimitsRequest
1049      *        The input for the <a>DescribeAccountLimits</a> action.
1050      * @return Result of the DescribeAccountLimits operation returned by the service.
1051      * @sample AmazonCloudFormation.DescribeAccountLimits
1052      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeAccountLimits"
1053      *      target="_top">AWS API Documentation</a>
1054      */

1055     @Override
1056     public DescribeAccountLimitsResult describeAccountLimits(DescribeAccountLimitsRequest request) {
1057         request = beforeClientExecution(request);
1058         return executeDescribeAccountLimits(request);
1059     }
1060
1061     @SdkInternalApi
1062     final DescribeAccountLimitsResult executeDescribeAccountLimits(DescribeAccountLimitsRequest describeAccountLimitsRequest) {
1063
1064         ExecutionContext executionContext = createExecutionContext(describeAccountLimitsRequest);
1065         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1066         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1067         Request<DescribeAccountLimitsRequest> request = null;
1068         Response<DescribeAccountLimitsResult> response = null;
1069
1070         try {
1071             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1072             try {
1073                 request = new DescribeAccountLimitsRequestMarshaller().marshall(super.beforeMarshalling(describeAccountLimitsRequest));
1074                 // Binds the request metrics to the current request.
1075                 request.setAWSRequestMetrics(awsRequestMetrics);
1076                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1077                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1078                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAccountLimits");
1079                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1080
1081             } finally {
1082                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1083             }
1084
1085             StaxResponseHandler<DescribeAccountLimitsResult> responseHandler = new StaxResponseHandler<DescribeAccountLimitsResult>(
1086                     new DescribeAccountLimitsResultStaxUnmarshaller());
1087             response = invoke(request, responseHandler, executionContext);
1088
1089             return response.getAwsResponse();
1090
1091         } finally {
1092
1093             endClientExecution(awsRequestMetrics, request, response);
1094         }
1095     }
1096
1097     /**
1098      * <p>
1099      * Returns the inputs for the change set and a list of changes that AWS CloudFormation will make if you execute the
1100      * change set. For more information, see <a
1101      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html"
1102      * >Updating Stacks Using Change Sets</a> in the AWS CloudFormation User Guide.
1103      * </p>
1104      * 
1105      * @param describeChangeSetRequest
1106      *        The input for the <a>DescribeChangeSet</a> action.
1107      * @return Result of the DescribeChangeSet operation returned by the service.
1108      * @throws ChangeSetNotFoundException
1109      *         The specified change set name or ID doesn't exit. To view valid change sets for a stack, use the
1110      *         <code>ListChangeSets</code> action.
1111      * @sample AmazonCloudFormation.DescribeChangeSet
1112      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeChangeSet"
1113      *      target="_top">AWS API Documentation</a>
1114      */

1115     @Override
1116     public DescribeChangeSetResult describeChangeSet(DescribeChangeSetRequest request) {
1117         request = beforeClientExecution(request);
1118         return executeDescribeChangeSet(request);
1119     }
1120
1121     @SdkInternalApi
1122     final DescribeChangeSetResult executeDescribeChangeSet(DescribeChangeSetRequest describeChangeSetRequest) {
1123
1124         ExecutionContext executionContext = createExecutionContext(describeChangeSetRequest);
1125         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1126         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1127         Request<DescribeChangeSetRequest> request = null;
1128         Response<DescribeChangeSetResult> response = null;
1129
1130         try {
1131             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1132             try {
1133                 request = new DescribeChangeSetRequestMarshaller().marshall(super.beforeMarshalling(describeChangeSetRequest));
1134                 // Binds the request metrics to the current request.
1135                 request.setAWSRequestMetrics(awsRequestMetrics);
1136                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1137                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1138                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeChangeSet");
1139                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1140
1141             } finally {
1142                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1143             }
1144
1145             StaxResponseHandler<DescribeChangeSetResult> responseHandler = new StaxResponseHandler<DescribeChangeSetResult>(
1146                     new DescribeChangeSetResultStaxUnmarshaller());
1147             response = invoke(request, responseHandler, executionContext);
1148
1149             return response.getAwsResponse();
1150
1151         } finally {
1152
1153             endClientExecution(awsRequestMetrics, request, response);
1154         }
1155     }
1156
1157     /**
1158      * <p>
1159      * Returns information about a stack drift detection operation. A stack drift detection operation detects whether a
1160      * stack's actual configuration differs, or has <i>drifted</i>, from it's expected configuration, as defined in the
1161      * stack template and any values specified as template parameters. A stack is considered to have drifted if one or
1162      * more of its resources have drifted. For more information on stack and resource drift, see <a
1163      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html">Detecting
1164      * Unregulated Configuration Changes to Stacks and Resources</a>.
1165      * </p>
1166      * <p>
1167      * Use <a>DetectStackDrift</a> to initiate a stack drift detection operation. <code>DetectStackDrift</code> returns
1168      * a <code>StackDriftDetectionId</code> you can use to monitor the progress of the operation using
1169      * <code>DescribeStackDriftDetectionStatus</code>. Once the drift detection operation has completed, use
1170      * <a>DescribeStackResourceDrifts</a> to return drift information about the stack and its resources.
1171      * </p>
1172      * 
1173      * @param describeStackDriftDetectionStatusRequest
1174      * @return Result of the DescribeStackDriftDetectionStatus operation returned by the service.
1175      * @sample AmazonCloudFormation.DescribeStackDriftDetectionStatus
1176      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackDriftDetectionStatus"
1177      *      target="_top">AWS API Documentation</a>
1178      */

1179     @Override
1180     public DescribeStackDriftDetectionStatusResult describeStackDriftDetectionStatus(DescribeStackDriftDetectionStatusRequest request) {
1181         request = beforeClientExecution(request);
1182         return executeDescribeStackDriftDetectionStatus(request);
1183     }
1184
1185     @SdkInternalApi
1186     final DescribeStackDriftDetectionStatusResult executeDescribeStackDriftDetectionStatus(
1187             DescribeStackDriftDetectionStatusRequest describeStackDriftDetectionStatusRequest) {
1188
1189         ExecutionContext executionContext = createExecutionContext(describeStackDriftDetectionStatusRequest);
1190         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1191         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1192         Request<DescribeStackDriftDetectionStatusRequest> request = null;
1193         Response<DescribeStackDriftDetectionStatusResult> response = null;
1194
1195         try {
1196             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1197             try {
1198                 request = new DescribeStackDriftDetectionStatusRequestMarshaller().marshall(super.beforeMarshalling(describeStackDriftDetectionStatusRequest));
1199                 // Binds the request metrics to the current request.
1200                 request.setAWSRequestMetrics(awsRequestMetrics);
1201                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1202                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1203                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStackDriftDetectionStatus");
1204                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1205
1206             } finally {
1207                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1208             }
1209
1210             StaxResponseHandler<DescribeStackDriftDetectionStatusResult> responseHandler = new StaxResponseHandler<DescribeStackDriftDetectionStatusResult>(
1211                     new DescribeStackDriftDetectionStatusResultStaxUnmarshaller());
1212             response = invoke(request, responseHandler, executionContext);
1213
1214             return response.getAwsResponse();
1215
1216         } finally {
1217
1218             endClientExecution(awsRequestMetrics, request, response);
1219         }
1220     }
1221
1222     /**
1223      * <p>
1224      * Returns all stack related events for a specified stack in reverse chronological order. For more information about
1225      * a stack's event history, go to <a
1226      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/concept-stack.html">Stacks</a> in the AWS
1227      * CloudFormation User Guide.
1228      * </p>
1229      * <note>
1230      * <p>
1231      * You can list events for stacks that have failed to create or have been deleted by specifying the unique stack
1232      * identifier (stack ID).
1233      * </p>
1234      * </note>
1235      * 
1236      * @param describeStackEventsRequest
1237      *        The input for <a>DescribeStackEvents</a> action.
1238      * @return Result of the DescribeStackEvents operation returned by the service.
1239      * @sample AmazonCloudFormation.DescribeStackEvents
1240      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackEvents"
1241      *      target="_top">AWS API Documentation</a>
1242      */

1243     @Override
1244     public DescribeStackEventsResult describeStackEvents(DescribeStackEventsRequest request) {
1245         request = beforeClientExecution(request);
1246         return executeDescribeStackEvents(request);
1247     }
1248
1249     @SdkInternalApi
1250     final DescribeStackEventsResult executeDescribeStackEvents(DescribeStackEventsRequest describeStackEventsRequest) {
1251
1252         ExecutionContext executionContext = createExecutionContext(describeStackEventsRequest);
1253         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1254         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1255         Request<DescribeStackEventsRequest> request = null;
1256         Response<DescribeStackEventsResult> response = null;
1257
1258         try {
1259             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1260             try {
1261                 request = new DescribeStackEventsRequestMarshaller().marshall(super.beforeMarshalling(describeStackEventsRequest));
1262                 // Binds the request metrics to the current request.
1263                 request.setAWSRequestMetrics(awsRequestMetrics);
1264                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1265                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1266                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStackEvents");
1267                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1268
1269             } finally {
1270                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1271             }
1272
1273             StaxResponseHandler<DescribeStackEventsResult> responseHandler = new StaxResponseHandler<DescribeStackEventsResult>(
1274                     new DescribeStackEventsResultStaxUnmarshaller());
1275             response = invoke(request, responseHandler, executionContext);
1276
1277             return response.getAwsResponse();
1278
1279         } finally {
1280
1281             endClientExecution(awsRequestMetrics, request, response);
1282         }
1283     }
1284
1285     /**
1286      * <p>
1287      * Returns the stack instance that's associated with the specified stack set, AWS account, and Region.
1288      * </p>
1289      * <p>
1290      * For a list of stack instances that are associated with a specific stack set, use <a>ListStackInstances</a>.
1291      * </p>
1292      * 
1293      * @param describeStackInstanceRequest
1294      * @return Result of the DescribeStackInstance operation returned by the service.
1295      * @throws StackSetNotFoundException
1296      *         The specified stack set doesn't exist.
1297      * @throws StackInstanceNotFoundException
1298      *         The specified stack instance doesn't exist.
1299      * @sample AmazonCloudFormation.DescribeStackInstance
1300      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackInstance"
1301      *      target="_top">AWS API Documentation</a>
1302      */

1303     @Override
1304     public DescribeStackInstanceResult describeStackInstance(DescribeStackInstanceRequest request) {
1305         request = beforeClientExecution(request);
1306         return executeDescribeStackInstance(request);
1307     }
1308
1309     @SdkInternalApi
1310     final DescribeStackInstanceResult executeDescribeStackInstance(DescribeStackInstanceRequest describeStackInstanceRequest) {
1311
1312         ExecutionContext executionContext = createExecutionContext(describeStackInstanceRequest);
1313         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1314         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1315         Request<DescribeStackInstanceRequest> request = null;
1316         Response<DescribeStackInstanceResult> response = null;
1317
1318         try {
1319             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1320             try {
1321                 request = new DescribeStackInstanceRequestMarshaller().marshall(super.beforeMarshalling(describeStackInstanceRequest));
1322                 // Binds the request metrics to the current request.
1323                 request.setAWSRequestMetrics(awsRequestMetrics);
1324                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1325                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1326                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStackInstance");
1327                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1328
1329             } finally {
1330                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1331             }
1332
1333             StaxResponseHandler<DescribeStackInstanceResult> responseHandler = new StaxResponseHandler<DescribeStackInstanceResult>(
1334                     new DescribeStackInstanceResultStaxUnmarshaller());
1335             response = invoke(request, responseHandler, executionContext);
1336
1337             return response.getAwsResponse();
1338
1339         } finally {
1340
1341             endClientExecution(awsRequestMetrics, request, response);
1342         }
1343     }
1344
1345     /**
1346      * <p>
1347      * Returns a description of the specified resource in the specified stack.
1348      * </p>
1349      * <p>
1350      * For deleted stacks, DescribeStackResource returns resource information for up to 90 days after the stack has been
1351      * deleted.
1352      * </p>
1353      * 
1354      * @param describeStackResourceRequest
1355      *        The input for <a>DescribeStackResource</a> action.
1356      * @return Result of the DescribeStackResource operation returned by the service.
1357      * @sample AmazonCloudFormation.DescribeStackResource
1358      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResource"
1359      *      target="_top">AWS API Documentation</a>
1360      */

1361     @Override
1362     public DescribeStackResourceResult describeStackResource(DescribeStackResourceRequest request) {
1363         request = beforeClientExecution(request);
1364         return executeDescribeStackResource(request);
1365     }
1366
1367     @SdkInternalApi
1368     final DescribeStackResourceResult executeDescribeStackResource(DescribeStackResourceRequest describeStackResourceRequest) {
1369
1370         ExecutionContext executionContext = createExecutionContext(describeStackResourceRequest);
1371         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1372         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1373         Request<DescribeStackResourceRequest> request = null;
1374         Response<DescribeStackResourceResult> response = null;
1375
1376         try {
1377             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1378             try {
1379                 request = new DescribeStackResourceRequestMarshaller().marshall(super.beforeMarshalling(describeStackResourceRequest));
1380                 // Binds the request metrics to the current request.
1381                 request.setAWSRequestMetrics(awsRequestMetrics);
1382                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1383                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1384                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStackResource");
1385                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1386
1387             } finally {
1388                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1389             }
1390
1391             StaxResponseHandler<DescribeStackResourceResult> responseHandler = new StaxResponseHandler<DescribeStackResourceResult>(
1392                     new DescribeStackResourceResultStaxUnmarshaller());
1393             response = invoke(request, responseHandler, executionContext);
1394
1395             return response.getAwsResponse();
1396
1397         } finally {
1398
1399             endClientExecution(awsRequestMetrics, request, response);
1400         }
1401     }
1402
1403     /**
1404      * <p>
1405      * Returns drift information for the resources that have been checked for drift in the specified stack. This
1406      * includes actual and expected configuration values for resources where AWS CloudFormation detects configuration
1407      * drift.
1408      * </p>
1409      * <p>
1410      * For a given stack, there will be one <code>StackResourceDrift</code> for each stack resource that has been
1411      * checked for drift. Resources that have not yet been checked for drift are not included. Resources that do not
1412      * currently support drift detection are not checked, and so not included. For a list of resources that support
1413      * drift detection, see <a
1414      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html"
1415      * >Resources that Support Drift Detection</a>.
1416      * </p>
1417      * <p>
1418      * Use <a>DetectStackResourceDrift</a> to detect drift on individual resources, or <a>DetectStackDrift</a> to detect
1419      * drift on all supported resources for a given stack.
1420      * </p>
1421      * 
1422      * @param describeStackResourceDriftsRequest
1423      * @return Result of the DescribeStackResourceDrifts operation returned by the service.
1424      * @sample AmazonCloudFormation.DescribeStackResourceDrifts
1425      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResourceDrifts"
1426      *      target="_top">AWS API Documentation</a>
1427      */

1428     @Override
1429     public DescribeStackResourceDriftsResult describeStackResourceDrifts(DescribeStackResourceDriftsRequest request) {
1430         request = beforeClientExecution(request);
1431         return executeDescribeStackResourceDrifts(request);
1432     }
1433
1434     @SdkInternalApi
1435     final DescribeStackResourceDriftsResult executeDescribeStackResourceDrifts(DescribeStackResourceDriftsRequest describeStackResourceDriftsRequest) {
1436
1437         ExecutionContext executionContext = createExecutionContext(describeStackResourceDriftsRequest);
1438         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1439         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1440         Request<DescribeStackResourceDriftsRequest> request = null;
1441         Response<DescribeStackResourceDriftsResult> response = null;
1442
1443         try {
1444             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1445             try {
1446                 request = new DescribeStackResourceDriftsRequestMarshaller().marshall(super.beforeMarshalling(describeStackResourceDriftsRequest));
1447                 // Binds the request metrics to the current request.
1448                 request.setAWSRequestMetrics(awsRequestMetrics);
1449                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1450                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1451                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStackResourceDrifts");
1452                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1453
1454             } finally {
1455                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1456             }
1457
1458             StaxResponseHandler<DescribeStackResourceDriftsResult> responseHandler = new StaxResponseHandler<DescribeStackResourceDriftsResult>(
1459                     new DescribeStackResourceDriftsResultStaxUnmarshaller());
1460             response = invoke(request, responseHandler, executionContext);
1461
1462             return response.getAwsResponse();
1463
1464         } finally {
1465
1466             endClientExecution(awsRequestMetrics, request, response);
1467         }
1468     }
1469
1470     /**
1471      * <p>
1472      * Returns AWS resource descriptions for running and deleted stacks. If <code>StackName</code> is specified, all the
1473      * associated resources that are part of the stack are returned. If <code>PhysicalResourceId</code> is specified,
1474      * the associated resources of the stack that the resource belongs to are returned.
1475      * </p>
1476      * <note>
1477      * <p>
1478      * Only the first 100 resources will be returned. If your stack has more resources than this, you should use
1479      * <code>ListStackResources</code> instead.
1480      * </p>
1481      * </note>
1482      * <p>
1483      * For deleted stacks, <code>DescribeStackResources</code> returns resource information for up to 90 days after the
1484      * stack has been deleted.
1485      * </p>
1486      * <p>
1487      * You must specify either <code>StackName</code> or <code>PhysicalResourceId</code>, but not both. In addition, you
1488      * can specify <code>LogicalResourceId</code> to filter the returned result. For more information about resources,
1489      * the <code>LogicalResourceId</code> and <code>PhysicalResourceId</code>, go to the <a
1490      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/">AWS CloudFormation User Guide</a>.
1491      * </p>
1492      * <note>
1493      * <p>
1494      * A <code>ValidationError</code> is returned if you specify both <code>StackName</code> and
1495      * <code>PhysicalResourceId</code> in the same request.
1496      * </p>
1497      * </note>
1498      * 
1499      * @param describeStackResourcesRequest
1500      *        The input for <a>DescribeStackResources</a> action.
1501      * @return Result of the DescribeStackResources operation returned by the service.
1502      * @sample AmazonCloudFormation.DescribeStackResources
1503      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackResources"
1504      *      target="_top">AWS API Documentation</a>
1505      */

1506     @Override
1507     public DescribeStackResourcesResult describeStackResources(DescribeStackResourcesRequest request) {
1508         request = beforeClientExecution(request);
1509         return executeDescribeStackResources(request);
1510     }
1511
1512     @SdkInternalApi
1513     final DescribeStackResourcesResult executeDescribeStackResources(DescribeStackResourcesRequest describeStackResourcesRequest) {
1514
1515         ExecutionContext executionContext = createExecutionContext(describeStackResourcesRequest);
1516         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1517         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1518         Request<DescribeStackResourcesRequest> request = null;
1519         Response<DescribeStackResourcesResult> response = null;
1520
1521         try {
1522             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1523             try {
1524                 request = new DescribeStackResourcesRequestMarshaller().marshall(super.beforeMarshalling(describeStackResourcesRequest));
1525                 // Binds the request metrics to the current request.
1526                 request.setAWSRequestMetrics(awsRequestMetrics);
1527                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1528                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1529                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStackResources");
1530                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1531
1532             } finally {
1533                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1534             }
1535
1536             StaxResponseHandler<DescribeStackResourcesResult> responseHandler = new StaxResponseHandler<DescribeStackResourcesResult>(
1537                     new DescribeStackResourcesResultStaxUnmarshaller());
1538             response = invoke(request, responseHandler, executionContext);
1539
1540             return response.getAwsResponse();
1541
1542         } finally {
1543
1544             endClientExecution(awsRequestMetrics, request, response);
1545         }
1546     }
1547
1548     /**
1549      * <p>
1550      * Returns the description of the specified stack set.
1551      * </p>
1552      * 
1553      * @param describeStackSetRequest
1554      * @return Result of the DescribeStackSet operation returned by the service.
1555      * @throws StackSetNotFoundException
1556      *         The specified stack set doesn't exist.
1557      * @sample AmazonCloudFormation.DescribeStackSet
1558      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackSet"
1559      *      target="_top">AWS API Documentation</a>
1560      */

1561     @Override
1562     public DescribeStackSetResult describeStackSet(DescribeStackSetRequest request) {
1563         request = beforeClientExecution(request);
1564         return executeDescribeStackSet(request);
1565     }
1566
1567     @SdkInternalApi
1568     final DescribeStackSetResult executeDescribeStackSet(DescribeStackSetRequest describeStackSetRequest) {
1569
1570         ExecutionContext executionContext = createExecutionContext(describeStackSetRequest);
1571         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1572         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1573         Request<DescribeStackSetRequest> request = null;
1574         Response<DescribeStackSetResult> response = null;
1575
1576         try {
1577             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1578             try {
1579                 request = new DescribeStackSetRequestMarshaller().marshall(super.beforeMarshalling(describeStackSetRequest));
1580                 // Binds the request metrics to the current request.
1581                 request.setAWSRequestMetrics(awsRequestMetrics);
1582                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1583                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1584                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStackSet");
1585                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1586
1587             } finally {
1588                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1589             }
1590
1591             StaxResponseHandler<DescribeStackSetResult> responseHandler = new StaxResponseHandler<DescribeStackSetResult>(
1592                     new DescribeStackSetResultStaxUnmarshaller());
1593             response = invoke(request, responseHandler, executionContext);
1594
1595             return response.getAwsResponse();
1596
1597         } finally {
1598
1599             endClientExecution(awsRequestMetrics, request, response);
1600         }
1601     }
1602
1603     /**
1604      * <p>
1605      * Returns the description of the specified stack set operation.
1606      * </p>
1607      * 
1608      * @param describeStackSetOperationRequest
1609      * @return Result of the DescribeStackSetOperation operation returned by the service.
1610      * @throws StackSetNotFoundException
1611      *         The specified stack set doesn't exist.
1612      * @throws OperationNotFoundException
1613      *         The specified ID refers to an operation that doesn't exist.
1614      * @sample AmazonCloudFormation.DescribeStackSetOperation
1615      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStackSetOperation"
1616      *      target="_top">AWS API Documentation</a>
1617      */

1618     @Override
1619     public DescribeStackSetOperationResult describeStackSetOperation(DescribeStackSetOperationRequest request) {
1620         request = beforeClientExecution(request);
1621         return executeDescribeStackSetOperation(request);
1622     }
1623
1624     @SdkInternalApi
1625     final DescribeStackSetOperationResult executeDescribeStackSetOperation(DescribeStackSetOperationRequest describeStackSetOperationRequest) {
1626
1627         ExecutionContext executionContext = createExecutionContext(describeStackSetOperationRequest);
1628         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1629         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1630         Request<DescribeStackSetOperationRequest> request = null;
1631         Response<DescribeStackSetOperationResult> response = null;
1632
1633         try {
1634             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1635             try {
1636                 request = new DescribeStackSetOperationRequestMarshaller().marshall(super.beforeMarshalling(describeStackSetOperationRequest));
1637                 // Binds the request metrics to the current request.
1638                 request.setAWSRequestMetrics(awsRequestMetrics);
1639                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1640                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1641                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStackSetOperation");
1642                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1643
1644             } finally {
1645                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1646             }
1647
1648             StaxResponseHandler<DescribeStackSetOperationResult> responseHandler = new StaxResponseHandler<DescribeStackSetOperationResult>(
1649                     new DescribeStackSetOperationResultStaxUnmarshaller());
1650             response = invoke(request, responseHandler, executionContext);
1651
1652             return response.getAwsResponse();
1653
1654         } finally {
1655
1656             endClientExecution(awsRequestMetrics, request, response);
1657         }
1658     }
1659
1660     /**
1661      * <p>
1662      * Returns the description for the specified stack; if no stack name was specified, then it returns the description
1663      * for all the stacks created.
1664      * </p>
1665      * <note>
1666      * <p>
1667      * If the stack does not exist, an <code>AmazonCloudFormationException</code> is returned.
1668      * </p>
1669      * </note>
1670      * 
1671      * @param describeStacksRequest
1672      *        The input for <a>DescribeStacks</a> action.
1673      * @return Result of the DescribeStacks operation returned by the service.
1674      * @sample AmazonCloudFormation.DescribeStacks
1675      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStacks" target="_top">AWS
1676      *      API Documentation</a>
1677      */

1678     @Override
1679     public DescribeStacksResult describeStacks(DescribeStacksRequest request) {
1680         request = beforeClientExecution(request);
1681         return executeDescribeStacks(request);
1682     }
1683
1684     @SdkInternalApi
1685     final DescribeStacksResult executeDescribeStacks(DescribeStacksRequest describeStacksRequest) {
1686
1687         ExecutionContext executionContext = createExecutionContext(describeStacksRequest);
1688         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1689         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1690         Request<DescribeStacksRequest> request = null;
1691         Response<DescribeStacksResult> response = null;
1692
1693         try {
1694             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1695             try {
1696                 request = new DescribeStacksRequestMarshaller().marshall(super.beforeMarshalling(describeStacksRequest));
1697                 // Binds the request metrics to the current request.
1698                 request.setAWSRequestMetrics(awsRequestMetrics);
1699                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1700                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1701                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStacks");
1702                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1703
1704             } finally {
1705                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1706             }
1707
1708             StaxResponseHandler<DescribeStacksResult> responseHandler = new StaxResponseHandler<DescribeStacksResult>(
1709                     new DescribeStacksResultStaxUnmarshaller());
1710             response = invoke(request, responseHandler, executionContext);
1711
1712             return response.getAwsResponse();
1713
1714         } finally {
1715
1716             endClientExecution(awsRequestMetrics, request, response);
1717         }
1718     }
1719
1720     @Override
1721     public DescribeStacksResult describeStacks() {
1722         return describeStacks(new DescribeStacksRequest());
1723     }
1724
1725     /**
1726      * <p>
1727      * Returns detailed information about a type that has been registered.
1728      * </p>
1729      * <p>
1730      * If you specify a <code>VersionId</code>, <code>DescribeType</code> returns information about that specific type
1731      * version. Otherwise, it returns information about the default type version.
1732      * </p>
1733      * 
1734      * @param describeTypeRequest
1735      * @return Result of the DescribeType operation returned by the service.
1736      * @throws CFNRegistryException
1737      *         An error occurred during a CloudFormation registry operation.
1738      * @throws TypeNotFoundException
1739      *         The specified type does not exist in the CloudFormation registry.
1740      * @sample AmazonCloudFormation.DescribeType
1741      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeType" target="_top">AWS
1742      *      API Documentation</a>
1743      */

1744     @Override
1745     public DescribeTypeResult describeType(DescribeTypeRequest request) {
1746         request = beforeClientExecution(request);
1747         return executeDescribeType(request);
1748     }
1749
1750     @SdkInternalApi
1751     final DescribeTypeResult executeDescribeType(DescribeTypeRequest describeTypeRequest) {
1752
1753         ExecutionContext executionContext = createExecutionContext(describeTypeRequest);
1754         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1755         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1756         Request<DescribeTypeRequest> request = null;
1757         Response<DescribeTypeResult> response = null;
1758
1759         try {
1760             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1761             try {
1762                 request = new DescribeTypeRequestMarshaller().marshall(super.beforeMarshalling(describeTypeRequest));
1763                 // Binds the request metrics to the current request.
1764                 request.setAWSRequestMetrics(awsRequestMetrics);
1765                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1766                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1767                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeType");
1768                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1769
1770             } finally {
1771                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1772             }
1773
1774             StaxResponseHandler<DescribeTypeResult> responseHandler = new StaxResponseHandler<DescribeTypeResult>(new DescribeTypeResultStaxUnmarshaller());
1775             response = invoke(request, responseHandler, executionContext);
1776
1777             return response.getAwsResponse();
1778
1779         } finally {
1780
1781             endClientExecution(awsRequestMetrics, request, response);
1782         }
1783     }
1784
1785     /**
1786      * <p>
1787      * Returns information about a type's registration, including its current status and type and version identifiers.
1788      * </p>
1789      * <p>
1790      * When you initiate a registration request using <code> <a>RegisterType</a> </code>, you can then use
1791      * <code> <a>DescribeTypeRegistration</a> </code> to monitor the progress of that registration request.
1792      * </p>
1793      * <p>
1794      * Once the registration request has completed, use <code> <a>DescribeType</a> </code> to return detailed
1795      * informaiton about a type.
1796      * </p>
1797      * 
1798      * @param describeTypeRegistrationRequest
1799      * @return Result of the DescribeTypeRegistration operation returned by the service.
1800      * @throws CFNRegistryException
1801      *         An error occurred during a CloudFormation registry operation.
1802      * @sample AmazonCloudFormation.DescribeTypeRegistration
1803      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeTypeRegistration"
1804      *      target="_top">AWS API Documentation</a>
1805      */

1806     @Override
1807     public DescribeTypeRegistrationResult describeTypeRegistration(DescribeTypeRegistrationRequest request) {
1808         request = beforeClientExecution(request);
1809         return executeDescribeTypeRegistration(request);
1810     }
1811
1812     @SdkInternalApi
1813     final DescribeTypeRegistrationResult executeDescribeTypeRegistration(DescribeTypeRegistrationRequest describeTypeRegistrationRequest) {
1814
1815         ExecutionContext executionContext = createExecutionContext(describeTypeRegistrationRequest);
1816         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1817         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1818         Request<DescribeTypeRegistrationRequest> request = null;
1819         Response<DescribeTypeRegistrationResult> response = null;
1820
1821         try {
1822             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1823             try {
1824                 request = new DescribeTypeRegistrationRequestMarshaller().marshall(super.beforeMarshalling(describeTypeRegistrationRequest));
1825                 // Binds the request metrics to the current request.
1826                 request.setAWSRequestMetrics(awsRequestMetrics);
1827                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1828                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1829                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeTypeRegistration");
1830                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1831
1832             } finally {
1833                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1834             }
1835
1836             StaxResponseHandler<DescribeTypeRegistrationResult> responseHandler = new StaxResponseHandler<DescribeTypeRegistrationResult>(
1837                     new DescribeTypeRegistrationResultStaxUnmarshaller());
1838             response = invoke(request, responseHandler, executionContext);
1839
1840             return response.getAwsResponse();
1841
1842         } finally {
1843
1844             endClientExecution(awsRequestMetrics, request, response);
1845         }
1846     }
1847
1848     /**
1849      * <p>
1850      * Detects whether a stack's actual configuration differs, or has <i>drifted</i>, from it's expected configuration,
1851      * as defined in the stack template and any values specified as template parameters. For each resource in the stack
1852      * that supports drift detection, AWS CloudFormation compares the actual configuration of the resource with its
1853      * expected template configuration. Only resource properties explicitly defined in the stack template are checked
1854      * for drift. A stack is considered to have drifted if one or more of its resources differ from their expected
1855      * template configurations. For more information, see <a
1856      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html">Detecting
1857      * Unregulated Configuration Changes to Stacks and Resources</a>.
1858      * </p>
1859      * <p>
1860      * Use <code>DetectStackDrift</code> to detect drift on all supported resources for a given stack, or
1861      * <a>DetectStackResourceDrift</a> to detect drift on individual resources.
1862      * </p>
1863      * <p>
1864      * For a list of stack resources that currently support drift detection, see <a
1865      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html"
1866      * >Resources that Support Drift Detection</a>.
1867      * </p>
1868      * <p>
1869      * <code>DetectStackDrift</code> can take up to several minutes, depending on the number of resources contained
1870      * within the stack. Use <a>DescribeStackDriftDetectionStatus</a> to monitor the progress of a detect stack drift
1871      * operation. Once the drift detection operation has completed, use <a>DescribeStackResourceDrifts</a> to return
1872      * drift information about the stack and its resources.
1873      * </p>
1874      * <p>
1875      * When detecting drift on a stack, AWS CloudFormation does not detect drift on any nested stacks belonging to that
1876      * stack. Perform <code>DetectStackDrift</code> directly on the nested stack itself.
1877      * </p>
1878      * 
1879      * @param detectStackDriftRequest
1880      * @return Result of the DetectStackDrift operation returned by the service.
1881      * @sample AmazonCloudFormation.DetectStackDrift
1882      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DetectStackDrift"
1883      *      target="_top">AWS API Documentation</a>
1884      */

1885     @Override
1886     public DetectStackDriftResult detectStackDrift(DetectStackDriftRequest request) {
1887         request = beforeClientExecution(request);
1888         return executeDetectStackDrift(request);
1889     }
1890
1891     @SdkInternalApi
1892     final DetectStackDriftResult executeDetectStackDrift(DetectStackDriftRequest detectStackDriftRequest) {
1893
1894         ExecutionContext executionContext = createExecutionContext(detectStackDriftRequest);
1895         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1896         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1897         Request<DetectStackDriftRequest> request = null;
1898         Response<DetectStackDriftResult> response = null;
1899
1900         try {
1901             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1902             try {
1903                 request = new DetectStackDriftRequestMarshaller().marshall(super.beforeMarshalling(detectStackDriftRequest));
1904                 // Binds the request metrics to the current request.
1905                 request.setAWSRequestMetrics(awsRequestMetrics);
1906                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1907                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1908                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DetectStackDrift");
1909                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1910
1911             } finally {
1912                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1913             }
1914
1915             StaxResponseHandler<DetectStackDriftResult> responseHandler = new StaxResponseHandler<DetectStackDriftResult>(
1916                     new DetectStackDriftResultStaxUnmarshaller());
1917             response = invoke(request, responseHandler, executionContext);
1918
1919             return response.getAwsResponse();
1920
1921         } finally {
1922
1923             endClientExecution(awsRequestMetrics, request, response);
1924         }
1925     }
1926
1927     /**
1928      * <p>
1929      * Returns information about whether a resource's actual configuration differs, or has <i>drifted</i>, from it's
1930      * expected configuration, as defined in the stack template and any values specified as template parameters. This
1931      * information includes actual and expected property values for resources in which AWS CloudFormation detects drift.
1932      * Only resource properties explicitly defined in the stack template are checked for drift. For more information
1933      * about stack and resource drift, see <a
1934      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html">Detecting
1935      * Unregulated Configuration Changes to Stacks and Resources</a>.
1936      * </p>
1937      * <p>
1938      * Use <code>DetectStackResourceDrift</code> to detect drift on individual resources, or <a>DetectStackDrift</a> to
1939      * detect drift on all resources in a given stack that support drift detection.
1940      * </p>
1941      * <p>
1942      * Resources that do not currently support drift detection cannot be checked. For a list of resources that support
1943      * drift detection, see <a
1944      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html"
1945      * >Resources that Support Drift Detection</a>.
1946      * </p>
1947      * 
1948      * @param detectStackResourceDriftRequest
1949      * @return Result of the DetectStackResourceDrift operation returned by the service.
1950      * @sample AmazonCloudFormation.DetectStackResourceDrift
1951      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DetectStackResourceDrift"
1952      *      target="_top">AWS API Documentation</a>
1953      */

1954     @Override
1955     public DetectStackResourceDriftResult detectStackResourceDrift(DetectStackResourceDriftRequest request) {
1956         request = beforeClientExecution(request);
1957         return executeDetectStackResourceDrift(request);
1958     }
1959
1960     @SdkInternalApi
1961     final DetectStackResourceDriftResult executeDetectStackResourceDrift(DetectStackResourceDriftRequest detectStackResourceDriftRequest) {
1962
1963         ExecutionContext executionContext = createExecutionContext(detectStackResourceDriftRequest);
1964         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1965         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1966         Request<DetectStackResourceDriftRequest> request = null;
1967         Response<DetectStackResourceDriftResult> response = null;
1968
1969         try {
1970             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1971             try {
1972                 request = new DetectStackResourceDriftRequestMarshaller().marshall(super.beforeMarshalling(detectStackResourceDriftRequest));
1973                 // Binds the request metrics to the current request.
1974                 request.setAWSRequestMetrics(awsRequestMetrics);
1975                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
1976                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
1977                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DetectStackResourceDrift");
1978                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1979
1980             } finally {
1981                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1982             }
1983
1984             StaxResponseHandler<DetectStackResourceDriftResult> responseHandler = new StaxResponseHandler<DetectStackResourceDriftResult>(
1985                     new DetectStackResourceDriftResultStaxUnmarshaller());
1986             response = invoke(request, responseHandler, executionContext);
1987
1988             return response.getAwsResponse();
1989
1990         } finally {
1991
1992             endClientExecution(awsRequestMetrics, request, response);
1993         }
1994     }
1995
1996     /**
1997      * <p>
1998      * Detect drift on a stack set. When CloudFormation performs drift detection on a stack set, it performs drift
1999      * detection on the stack associated with each stack instance in the stack set. For more information, see <a
2000      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html">How CloudFormation
2001      * Performs Drift Detection on a Stack Set</a>.
2002      * </p>
2003      * <p>
2004      * <code>DetectStackSetDrift</code> returns the <code>OperationId</code> of the stack set drift detection operation.
2005      * Use this operation id with <code> <a>DescribeStackSetOperation</a> </code> to monitor the progress of the drift
2006      * detection operation. The drift detection operation may take some time, depending on the number of stack instances
2007      * included in the stack set, as well as the number of resources included in each stack.
2008      * </p>
2009      * <p>
2010      * Once the operation has completed, use the following actions to return drift information:
2011      * </p>
2012      * <ul>
2013      * <li>
2014      * <p>
2015      * Use <code> <a>DescribeStackSet</a> </code> to return detailed informaiton about the stack set, including detailed
2016      * information about the last <i>completed</i> drift operation performed on the stack set. (Information about drift
2017      * operations that are in progress is not included.)
2018      * </p>
2019      * </li>
2020      * <li>
2021      * <p>
2022      * Use <code> <a>ListStackInstances</a> </code> to return a list of stack instances belonging to the stack set,
2023      * including the drift status and last drift time checked of each instance.
2024      * </p>
2025      * </li>
2026      * <li>
2027      * <p>
2028      * Use <code> <a>DescribeStackInstance</a> </code> to return detailed information about a specific stack instance,
2029      * including its drift status and last drift time checked.
2030      * </p>
2031      * </li>
2032      * </ul>
2033      * <p>
2034      * For more information on performing a drift detection operation on a stack set, see <a
2035      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html">Detecting Unmanaged
2036      * Changes in Stack Sets</a>.
2037      * </p>
2038      * <p>
2039      * You can only run a single drift detection operation on a given stack set at one time.
2040      * </p>
2041      * <p>
2042      * To stop a drift detection stack set operation, use <code> <a>StopStackSetOperation</a> </code>.
2043      * </p>
2044      * 
2045      * @param detectStackSetDriftRequest
2046      * @return Result of the DetectStackSetDrift operation returned by the service.
2047      * @throws InvalidOperationException
2048      *         The specified operation isn't valid.
2049      * @throws OperationInProgressException
2050      *         Another operation is currently in progress for this stack set. Only one operation can be performed for a
2051      *         stack set at a given time.
2052      * @throws StackSetNotFoundException
2053      *         The specified stack set doesn't exist.
2054      * @sample AmazonCloudFormation.DetectStackSetDrift
2055      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DetectStackSetDrift"
2056      *      target="_top">AWS API Documentation</a>
2057      */

2058     @Override
2059     public DetectStackSetDriftResult detectStackSetDrift(DetectStackSetDriftRequest request) {
2060         request = beforeClientExecution(request);
2061         return executeDetectStackSetDrift(request);
2062     }
2063
2064     @SdkInternalApi
2065     final DetectStackSetDriftResult executeDetectStackSetDrift(DetectStackSetDriftRequest detectStackSetDriftRequest) {
2066
2067         ExecutionContext executionContext = createExecutionContext(detectStackSetDriftRequest);
2068         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2069         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2070         Request<DetectStackSetDriftRequest> request = null;
2071         Response<DetectStackSetDriftResult> response = null;
2072
2073         try {
2074             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2075             try {
2076                 request = new DetectStackSetDriftRequestMarshaller().marshall(super.beforeMarshalling(detectStackSetDriftRequest));
2077                 // Binds the request metrics to the current request.
2078                 request.setAWSRequestMetrics(awsRequestMetrics);
2079                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2080                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2081                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DetectStackSetDrift");
2082                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2083
2084             } finally {
2085                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2086             }
2087
2088             StaxResponseHandler<DetectStackSetDriftResult> responseHandler = new StaxResponseHandler<DetectStackSetDriftResult>(
2089                     new DetectStackSetDriftResultStaxUnmarshaller());
2090             response = invoke(request, responseHandler, executionContext);
2091
2092             return response.getAwsResponse();
2093
2094         } finally {
2095
2096             endClientExecution(awsRequestMetrics, request, response);
2097         }
2098     }
2099
2100     /**
2101      * <p>
2102      * Returns the estimated monthly cost of a template. The return value is an AWS Simple Monthly Calculator URL with a
2103      * query string that describes the resources required to run the template.
2104      * </p>
2105      * 
2106      * @param estimateTemplateCostRequest
2107      *        The input for an <a>EstimateTemplateCost</a> action.
2108      * @return Result of the EstimateTemplateCost operation returned by the service.
2109      * @sample AmazonCloudFormation.EstimateTemplateCost
2110      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/EstimateTemplateCost"
2111      *      target="_top">AWS API Documentation</a>
2112      */

2113     @Override
2114     public EstimateTemplateCostResult estimateTemplateCost(EstimateTemplateCostRequest request) {
2115         request = beforeClientExecution(request);
2116         return executeEstimateTemplateCost(request);
2117     }
2118
2119     @SdkInternalApi
2120     final EstimateTemplateCostResult executeEstimateTemplateCost(EstimateTemplateCostRequest estimateTemplateCostRequest) {
2121
2122         ExecutionContext executionContext = createExecutionContext(estimateTemplateCostRequest);
2123         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2124         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2125         Request<EstimateTemplateCostRequest> request = null;
2126         Response<EstimateTemplateCostResult> response = null;
2127
2128         try {
2129             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2130             try {
2131                 request = new EstimateTemplateCostRequestMarshaller().marshall(super.beforeMarshalling(estimateTemplateCostRequest));
2132                 // Binds the request metrics to the current request.
2133                 request.setAWSRequestMetrics(awsRequestMetrics);
2134                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2135                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2136                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EstimateTemplateCost");
2137                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2138
2139             } finally {
2140                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2141             }
2142
2143             StaxResponseHandler<EstimateTemplateCostResult> responseHandler = new StaxResponseHandler<EstimateTemplateCostResult>(
2144                     new EstimateTemplateCostResultStaxUnmarshaller());
2145             response = invoke(request, responseHandler, executionContext);
2146
2147             return response.getAwsResponse();
2148
2149         } finally {
2150
2151             endClientExecution(awsRequestMetrics, request, response);
2152         }
2153     }
2154
2155     @Override
2156     public EstimateTemplateCostResult estimateTemplateCost() {
2157         return estimateTemplateCost(new EstimateTemplateCostRequest());
2158     }
2159
2160     /**
2161      * <p>
2162      * Updates a stack using the input information that was provided when the specified change set was created. After
2163      * the call successfully completes, AWS CloudFormation starts updating the stack. Use the <a>DescribeStacks</a>
2164      * action to view the status of the update.
2165      * </p>
2166      * <p>
2167      * When you execute a change set, AWS CloudFormation deletes all other change sets associated with the stack because
2168      * they aren't valid for the updated stack.
2169      * </p>
2170      * <p>
2171      * If a stack policy is associated with the stack, AWS CloudFormation enforces the policy during the update. You
2172      * can't specify a temporary stack policy that overrides the current policy.
2173      * </p>
2174      * 
2175      * @param executeChangeSetRequest
2176      *        The input for the <a>ExecuteChangeSet</a> action.
2177      * @return Result of the ExecuteChangeSet operation returned by the service.
2178      * @throws InvalidChangeSetStatusException
2179      *         The specified change set can't be used to update the stack. For example, the change set status might be
2180      *         <code>CREATE_IN_PROGRESS</code>, or the stack status might be <code>UPDATE_IN_PROGRESS</code>.
2181      * @throws ChangeSetNotFoundException
2182      *         The specified change set name or ID doesn't exit. To view valid change sets for a stack, use the
2183      *         <code>ListChangeSets</code> action.
2184      * @throws InsufficientCapabilitiesException
2185      *         The template contains resources with capabilities that weren't specified in the Capabilities parameter.
2186      * @throws TokenAlreadyExistsException
2187      *         A client request token already exists.
2188      * @sample AmazonCloudFormation.ExecuteChangeSet
2189      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ExecuteChangeSet"
2190      *      target="_top">AWS API Documentation</a>
2191      */

2192     @Override
2193     public ExecuteChangeSetResult executeChangeSet(ExecuteChangeSetRequest request) {
2194         request = beforeClientExecution(request);
2195         return executeExecuteChangeSet(request);
2196     }
2197
2198     @SdkInternalApi
2199     final ExecuteChangeSetResult executeExecuteChangeSet(ExecuteChangeSetRequest executeChangeSetRequest) {
2200
2201         ExecutionContext executionContext = createExecutionContext(executeChangeSetRequest);
2202         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2203         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2204         Request<ExecuteChangeSetRequest> request = null;
2205         Response<ExecuteChangeSetResult> response = null;
2206
2207         try {
2208             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2209             try {
2210                 request = new ExecuteChangeSetRequestMarshaller().marshall(super.beforeMarshalling(executeChangeSetRequest));
2211                 // Binds the request metrics to the current request.
2212                 request.setAWSRequestMetrics(awsRequestMetrics);
2213                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2214                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2215                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ExecuteChangeSet");
2216                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2217
2218             } finally {
2219                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2220             }
2221
2222             StaxResponseHandler<ExecuteChangeSetResult> responseHandler = new StaxResponseHandler<ExecuteChangeSetResult>(
2223                     new ExecuteChangeSetResultStaxUnmarshaller());
2224             response = invoke(request, responseHandler, executionContext);
2225
2226             return response.getAwsResponse();
2227
2228         } finally {
2229
2230             endClientExecution(awsRequestMetrics, request, response);
2231         }
2232     }
2233
2234     /**
2235      * <p>
2236      * Returns the stack policy for a specified stack. If a stack doesn't have a policy, a null value is returned.
2237      * </p>
2238      * 
2239      * @param getStackPolicyRequest
2240      *        The input for the <a>GetStackPolicy</a> action.
2241      * @return Result of the GetStackPolicy operation returned by the service.
2242      * @sample AmazonCloudFormation.GetStackPolicy
2243      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetStackPolicy" target="_top">AWS
2244      *      API Documentation</a>
2245      */

2246     @Override
2247     public GetStackPolicyResult getStackPolicy(GetStackPolicyRequest request) {
2248         request = beforeClientExecution(request);
2249         return executeGetStackPolicy(request);
2250     }
2251
2252     @SdkInternalApi
2253     final GetStackPolicyResult executeGetStackPolicy(GetStackPolicyRequest getStackPolicyRequest) {
2254
2255         ExecutionContext executionContext = createExecutionContext(getStackPolicyRequest);
2256         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2257         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2258         Request<GetStackPolicyRequest> request = null;
2259         Response<GetStackPolicyResult> response = null;
2260
2261         try {
2262             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2263             try {
2264                 request = new GetStackPolicyRequestMarshaller().marshall(super.beforeMarshalling(getStackPolicyRequest));
2265                 // Binds the request metrics to the current request.
2266                 request.setAWSRequestMetrics(awsRequestMetrics);
2267                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2268                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2269                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetStackPolicy");
2270                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2271
2272             } finally {
2273                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2274             }
2275
2276             StaxResponseHandler<GetStackPolicyResult> responseHandler = new StaxResponseHandler<GetStackPolicyResult>(
2277                     new GetStackPolicyResultStaxUnmarshaller());
2278             response = invoke(request, responseHandler, executionContext);
2279
2280             return response.getAwsResponse();
2281
2282         } finally {
2283
2284             endClientExecution(awsRequestMetrics, request, response);
2285         }
2286     }
2287
2288     /**
2289      * <p>
2290      * Returns the template body for a specified stack. You can get the template for running or deleted stacks.
2291      * </p>
2292      * <p>
2293      * For deleted stacks, GetTemplate returns the template for up to 90 days after the stack has been deleted.
2294      * </p>
2295      * <note>
2296      * <p>
2297      * If the template does not exist, a <code>ValidationError</code> is returned.
2298      * </p>
2299      * </note>
2300      * 
2301      * @param getTemplateRequest
2302      *        The input for a <a>GetTemplate</a> action.
2303      * @return Result of the GetTemplate operation returned by the service.
2304      * @throws ChangeSetNotFoundException
2305      *         The specified change set name or ID doesn't exit. To view valid change sets for a stack, use the
2306      *         <code>ListChangeSets</code> action.
2307      * @sample AmazonCloudFormation.GetTemplate
2308      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplate" target="_top">AWS API
2309      *      Documentation</a>
2310      */

2311     @Override
2312     public GetTemplateResult getTemplate(GetTemplateRequest request) {
2313         request = beforeClientExecution(request);
2314         return executeGetTemplate(request);
2315     }
2316
2317     @SdkInternalApi
2318     final GetTemplateResult executeGetTemplate(GetTemplateRequest getTemplateRequest) {
2319
2320         ExecutionContext executionContext = createExecutionContext(getTemplateRequest);
2321         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2322         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2323         Request<GetTemplateRequest> request = null;
2324         Response<GetTemplateResult> response = null;
2325
2326         try {
2327             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2328             try {
2329                 request = new GetTemplateRequestMarshaller().marshall(super.beforeMarshalling(getTemplateRequest));
2330                 // Binds the request metrics to the current request.
2331                 request.setAWSRequestMetrics(awsRequestMetrics);
2332                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2333                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2334                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTemplate");
2335                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2336
2337             } finally {
2338                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2339             }
2340
2341             StaxResponseHandler<GetTemplateResult> responseHandler = new StaxResponseHandler<GetTemplateResult>(new GetTemplateResultStaxUnmarshaller());
2342             response = invoke(request, responseHandler, executionContext);
2343
2344             return response.getAwsResponse();
2345
2346         } finally {
2347
2348             endClientExecution(awsRequestMetrics, request, response);
2349         }
2350     }
2351
2352     /**
2353      * <p>
2354      * Returns information about a new or existing template. The <code>GetTemplateSummary</code> action is useful for
2355      * viewing parameter information, such as default parameter values and parameter types, before you create or update
2356      * a stack or stack set.
2357      * </p>
2358      * <p>
2359      * You can use the <code>GetTemplateSummary</code> action when you submit a template, or you can get template
2360      * information for a stack set, or a running or deleted stack.
2361      * </p>
2362      * <p>
2363      * For deleted stacks, <code>GetTemplateSummary</code> returns the template information for up to 90 days after the
2364      * stack has been deleted. If the template does not exist, a <code>ValidationError</code> is returned.
2365      * </p>
2366      * 
2367      * @param getTemplateSummaryRequest
2368      *        The input for the <a>GetTemplateSummary</a> action.
2369      * @return Result of the GetTemplateSummary operation returned by the service.
2370      * @throws StackSetNotFoundException
2371      *         The specified stack set doesn't exist.
2372      * @sample AmazonCloudFormation.GetTemplateSummary
2373      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/GetTemplateSummary"
2374      *      target="_top">AWS API Documentation</a>
2375      */

2376     @Override
2377     public GetTemplateSummaryResult getTemplateSummary(GetTemplateSummaryRequest request) {
2378         request = beforeClientExecution(request);
2379         return executeGetTemplateSummary(request);
2380     }
2381
2382     @SdkInternalApi
2383     final GetTemplateSummaryResult executeGetTemplateSummary(GetTemplateSummaryRequest getTemplateSummaryRequest) {
2384
2385         ExecutionContext executionContext = createExecutionContext(getTemplateSummaryRequest);
2386         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2387         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2388         Request<GetTemplateSummaryRequest> request = null;
2389         Response<GetTemplateSummaryResult> response = null;
2390
2391         try {
2392             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2393             try {
2394                 request = new GetTemplateSummaryRequestMarshaller().marshall(super.beforeMarshalling(getTemplateSummaryRequest));
2395                 // Binds the request metrics to the current request.
2396                 request.setAWSRequestMetrics(awsRequestMetrics);
2397                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2398                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2399                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTemplateSummary");
2400                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2401
2402             } finally {
2403                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2404             }
2405
2406             StaxResponseHandler<GetTemplateSummaryResult> responseHandler = new StaxResponseHandler<GetTemplateSummaryResult>(
2407                     new GetTemplateSummaryResultStaxUnmarshaller());
2408             response = invoke(request, responseHandler, executionContext);
2409
2410             return response.getAwsResponse();
2411
2412         } finally {
2413
2414             endClientExecution(awsRequestMetrics, request, response);
2415         }
2416     }
2417
2418     @Override
2419     public GetTemplateSummaryResult getTemplateSummary() {
2420         return getTemplateSummary(new GetTemplateSummaryRequest());
2421     }
2422
2423     /**
2424      * <p>
2425      * Returns the ID and status of each active change set for a stack. For example, AWS CloudFormation lists change
2426      * sets that are in the <code>CREATE_IN_PROGRESS</code> or <code>CREATE_PENDING</code> state.
2427      * </p>
2428      * 
2429      * @param listChangeSetsRequest
2430      *        The input for the <a>ListChangeSets</a> action.
2431      * @return Result of the ListChangeSets operation returned by the service.
2432      * @sample AmazonCloudFormation.ListChangeSets
2433      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListChangeSets" target="_top">AWS
2434      *      API Documentation</a>
2435      */

2436     @Override
2437     public ListChangeSetsResult listChangeSets(ListChangeSetsRequest request) {
2438         request = beforeClientExecution(request);
2439         return executeListChangeSets(request);
2440     }
2441
2442     @SdkInternalApi
2443     final ListChangeSetsResult executeListChangeSets(ListChangeSetsRequest listChangeSetsRequest) {
2444
2445         ExecutionContext executionContext = createExecutionContext(listChangeSetsRequest);
2446         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2447         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2448         Request<ListChangeSetsRequest> request = null;
2449         Response<ListChangeSetsResult> response = null;
2450
2451         try {
2452             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2453             try {
2454                 request = new ListChangeSetsRequestMarshaller().marshall(super.beforeMarshalling(listChangeSetsRequest));
2455                 // Binds the request metrics to the current request.
2456                 request.setAWSRequestMetrics(awsRequestMetrics);
2457                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2458                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2459                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListChangeSets");
2460                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2461
2462             } finally {
2463                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2464             }
2465
2466             StaxResponseHandler<ListChangeSetsResult> responseHandler = new StaxResponseHandler<ListChangeSetsResult>(
2467                     new ListChangeSetsResultStaxUnmarshaller());
2468             response = invoke(request, responseHandler, executionContext);
2469
2470             return response.getAwsResponse();
2471
2472         } finally {
2473
2474             endClientExecution(awsRequestMetrics, request, response);
2475         }
2476     }
2477
2478     /**
2479      * <p>
2480      * Lists all exported output values in the account and Region in which you call this action. Use this action to see
2481      * the exported output values that you can import into other stacks. To import values, use the <a href=
2482      * "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html">
2483      * <code>Fn::ImportValue</code> </a> function.
2484      * </p>
2485      * <p>
2486      * For more information, see <a
2487      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-exports.html"> AWS
2488      * CloudFormation Export Stack Output Values</a>.
2489      * </p>
2490      * 
2491      * @param listExportsRequest
2492      * @return Result of the ListExports operation returned by the service.
2493      * @sample AmazonCloudFormation.ListExports
2494      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListExports" target="_top">AWS API
2495      *      Documentation</a>
2496      */

2497     @Override
2498     public ListExportsResult listExports(ListExportsRequest request) {
2499         request = beforeClientExecution(request);
2500         return executeListExports(request);
2501     }
2502
2503     @SdkInternalApi
2504     final ListExportsResult executeListExports(ListExportsRequest listExportsRequest) {
2505
2506         ExecutionContext executionContext = createExecutionContext(listExportsRequest);
2507         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2508         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2509         Request<ListExportsRequest> request = null;
2510         Response<ListExportsResult> response = null;
2511
2512         try {
2513             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2514             try {
2515                 request = new ListExportsRequestMarshaller().marshall(super.beforeMarshalling(listExportsRequest));
2516                 // Binds the request metrics to the current request.
2517                 request.setAWSRequestMetrics(awsRequestMetrics);
2518                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2519                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2520                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListExports");
2521                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2522
2523             } finally {
2524                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2525             }
2526
2527             StaxResponseHandler<ListExportsResult> responseHandler = new StaxResponseHandler<ListExportsResult>(new ListExportsResultStaxUnmarshaller());
2528             response = invoke(request, responseHandler, executionContext);
2529
2530             return response.getAwsResponse();
2531
2532         } finally {
2533
2534             endClientExecution(awsRequestMetrics, request, response);
2535         }
2536     }
2537
2538     /**
2539      * <p>
2540      * Lists all stacks that are importing an exported output value. To modify or remove an exported output value, first
2541      * use this action to see which stacks are using it. To see the exported output values in your account, see
2542      * <a>ListExports</a>.
2543      * </p>
2544      * <p>
2545      * For more information about importing an exported output value, see the <a href=
2546      * "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html">
2547      * <code>Fn::ImportValue</code> </a> function.
2548      * </p>
2549      * 
2550      * @param listImportsRequest
2551      * @return Result of the ListImports operation returned by the service.
2552      * @sample AmazonCloudFormation.ListImports
2553      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListImports" target="_top">AWS API
2554      *      Documentation</a>
2555      */

2556     @Override
2557     public ListImportsResult listImports(ListImportsRequest request) {
2558         request = beforeClientExecution(request);
2559         return executeListImports(request);
2560     }
2561
2562     @SdkInternalApi
2563     final ListImportsResult executeListImports(ListImportsRequest listImportsRequest) {
2564
2565         ExecutionContext executionContext = createExecutionContext(listImportsRequest);
2566         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2567         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2568         Request<ListImportsRequest> request = null;
2569         Response<ListImportsResult> response = null;
2570
2571         try {
2572             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2573             try {
2574                 request = new ListImportsRequestMarshaller().marshall(super.beforeMarshalling(listImportsRequest));
2575                 // Binds the request metrics to the current request.
2576                 request.setAWSRequestMetrics(awsRequestMetrics);
2577                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2578                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2579                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListImports");
2580                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2581
2582             } finally {
2583                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2584             }
2585
2586             StaxResponseHandler<ListImportsResult> responseHandler = new StaxResponseHandler<ListImportsResult>(new ListImportsResultStaxUnmarshaller());
2587             response = invoke(request, responseHandler, executionContext);
2588
2589             return response.getAwsResponse();
2590
2591         } finally {
2592
2593             endClientExecution(awsRequestMetrics, request, response);
2594         }
2595     }
2596
2597     /**
2598      * <p>
2599      * Returns summary information about stack instances that are associated with the specified stack set. You can
2600      * filter for stack instances that are associated with a specific AWS account name or Region.
2601      * </p>
2602      * 
2603      * @param listStackInstancesRequest
2604      * @return Result of the ListStackInstances operation returned by the service.
2605      * @throws StackSetNotFoundException
2606      *         The specified stack set doesn't exist.
2607      * @sample AmazonCloudFormation.ListStackInstances
2608      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStackInstances"
2609      *      target="_top">AWS API Documentation</a>
2610      */

2611     @Override
2612     public ListStackInstancesResult listStackInstances(ListStackInstancesRequest request) {
2613         request = beforeClientExecution(request);
2614         return executeListStackInstances(request);
2615     }
2616
2617     @SdkInternalApi
2618     final ListStackInstancesResult executeListStackInstances(ListStackInstancesRequest listStackInstancesRequest) {
2619
2620         ExecutionContext executionContext = createExecutionContext(listStackInstancesRequest);
2621         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2622         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2623         Request<ListStackInstancesRequest> request = null;
2624         Response<ListStackInstancesResult> response = null;
2625
2626         try {
2627             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2628             try {
2629                 request = new ListStackInstancesRequestMarshaller().marshall(super.beforeMarshalling(listStackInstancesRequest));
2630                 // Binds the request metrics to the current request.
2631                 request.setAWSRequestMetrics(awsRequestMetrics);
2632                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2633                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2634                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListStackInstances");
2635                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2636
2637             } finally {
2638                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2639             }
2640
2641             StaxResponseHandler<ListStackInstancesResult> responseHandler = new StaxResponseHandler<ListStackInstancesResult>(
2642                     new ListStackInstancesResultStaxUnmarshaller());
2643             response = invoke(request, responseHandler, executionContext);
2644
2645             return response.getAwsResponse();
2646
2647         } finally {
2648
2649             endClientExecution(awsRequestMetrics, request, response);
2650         }
2651     }
2652
2653     /**
2654      * <p>
2655      * Returns descriptions of all resources of the specified stack.
2656      * </p>
2657      * <p>
2658      * For deleted stacks, ListStackResources returns resource information for up to 90 days after the stack has been
2659      * deleted.
2660      * </p>
2661      * 
2662      * @param listStackResourcesRequest
2663      *        The input for the <a>ListStackResource</a> action.
2664      * @return Result of the ListStackResources operation returned by the service.
2665      * @sample AmazonCloudFormation.ListStackResources
2666      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStackResources"
2667      *      target="_top">AWS API Documentation</a>
2668      */

2669     @Override
2670     public ListStackResourcesResult listStackResources(ListStackResourcesRequest request) {
2671         request = beforeClientExecution(request);
2672         return executeListStackResources(request);
2673     }
2674
2675     @SdkInternalApi
2676     final ListStackResourcesResult executeListStackResources(ListStackResourcesRequest listStackResourcesRequest) {
2677
2678         ExecutionContext executionContext = createExecutionContext(listStackResourcesRequest);
2679         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2680         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2681         Request<ListStackResourcesRequest> request = null;
2682         Response<ListStackResourcesResult> response = null;
2683
2684         try {
2685             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2686             try {
2687                 request = new ListStackResourcesRequestMarshaller().marshall(super.beforeMarshalling(listStackResourcesRequest));
2688                 // Binds the request metrics to the current request.
2689                 request.setAWSRequestMetrics(awsRequestMetrics);
2690                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2691                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2692                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListStackResources");
2693                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2694
2695             } finally {
2696                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2697             }
2698
2699             StaxResponseHandler<ListStackResourcesResult> responseHandler = new StaxResponseHandler<ListStackResourcesResult>(
2700                     new ListStackResourcesResultStaxUnmarshaller());
2701             response = invoke(request, responseHandler, executionContext);
2702
2703             return response.getAwsResponse();
2704
2705         } finally {
2706
2707             endClientExecution(awsRequestMetrics, request, response);
2708         }
2709     }
2710
2711     /**
2712      * <p>
2713      * Returns summary information about the results of a stack set operation.
2714      * </p>
2715      * 
2716      * @param listStackSetOperationResultsRequest
2717      * @return Result of the ListStackSetOperationResults operation returned by the service.
2718      * @throws StackSetNotFoundException
2719      *         The specified stack set doesn't exist.
2720      * @throws OperationNotFoundException
2721      *         The specified ID refers to an operation that doesn't exist.
2722      * @sample AmazonCloudFormation.ListStackSetOperationResults
2723      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStackSetOperationResults"
2724      *      target="_top">AWS API Documentation</a>
2725      */

2726     @Override
2727     public ListStackSetOperationResultsResult listStackSetOperationResults(ListStackSetOperationResultsRequest request) {
2728         request = beforeClientExecution(request);
2729         return executeListStackSetOperationResults(request);
2730     }
2731
2732     @SdkInternalApi
2733     final ListStackSetOperationResultsResult executeListStackSetOperationResults(ListStackSetOperationResultsRequest listStackSetOperationResultsRequest) {
2734
2735         ExecutionContext executionContext = createExecutionContext(listStackSetOperationResultsRequest);
2736         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2737         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2738         Request<ListStackSetOperationResultsRequest> request = null;
2739         Response<ListStackSetOperationResultsResult> response = null;
2740
2741         try {
2742             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2743             try {
2744                 request = new ListStackSetOperationResultsRequestMarshaller().marshall(super.beforeMarshalling(listStackSetOperationResultsRequest));
2745                 // Binds the request metrics to the current request.
2746                 request.setAWSRequestMetrics(awsRequestMetrics);
2747                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2748                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2749                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListStackSetOperationResults");
2750                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2751
2752             } finally {
2753                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2754             }
2755
2756             StaxResponseHandler<ListStackSetOperationResultsResult> responseHandler = new StaxResponseHandler<ListStackSetOperationResultsResult>(
2757                     new ListStackSetOperationResultsResultStaxUnmarshaller());
2758             response = invoke(request, responseHandler, executionContext);
2759
2760             return response.getAwsResponse();
2761
2762         } finally {
2763
2764             endClientExecution(awsRequestMetrics, request, response);
2765         }
2766     }
2767
2768     /**
2769      * <p>
2770      * Returns summary information about operations performed on a stack set.
2771      * </p>
2772      * 
2773      * @param listStackSetOperationsRequest
2774      * @return Result of the ListStackSetOperations operation returned by the service.
2775      * @throws StackSetNotFoundException
2776      *         The specified stack set doesn't exist.
2777      * @sample AmazonCloudFormation.ListStackSetOperations
2778      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStackSetOperations"
2779      *      target="_top">AWS API Documentation</a>
2780      */

2781     @Override
2782     public ListStackSetOperationsResult listStackSetOperations(ListStackSetOperationsRequest request) {
2783         request = beforeClientExecution(request);
2784         return executeListStackSetOperations(request);
2785     }
2786
2787     @SdkInternalApi
2788     final ListStackSetOperationsResult executeListStackSetOperations(ListStackSetOperationsRequest listStackSetOperationsRequest) {
2789
2790         ExecutionContext executionContext = createExecutionContext(listStackSetOperationsRequest);
2791         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2792         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2793         Request<ListStackSetOperationsRequest> request = null;
2794         Response<ListStackSetOperationsResult> response = null;
2795
2796         try {
2797             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2798             try {
2799                 request = new ListStackSetOperationsRequestMarshaller().marshall(super.beforeMarshalling(listStackSetOperationsRequest));
2800                 // Binds the request metrics to the current request.
2801                 request.setAWSRequestMetrics(awsRequestMetrics);
2802                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2803                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2804                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListStackSetOperations");
2805                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2806
2807             } finally {
2808                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2809             }
2810
2811             StaxResponseHandler<ListStackSetOperationsResult> responseHandler = new StaxResponseHandler<ListStackSetOperationsResult>(
2812                     new ListStackSetOperationsResultStaxUnmarshaller());
2813             response = invoke(request, responseHandler, executionContext);
2814
2815             return response.getAwsResponse();
2816
2817         } finally {
2818
2819             endClientExecution(awsRequestMetrics, request, response);
2820         }
2821     }
2822
2823     /**
2824      * <p>
2825      * Returns summary information about stack sets that are associated with the user.
2826      * </p>
2827      * 
2828      * @param listStackSetsRequest
2829      * @return Result of the ListStackSets operation returned by the service.
2830      * @sample AmazonCloudFormation.ListStackSets
2831      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStackSets" target="_top">AWS
2832      *      API Documentation</a>
2833      */

2834     @Override
2835     public ListStackSetsResult listStackSets(ListStackSetsRequest request) {
2836         request = beforeClientExecution(request);
2837         return executeListStackSets(request);
2838     }
2839
2840     @SdkInternalApi
2841     final ListStackSetsResult executeListStackSets(ListStackSetsRequest listStackSetsRequest) {
2842
2843         ExecutionContext executionContext = createExecutionContext(listStackSetsRequest);
2844         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2845         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2846         Request<ListStackSetsRequest> request = null;
2847         Response<ListStackSetsResult> response = null;
2848
2849         try {
2850             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2851             try {
2852                 request = new ListStackSetsRequestMarshaller().marshall(super.beforeMarshalling(listStackSetsRequest));
2853                 // Binds the request metrics to the current request.
2854                 request.setAWSRequestMetrics(awsRequestMetrics);
2855                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2856                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2857                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListStackSets");
2858                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2859
2860             } finally {
2861                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2862             }
2863
2864             StaxResponseHandler<ListStackSetsResult> responseHandler = new StaxResponseHandler<ListStackSetsResult>(new ListStackSetsResultStaxUnmarshaller());
2865             response = invoke(request, responseHandler, executionContext);
2866
2867             return response.getAwsResponse();
2868
2869         } finally {
2870
2871             endClientExecution(awsRequestMetrics, request, response);
2872         }
2873     }
2874
2875     /**
2876      * <p>
2877      * Returns the summary information for stacks whose status matches the specified StackStatusFilter. Summary
2878      * information for stacks that have been deleted is kept for 90 days after the stack is deleted. If no
2879      * StackStatusFilter is specified, summary information for all stacks is returned (including existing stacks and
2880      * stacks that have been deleted).
2881      * </p>
2882      * 
2883      * @param listStacksRequest
2884      *        The input for <a>ListStacks</a> action.
2885      * @return Result of the ListStacks operation returned by the service.
2886      * @sample AmazonCloudFormation.ListStacks
2887      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListStacks" target="_top">AWS API
2888      *      Documentation</a>
2889      */

2890     @Override
2891     public ListStacksResult listStacks(ListStacksRequest request) {
2892         request = beforeClientExecution(request);
2893         return executeListStacks(request);
2894     }
2895
2896     @SdkInternalApi
2897     final ListStacksResult executeListStacks(ListStacksRequest listStacksRequest) {
2898
2899         ExecutionContext executionContext = createExecutionContext(listStacksRequest);
2900         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2901         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2902         Request<ListStacksRequest> request = null;
2903         Response<ListStacksResult> response = null;
2904
2905         try {
2906             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2907             try {
2908                 request = new ListStacksRequestMarshaller().marshall(super.beforeMarshalling(listStacksRequest));
2909                 // Binds the request metrics to the current request.
2910                 request.setAWSRequestMetrics(awsRequestMetrics);
2911                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2912                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2913                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListStacks");
2914                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2915
2916             } finally {
2917                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2918             }
2919
2920             StaxResponseHandler<ListStacksResult> responseHandler = new StaxResponseHandler<ListStacksResult>(new ListStacksResultStaxUnmarshaller());
2921             response = invoke(request, responseHandler, executionContext);
2922
2923             return response.getAwsResponse();
2924
2925         } finally {
2926
2927             endClientExecution(awsRequestMetrics, request, response);
2928         }
2929     }
2930
2931     @Override
2932     public ListStacksResult listStacks() {
2933         return listStacks(new ListStacksRequest());
2934     }
2935
2936     /**
2937      * <p>
2938      * Returns a list of registration tokens for the specified type(s).
2939      * </p>
2940      * 
2941      * @param listTypeRegistrationsRequest
2942      * @return Result of the ListTypeRegistrations operation returned by the service.
2943      * @throws CFNRegistryException
2944      *         An error occurred during a CloudFormation registry operation.
2945      * @sample AmazonCloudFormation.ListTypeRegistrations
2946      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypeRegistrations"
2947      *      target="_top">AWS API Documentation</a>
2948      */

2949     @Override
2950     public ListTypeRegistrationsResult listTypeRegistrations(ListTypeRegistrationsRequest request) {
2951         request = beforeClientExecution(request);
2952         return executeListTypeRegistrations(request);
2953     }
2954
2955     @SdkInternalApi
2956     final ListTypeRegistrationsResult executeListTypeRegistrations(ListTypeRegistrationsRequest listTypeRegistrationsRequest) {
2957
2958         ExecutionContext executionContext = createExecutionContext(listTypeRegistrationsRequest);
2959         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
2960         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
2961         Request<ListTypeRegistrationsRequest> request = null;
2962         Response<ListTypeRegistrationsResult> response = null;
2963
2964         try {
2965             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
2966             try {
2967                 request = new ListTypeRegistrationsRequestMarshaller().marshall(super.beforeMarshalling(listTypeRegistrationsRequest));
2968                 // Binds the request metrics to the current request.
2969                 request.setAWSRequestMetrics(awsRequestMetrics);
2970                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
2971                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
2972                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTypeRegistrations");
2973                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
2974
2975             } finally {
2976                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
2977             }
2978
2979             StaxResponseHandler<ListTypeRegistrationsResult> responseHandler = new StaxResponseHandler<ListTypeRegistrationsResult>(
2980                     new ListTypeRegistrationsResultStaxUnmarshaller());
2981             response = invoke(request, responseHandler, executionContext);
2982
2983             return response.getAwsResponse();
2984
2985         } finally {
2986
2987             endClientExecution(awsRequestMetrics, request, response);
2988         }
2989     }
2990
2991     /**
2992      * <p>
2993      * Returns summary information about the versions of a type.
2994      * </p>
2995      * 
2996      * @param listTypeVersionsRequest
2997      * @return Result of the ListTypeVersions operation returned by the service.
2998      * @throws CFNRegistryException
2999      *         An error occurred during a CloudFormation registry operation.
3000      * @sample AmazonCloudFormation.ListTypeVersions
3001      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypeVersions"
3002      *      target="_top">AWS API Documentation</a>
3003      */

3004     @Override
3005     public ListTypeVersionsResult listTypeVersions(ListTypeVersionsRequest request) {
3006         request = beforeClientExecution(request);
3007         return executeListTypeVersions(request);
3008     }
3009
3010     @SdkInternalApi
3011     final ListTypeVersionsResult executeListTypeVersions(ListTypeVersionsRequest listTypeVersionsRequest) {
3012
3013         ExecutionContext executionContext = createExecutionContext(listTypeVersionsRequest);
3014         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3015         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3016         Request<ListTypeVersionsRequest> request = null;
3017         Response<ListTypeVersionsResult> response = null;
3018
3019         try {
3020             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3021             try {
3022                 request = new ListTypeVersionsRequestMarshaller().marshall(super.beforeMarshalling(listTypeVersionsRequest));
3023                 // Binds the request metrics to the current request.
3024                 request.setAWSRequestMetrics(awsRequestMetrics);
3025                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3026                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3027                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTypeVersions");
3028                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3029
3030             } finally {
3031                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3032             }
3033
3034             StaxResponseHandler<ListTypeVersionsResult> responseHandler = new StaxResponseHandler<ListTypeVersionsResult>(
3035                     new ListTypeVersionsResultStaxUnmarshaller());
3036             response = invoke(request, responseHandler, executionContext);
3037
3038             return response.getAwsResponse();
3039
3040         } finally {
3041
3042             endClientExecution(awsRequestMetrics, request, response);
3043         }
3044     }
3045
3046     /**
3047      * <p>
3048      * Returns summary information about types that have been registered with CloudFormation.
3049      * </p>
3050      * 
3051      * @param listTypesRequest
3052      * @return Result of the ListTypes operation returned by the service.
3053      * @throws CFNRegistryException
3054      *         An error occurred during a CloudFormation registry operation.
3055      * @sample AmazonCloudFormation.ListTypes
3056      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypes" target="_top">AWS API
3057      *      Documentation</a>
3058      */

3059     @Override
3060     public ListTypesResult listTypes(ListTypesRequest request) {
3061         request = beforeClientExecution(request);
3062         return executeListTypes(request);
3063     }
3064
3065     @SdkInternalApi
3066     final ListTypesResult executeListTypes(ListTypesRequest listTypesRequest) {
3067
3068         ExecutionContext executionContext = createExecutionContext(listTypesRequest);
3069         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3070         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3071         Request<ListTypesRequest> request = null;
3072         Response<ListTypesResult> response = null;
3073
3074         try {
3075             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3076             try {
3077                 request = new ListTypesRequestMarshaller().marshall(super.beforeMarshalling(listTypesRequest));
3078                 // Binds the request metrics to the current request.
3079                 request.setAWSRequestMetrics(awsRequestMetrics);
3080                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3081                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3082                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTypes");
3083                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3084
3085             } finally {
3086                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3087             }
3088
3089             StaxResponseHandler<ListTypesResult> responseHandler = new StaxResponseHandler<ListTypesResult>(new ListTypesResultStaxUnmarshaller());
3090             response = invoke(request, responseHandler, executionContext);
3091
3092             return response.getAwsResponse();
3093
3094         } finally {
3095
3096             endClientExecution(awsRequestMetrics, request, response);
3097         }
3098     }
3099
3100     /**
3101      * <p>
3102      * Reports progress of a resource handler to CloudFormation.
3103      * </p>
3104      * <p>
3105      * Reserved for use by the <a
3106      * href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html"
3107      * >CloudFormation CLI</a>. Do not use this API in your code.
3108      * </p>
3109      * 
3110      * @param recordHandlerProgressRequest
3111      * @return Result of the RecordHandlerProgress operation returned by the service.
3112      * @throws InvalidStateTransitionException
3113      *         Error reserved for use by the <a
3114      *         href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html"
3115      *         >CloudFormation CLI</a>. CloudFormation does not return this error to users.
3116      * @throws OperationStatusCheckFailedException
3117      *         Error reserved for use by the <a
3118      *         href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html"
3119      *         >CloudFormation CLI</a>. CloudFormation does not return this error to users.
3120      * @sample AmazonCloudFormation.RecordHandlerProgress
3121      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RecordHandlerProgress"
3122      *      target="_top">AWS API Documentation</a>
3123      */

3124     @Override
3125     public RecordHandlerProgressResult recordHandlerProgress(RecordHandlerProgressRequest request) {
3126         request = beforeClientExecution(request);
3127         return executeRecordHandlerProgress(request);
3128     }
3129
3130     @SdkInternalApi
3131     final RecordHandlerProgressResult executeRecordHandlerProgress(RecordHandlerProgressRequest recordHandlerProgressRequest) {
3132
3133         ExecutionContext executionContext = createExecutionContext(recordHandlerProgressRequest);
3134         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3135         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3136         Request<RecordHandlerProgressRequest> request = null;
3137         Response<RecordHandlerProgressResult> response = null;
3138
3139         try {
3140             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3141             try {
3142                 request = new RecordHandlerProgressRequestMarshaller().marshall(super.beforeMarshalling(recordHandlerProgressRequest));
3143                 // Binds the request metrics to the current request.
3144                 request.setAWSRequestMetrics(awsRequestMetrics);
3145                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3146                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3147                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RecordHandlerProgress");
3148                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3149
3150             } finally {
3151                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3152             }
3153
3154             StaxResponseHandler<RecordHandlerProgressResult> responseHandler = new StaxResponseHandler<RecordHandlerProgressResult>(
3155                     new RecordHandlerProgressResultStaxUnmarshaller());
3156             response = invoke(request, responseHandler, executionContext);
3157
3158             return response.getAwsResponse();
3159
3160         } finally {
3161
3162             endClientExecution(awsRequestMetrics, request, response);
3163         }
3164     }
3165
3166     /**
3167      * <p>
3168      * Registers a type with the CloudFormation service. Registering a type makes it available for use in CloudFormation
3169      * templates in your AWS account, and includes:
3170      * </p>
3171      * <ul>
3172      * <li>
3173      * <p>
3174      * Validating the resource schema
3175      * </p>
3176      * </li>
3177      * <li>
3178      * <p>
3179      * Determining which handlers have been specified for the resource
3180      * </p>
3181      * </li>
3182      * <li>
3183      * <p>
3184      * Making the resource type available for use in your account
3185      * </p>
3186      * </li>
3187      * </ul>
3188      * <p>
3189      * For more information on how to develop types and ready them for registeration, see <a
3190      * href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-types.html">Creating Resource
3191      * Providers</a> in the <i>CloudFormation CLI User Guide</i>.
3192      * </p>
3193      * <p>
3194      * You can have a maximum of 50 resource type versions registered at a time. This maximum is per account and per
3195      * region. Use <a href="AWSCloudFormation/latest/APIReference/API_DeregisterType.html">DeregisterType</a> to
3196      * deregister specific resource type versions if necessary.
3197      * </p>
3198      * <p>
3199      * Once you have initiated a registration request using <code> <a>RegisterType</a> </code>, you can use
3200      * <code> <a>DescribeTypeRegistration</a> </code> to monitor the progress of the registration request.
3201      * </p>
3202      * 
3203      * @param registerTypeRequest
3204      * @return Result of the RegisterType operation returned by the service.
3205      * @throws CFNRegistryException
3206      *         An error occurred during a CloudFormation registry operation.
3207      * @sample AmazonCloudFormation.RegisterType
3208      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RegisterType" target="_top">AWS
3209      *      API Documentation</a>
3210      */

3211     @Override
3212     public RegisterTypeResult registerType(RegisterTypeRequest request) {
3213         request = beforeClientExecution(request);
3214         return executeRegisterType(request);
3215     }
3216
3217     @SdkInternalApi
3218     final RegisterTypeResult executeRegisterType(RegisterTypeRequest registerTypeRequest) {
3219
3220         ExecutionContext executionContext = createExecutionContext(registerTypeRequest);
3221         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3222         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3223         Request<RegisterTypeRequest> request = null;
3224         Response<RegisterTypeResult> response = null;
3225
3226         try {
3227             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3228             try {
3229                 request = new RegisterTypeRequestMarshaller().marshall(super.beforeMarshalling(registerTypeRequest));
3230                 // Binds the request metrics to the current request.
3231                 request.setAWSRequestMetrics(awsRequestMetrics);
3232                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3233                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3234                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RegisterType");
3235                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3236
3237             } finally {
3238                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3239             }
3240
3241             StaxResponseHandler<RegisterTypeResult> responseHandler = new StaxResponseHandler<RegisterTypeResult>(new RegisterTypeResultStaxUnmarshaller());
3242             response = invoke(request, responseHandler, executionContext);
3243
3244             return response.getAwsResponse();
3245
3246         } finally {
3247
3248             endClientExecution(awsRequestMetrics, request, response);
3249         }
3250     }
3251
3252     /**
3253      * <p>
3254      * Sets a stack policy for a specified stack.
3255      * </p>
3256      * 
3257      * @param setStackPolicyRequest
3258      *        The input for the <a>SetStackPolicy</a> action.
3259      * @return Result of the SetStackPolicy operation returned by the service.
3260      * @sample AmazonCloudFormation.SetStackPolicy
3261      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicy" target="_top">AWS
3262      *      API Documentation</a>
3263      */

3264     @Override
3265     public SetStackPolicyResult setStackPolicy(SetStackPolicyRequest request) {
3266         request = beforeClientExecution(request);
3267         return executeSetStackPolicy(request);
3268     }
3269
3270     @SdkInternalApi
3271     final SetStackPolicyResult executeSetStackPolicy(SetStackPolicyRequest setStackPolicyRequest) {
3272
3273         ExecutionContext executionContext = createExecutionContext(setStackPolicyRequest);
3274         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3275         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3276         Request<SetStackPolicyRequest> request = null;
3277         Response<SetStackPolicyResult> response = null;
3278
3279         try {
3280             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3281             try {
3282                 request = new SetStackPolicyRequestMarshaller().marshall(super.beforeMarshalling(setStackPolicyRequest));
3283                 // Binds the request metrics to the current request.
3284                 request.setAWSRequestMetrics(awsRequestMetrics);
3285                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3286                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3287                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetStackPolicy");
3288                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3289
3290             } finally {
3291                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3292             }
3293
3294             StaxResponseHandler<SetStackPolicyResult> responseHandler = new StaxResponseHandler<SetStackPolicyResult>(
3295                     new SetStackPolicyResultStaxUnmarshaller());
3296             response = invoke(request, responseHandler, executionContext);
3297
3298             return response.getAwsResponse();
3299
3300         } finally {
3301
3302             endClientExecution(awsRequestMetrics, request, response);
3303         }
3304     }
3305
3306     /**
3307      * <p>
3308      * Specify the default version of a type. The default version of a type will be used in CloudFormation operations.
3309      * </p>
3310      * 
3311      * @param setTypeDefaultVersionRequest
3312      * @return Result of the SetTypeDefaultVersion operation returned by the service.
3313      * @throws CFNRegistryException
3314      *         An error occurred during a CloudFormation registry operation.
3315      * @throws TypeNotFoundException
3316      *         The specified type does not exist in the CloudFormation registry.
3317      * @sample AmazonCloudFormation.SetTypeDefaultVersion
3318      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetTypeDefaultVersion"
3319      *      target="_top">AWS API Documentation</a>
3320      */

3321     @Override
3322     public SetTypeDefaultVersionResult setTypeDefaultVersion(SetTypeDefaultVersionRequest request) {
3323         request = beforeClientExecution(request);
3324         return executeSetTypeDefaultVersion(request);
3325     }
3326
3327     @SdkInternalApi
3328     final SetTypeDefaultVersionResult executeSetTypeDefaultVersion(SetTypeDefaultVersionRequest setTypeDefaultVersionRequest) {
3329
3330         ExecutionContext executionContext = createExecutionContext(setTypeDefaultVersionRequest);
3331         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3332         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3333         Request<SetTypeDefaultVersionRequest> request = null;
3334         Response<SetTypeDefaultVersionResult> response = null;
3335
3336         try {
3337             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3338             try {
3339                 request = new SetTypeDefaultVersionRequestMarshaller().marshall(super.beforeMarshalling(setTypeDefaultVersionRequest));
3340                 // Binds the request metrics to the current request.
3341                 request.setAWSRequestMetrics(awsRequestMetrics);
3342                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3343                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3344                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetTypeDefaultVersion");
3345                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3346
3347             } finally {
3348                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3349             }
3350
3351             StaxResponseHandler<SetTypeDefaultVersionResult> responseHandler = new StaxResponseHandler<SetTypeDefaultVersionResult>(
3352                     new SetTypeDefaultVersionResultStaxUnmarshaller());
3353             response = invoke(request, responseHandler, executionContext);
3354
3355             return response.getAwsResponse();
3356
3357         } finally {
3358
3359             endClientExecution(awsRequestMetrics, request, response);
3360         }
3361     }
3362
3363     /**
3364      * <p>
3365      * Sends a signal to the specified resource with a success or failure status. You can use the SignalResource API in
3366      * conjunction with a creation policy or update policy. AWS CloudFormation doesn't proceed with a stack creation or
3367      * update until resources receive the required number of signals or the timeout period is exceeded. The
3368      * SignalResource API is useful in cases where you want to send signals from anywhere other than an Amazon EC2
3369      * instance.
3370      * </p>
3371      * 
3372      * @param signalResourceRequest
3373      *        The input for the <a>SignalResource</a> action.
3374      * @return Result of the SignalResource operation returned by the service.
3375      * @sample AmazonCloudFormation.SignalResource
3376      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SignalResource" target="_top">AWS
3377      *      API Documentation</a>
3378      */

3379     @Override
3380     public SignalResourceResult signalResource(SignalResourceRequest request) {
3381         request = beforeClientExecution(request);
3382         return executeSignalResource(request);
3383     }
3384
3385     @SdkInternalApi
3386     final SignalResourceResult executeSignalResource(SignalResourceRequest signalResourceRequest) {
3387
3388         ExecutionContext executionContext = createExecutionContext(signalResourceRequest);
3389         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3390         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3391         Request<SignalResourceRequest> request = null;
3392         Response<SignalResourceResult> response = null;
3393
3394         try {
3395             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3396             try {
3397                 request = new SignalResourceRequestMarshaller().marshall(super.beforeMarshalling(signalResourceRequest));
3398                 // Binds the request metrics to the current request.
3399                 request.setAWSRequestMetrics(awsRequestMetrics);
3400                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3401                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3402                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SignalResource");
3403                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3404
3405             } finally {
3406                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3407             }
3408
3409             StaxResponseHandler<SignalResourceResult> responseHandler = new StaxResponseHandler<SignalResourceResult>(
3410                     new SignalResourceResultStaxUnmarshaller());
3411             response = invoke(request, responseHandler, executionContext);
3412
3413             return response.getAwsResponse();
3414
3415         } finally {
3416
3417             endClientExecution(awsRequestMetrics, request, response);
3418         }
3419     }
3420
3421     /**
3422      * <p>
3423      * Stops an in-progress operation on a stack set and its associated stack instances.
3424      * </p>
3425      * 
3426      * @param stopStackSetOperationRequest
3427      * @return Result of the StopStackSetOperation operation returned by the service.
3428      * @throws StackSetNotFoundException
3429      *         The specified stack set doesn't exist.
3430      * @throws OperationNotFoundException
3431      *         The specified ID refers to an operation that doesn't exist.
3432      * @throws InvalidOperationException
3433      *         The specified operation isn't valid.
3434      * @sample AmazonCloudFormation.StopStackSetOperation
3435      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StopStackSetOperation"
3436      *      target="_top">AWS API Documentation</a>
3437      */

3438     @Override
3439     public StopStackSetOperationResult stopStackSetOperation(StopStackSetOperationRequest request) {
3440         request = beforeClientExecution(request);
3441         return executeStopStackSetOperation(request);
3442     }
3443
3444     @SdkInternalApi
3445     final StopStackSetOperationResult executeStopStackSetOperation(StopStackSetOperationRequest stopStackSetOperationRequest) {
3446
3447         ExecutionContext executionContext = createExecutionContext(stopStackSetOperationRequest);
3448         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3449         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3450         Request<StopStackSetOperationRequest> request = null;
3451         Response<StopStackSetOperationResult> response = null;
3452
3453         try {
3454             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3455             try {
3456                 request = new StopStackSetOperationRequestMarshaller().marshall(super.beforeMarshalling(stopStackSetOperationRequest));
3457                 // Binds the request metrics to the current request.
3458                 request.setAWSRequestMetrics(awsRequestMetrics);
3459                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3460                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3461                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopStackSetOperation");
3462                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3463
3464             } finally {
3465                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3466             }
3467
3468             StaxResponseHandler<StopStackSetOperationResult> responseHandler = new StaxResponseHandler<StopStackSetOperationResult>(
3469                     new StopStackSetOperationResultStaxUnmarshaller());
3470             response = invoke(request, responseHandler, executionContext);
3471
3472             return response.getAwsResponse();
3473
3474         } finally {
3475
3476             endClientExecution(awsRequestMetrics, request, response);
3477         }
3478     }
3479
3480     /**
3481      * <p>
3482      * Updates a stack as specified in the template. After the call completes successfully, the stack update starts. You
3483      * can check the status of the stack via the <a>DescribeStacks</a> action.
3484      * </p>
3485      * <p>
3486      * To get a copy of the template for an existing stack, you can use the <a>GetTemplate</a> action.
3487      * </p>
3488      * <p>
3489      * For more information about creating an update template, updating a stack, and monitoring the progress of the
3490      * update, see <a
3491      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.html">Updating a
3492      * Stack</a>.
3493      * </p>
3494      * 
3495      * @param updateStackRequest
3496      *        The input for an <a>UpdateStack</a> action.
3497      * @return Result of the UpdateStack operation returned by the service.
3498      * @throws InsufficientCapabilitiesException
3499      *         The template contains resources with capabilities that weren't specified in the Capabilities parameter.
3500      * @throws TokenAlreadyExistsException
3501      *         A client request token already exists.
3502      * @sample AmazonCloudFormation.UpdateStack
3503      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStack" target="_top">AWS API
3504      *      Documentation</a>
3505      */

3506     @Override
3507     public UpdateStackResult updateStack(UpdateStackRequest request) {
3508         request = beforeClientExecution(request);
3509         return executeUpdateStack(request);
3510     }
3511
3512     @SdkInternalApi
3513     final UpdateStackResult executeUpdateStack(UpdateStackRequest updateStackRequest) {
3514
3515         ExecutionContext executionContext = createExecutionContext(updateStackRequest);
3516         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3517         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3518         Request<UpdateStackRequest> request = null;
3519         Response<UpdateStackResult> response = null;
3520
3521         try {
3522             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3523             try {
3524                 request = new UpdateStackRequestMarshaller().marshall(super.beforeMarshalling(updateStackRequest));
3525                 // Binds the request metrics to the current request.
3526                 request.setAWSRequestMetrics(awsRequestMetrics);
3527                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3528                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3529                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateStack");
3530                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3531
3532             } finally {
3533                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3534             }
3535
3536             StaxResponseHandler<UpdateStackResult> responseHandler = new StaxResponseHandler<UpdateStackResult>(new UpdateStackResultStaxUnmarshaller());
3537             response = invoke(request, responseHandler, executionContext);
3538
3539             return response.getAwsResponse();
3540
3541         } finally {
3542
3543             endClientExecution(awsRequestMetrics, request, response);
3544         }
3545     }
3546
3547     /**
3548      * <p>
3549      * Updates the parameter values for stack instances for the specified accounts, within the specified Regions. A
3550      * stack instance refers to a stack in a specific account and Region.
3551      * </p>
3552      * <p>
3553      * You can only update stack instances in Regions and accounts where they already exist; to create additional stack
3554      * instances, use <a
3555      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackInstances.html"
3556      * >CreateStackInstances</a>.
3557      * </p>
3558      * <p>
3559      * During stack set updates, any parameters overridden for a stack instance are not updated, but retain their
3560      * overridden value.
3561      * </p>
3562      * <p>
3563      * You can only update the parameter <i>values</i> that are specified in the stack set; to add or delete a parameter
3564      * itself, use <a
3565      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html">UpdateStackSet
3566      * </a> to update the stack set template. If you add a parameter to a template, before you can override the
3567      * parameter value specified in the stack set you must first use <a
3568      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html"
3569      * >UpdateStackSet</a> to update all stack instances with the updated template and parameter value specified in the
3570      * stack set. Once a stack instance has been updated with the new parameter, you can then override the parameter
3571      * value using <code>UpdateStackInstances</code>.
3572      * </p>
3573      * 
3574      * @param updateStackInstancesRequest
3575      * @return Result of the UpdateStackInstances operation returned by the service.
3576      * @throws StackSetNotFoundException
3577      *         The specified stack set doesn't exist.
3578      * @throws StackInstanceNotFoundException
3579      *         The specified stack instance doesn't exist.
3580      * @throws OperationInProgressException
3581      *         Another operation is currently in progress for this stack set. Only one operation can be performed for a
3582      *         stack set at a given time.
3583      * @throws OperationIdAlreadyExistsException
3584      *         The specified operation ID already exists.
3585      * @throws StaleRequestException
3586      *         Another operation has been performed on this stack set since the specified operation was performed.
3587      * @throws InvalidOperationException
3588      *         The specified operation isn't valid.
3589      * @sample AmazonCloudFormation.UpdateStackInstances
3590      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackInstances"
3591      *      target="_top">AWS API Documentation</a>
3592      */

3593     @Override
3594     public UpdateStackInstancesResult updateStackInstances(UpdateStackInstancesRequest request) {
3595         request = beforeClientExecution(request);
3596         return executeUpdateStackInstances(request);
3597     }
3598
3599     @SdkInternalApi
3600     final UpdateStackInstancesResult executeUpdateStackInstances(UpdateStackInstancesRequest updateStackInstancesRequest) {
3601
3602         ExecutionContext executionContext = createExecutionContext(updateStackInstancesRequest);
3603         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3604         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3605         Request<UpdateStackInstancesRequest> request = null;
3606         Response<UpdateStackInstancesResult> response = null;
3607
3608         try {
3609             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3610             try {
3611                 request = new UpdateStackInstancesRequestMarshaller().marshall(super.beforeMarshalling(updateStackInstancesRequest));
3612                 // Binds the request metrics to the current request.
3613                 request.setAWSRequestMetrics(awsRequestMetrics);
3614                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3615                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3616                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateStackInstances");
3617                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3618
3619             } finally {
3620                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3621             }
3622
3623             StaxResponseHandler<UpdateStackInstancesResult> responseHandler = new StaxResponseHandler<UpdateStackInstancesResult>(
3624                     new UpdateStackInstancesResultStaxUnmarshaller());
3625             response = invoke(request, responseHandler, executionContext);
3626
3627             return response.getAwsResponse();
3628
3629         } finally {
3630
3631             endClientExecution(awsRequestMetrics, request, response);
3632         }
3633     }
3634
3635     /**
3636      * <p>
3637      * Updates the stack set, and associated stack instances in the specified accounts and Regions.
3638      * </p>
3639      * <p>
3640      * Even if the stack set operation created by updating the stack set fails (completely or partially, below or above
3641      * a specified failure tolerance), the stack set is updated with your changes. Subsequent
3642      * <a>CreateStackInstances</a> calls on the specified stack set use the updated stack set.
3643      * </p>
3644      * 
3645      * @param updateStackSetRequest
3646      * @return Result of the UpdateStackSet operation returned by the service.
3647      * @throws StackSetNotFoundException
3648      *         The specified stack set doesn't exist.
3649      * @throws OperationInProgressException
3650      *         Another operation is currently in progress for this stack set. Only one operation can be performed for a
3651      *         stack set at a given time.
3652      * @throws OperationIdAlreadyExistsException
3653      *         The specified operation ID already exists.
3654      * @throws StaleRequestException
3655      *         Another operation has been performed on this stack set since the specified operation was performed.
3656      * @throws InvalidOperationException
3657      *         The specified operation isn't valid.
3658      * @throws StackInstanceNotFoundException
3659      *         The specified stack instance doesn't exist.
3660      * @sample AmazonCloudFormation.UpdateStackSet
3661      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackSet" target="_top">AWS
3662      *      API Documentation</a>
3663      */

3664     @Override
3665     public UpdateStackSetResult updateStackSet(UpdateStackSetRequest request) {
3666         request = beforeClientExecution(request);
3667         return executeUpdateStackSet(request);
3668     }
3669
3670     @SdkInternalApi
3671     final UpdateStackSetResult executeUpdateStackSet(UpdateStackSetRequest updateStackSetRequest) {
3672
3673         ExecutionContext executionContext = createExecutionContext(updateStackSetRequest);
3674         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3675         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3676         Request<UpdateStackSetRequest> request = null;
3677         Response<UpdateStackSetResult> response = null;
3678
3679         try {
3680             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3681             try {
3682                 request = new UpdateStackSetRequestMarshaller().marshall(super.beforeMarshalling(updateStackSetRequest));
3683                 // Binds the request metrics to the current request.
3684                 request.setAWSRequestMetrics(awsRequestMetrics);
3685                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3686                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3687                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateStackSet");
3688                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3689
3690             } finally {
3691                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3692             }
3693
3694             StaxResponseHandler<UpdateStackSetResult> responseHandler = new StaxResponseHandler<UpdateStackSetResult>(
3695                     new UpdateStackSetResultStaxUnmarshaller());
3696             response = invoke(request, responseHandler, executionContext);
3697
3698             return response.getAwsResponse();
3699
3700         } finally {
3701
3702             endClientExecution(awsRequestMetrics, request, response);
3703         }
3704     }
3705
3706     /**
3707      * <p>
3708      * Updates termination protection for the specified stack. If a user attempts to delete a stack with termination
3709      * protection enabled, the operation fails and the stack remains unchanged. For more information, see <a
3710      * href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html">Protecting a
3711      * Stack From Being Deleted</a> in the <i>AWS CloudFormation User Guide</i>.
3712      * </p>
3713      * <p>
3714      * For <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html">nested
3715      * stacks</a>, termination protection is set on the root stack and cannot be changed directly on the nested stack.
3716      * </p>
3717      * 
3718      * @param updateTerminationProtectionRequest
3719      * @return Result of the UpdateTerminationProtection operation returned by the service.
3720      * @sample AmazonCloudFormation.UpdateTerminationProtection
3721      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateTerminationProtection"
3722      *      target="_top">AWS API Documentation</a>
3723      */

3724     @Override
3725     public UpdateTerminationProtectionResult updateTerminationProtection(UpdateTerminationProtectionRequest request) {
3726         request = beforeClientExecution(request);
3727         return executeUpdateTerminationProtection(request);
3728     }
3729
3730     @SdkInternalApi
3731     final UpdateTerminationProtectionResult executeUpdateTerminationProtection(UpdateTerminationProtectionRequest updateTerminationProtectionRequest) {
3732
3733         ExecutionContext executionContext = createExecutionContext(updateTerminationProtectionRequest);
3734         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3735         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3736         Request<UpdateTerminationProtectionRequest> request = null;
3737         Response<UpdateTerminationProtectionResult> response = null;
3738
3739         try {
3740             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3741             try {
3742                 request = new UpdateTerminationProtectionRequestMarshaller().marshall(super.beforeMarshalling(updateTerminationProtectionRequest));
3743                 // Binds the request metrics to the current request.
3744                 request.setAWSRequestMetrics(awsRequestMetrics);
3745                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3746                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3747                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateTerminationProtection");
3748                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3749
3750             } finally {
3751                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3752             }
3753
3754             StaxResponseHandler<UpdateTerminationProtectionResult> responseHandler = new StaxResponseHandler<UpdateTerminationProtectionResult>(
3755                     new UpdateTerminationProtectionResultStaxUnmarshaller());
3756             response = invoke(request, responseHandler, executionContext);
3757
3758             return response.getAwsResponse();
3759
3760         } finally {
3761
3762             endClientExecution(awsRequestMetrics, request, response);
3763         }
3764     }
3765
3766     /**
3767      * <p>
3768      * Validates a specified template. AWS CloudFormation first checks if the template is valid JSON. If it isn't, AWS
3769      * CloudFormation checks if the template is valid YAML. If both these checks fail, AWS CloudFormation returns a
3770      * template validation error.
3771      * </p>
3772      * 
3773      * @param validateTemplateRequest
3774      *        The input for <a>ValidateTemplate</a> action.
3775      * @return Result of the ValidateTemplate operation returned by the service.
3776      * @sample AmazonCloudFormation.ValidateTemplate
3777      * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplate"
3778      *      target="_top">AWS API Documentation</a>
3779      */

3780     @Override
3781     public ValidateTemplateResult validateTemplate(ValidateTemplateRequest request) {
3782         request = beforeClientExecution(request);
3783         return executeValidateTemplate(request);
3784     }
3785
3786     @SdkInternalApi
3787     final ValidateTemplateResult executeValidateTemplate(ValidateTemplateRequest validateTemplateRequest) {
3788
3789         ExecutionContext executionContext = createExecutionContext(validateTemplateRequest);
3790         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
3791         awsRequestMetrics.startEvent(Field.ClientExecuteTime);
3792         Request<ValidateTemplateRequest> request = null;
3793         Response<ValidateTemplateResult> response = null;
3794
3795         try {
3796             awsRequestMetrics.startEvent(Field.RequestMarshallTime);
3797             try {
3798                 request = new ValidateTemplateRequestMarshaller().marshall(super.beforeMarshalling(validateTemplateRequest));
3799                 // Binds the request metrics to the current request.
3800                 request.setAWSRequestMetrics(awsRequestMetrics);
3801                 request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
3802                 request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");
3803                 request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ValidateTemplate");
3804                 request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
3805
3806             } finally {
3807                 awsRequestMetrics.endEvent(Field.RequestMarshallTime);
3808             }
3809
3810             StaxResponseHandler<ValidateTemplateResult> responseHandler = new StaxResponseHandler<ValidateTemplateResult>(
3811                     new ValidateTemplateResultStaxUnmarshaller());
3812             response = invoke(request, responseHandler, executionContext);
3813
3814             return response.getAwsResponse();
3815
3816         } finally {
3817
3818             endClientExecution(awsRequestMetrics, request, response);
3819         }
3820     }
3821
3822     /**
3823      * Returns additional metadata for a previously executed successful, request, typically used for debugging issues
3824      * where a service isn't acting as expected. This data isn't considered part of the result data returned by an
3825      * operation, so it's available through this separate, diagnostic interface.
3826      * <p>
3827      * Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic
3828      * information for an executed request, you should use this method to retrieve it as soon as possible after
3829      * executing the request.
3830      *
3831      * @param request
3832      *        The originally executed request
3833      *
3834      * @return The response metadata for the specified request, or null if none is available.
3835      */

3836     public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
3837         return client.getResponseMetadataForRequest(request);
3838     }
3839
3840     /**
3841      * Normal invoke with authentication. Credentials are required and may be overriden at the request level.
3842      **/

3843     private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
3844             ExecutionContext executionContext) {
3845
3846         return invoke(request, responseHandler, executionContext, nullnull);
3847     }
3848
3849     /**
3850      * Normal invoke with authentication. Credentials are required and may be overriden at the request level.
3851      **/

3852     private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
3853             ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {
3854
3855         executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));
3856
3857         return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);
3858     }
3859
3860     /**
3861      * Invoke with no authentication. Credentials are not required and any credentials set on the client or request will
3862      * be ignored for this operation.
3863      **/

3864     private <X, Y extends AmazonWebServiceRequest> Response<X> anonymousInvoke(Request<Y> request,
3865             HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext) {
3866
3867         return doInvoke(request, responseHandler, executionContext, nullnull);
3868     }
3869
3870     /**
3871      * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
3872      * ExecutionContext beforehand.
3873      **/

3874     private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
3875             ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
3876
3877         if (discoveredEndpoint != null) {
3878             request.setEndpoint(discoveredEndpoint);
3879             request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
3880         } else if (uriFromEndpointTrait != null) {
3881             request.setEndpoint(uriFromEndpointTrait);
3882         } else {
3883             request.setEndpoint(endpoint);
3884         }
3885
3886         request.setTimeOffset(timeOffset);
3887
3888         DefaultErrorResponseHandler errorResponseHandler = new DefaultErrorResponseHandler(exceptionUnmarshallers);
3889
3890         return client.execute(request, responseHandler, errorResponseHandler, executionContext);
3891     }
3892
3893     @Override
3894     public AmazonCloudFormationWaiters waiters() {
3895         if (waiters == null) {
3896             synchronized (this) {
3897                 if (waiters == null) {
3898                     waiters = new AmazonCloudFormationWaiters(this);
3899                 }
3900             }
3901         }
3902         return waiters;
3903     }
3904
3905     @Override
3906     public void shutdown() {
3907         super.shutdown();
3908         if (waiters != null) {
3909             waiters.shutdown();
3910         }
3911     }
3912
3913 }
3914