diff --git a/Cargo.toml b/Cargo.toml index b60630d678e8..84dcde4be3cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [workspace] exclude = [ - "examples/lambda", - "examples/test-utils", "examples/examples", "examples/webassembly", + "examples/lambda", + "examples/test-utils", "examples/cross_service", - "tests/webassembly", - "tests/no-default-features" + "tests/no-default-features", + "tests/webassembly" ] members = [ "sdk/accessanalyzer", diff --git a/aws-models/cloudformation.json b/aws-models/cloudformation.json index 3f93316e0cec..09d2c3711b6e 100644 --- a/aws-models/cloudformation.json +++ b/aws-models/cloudformation.json @@ -1084,6 +1084,9 @@ { "target": "com.amazonaws.cloudformation#CreateChangeSet" }, + { + "target": "com.amazonaws.cloudformation#CreateGeneratedTemplate" + }, { "target": "com.amazonaws.cloudformation#CreateStack" }, @@ -1102,6 +1105,9 @@ { "target": "com.amazonaws.cloudformation#DeleteChangeSet" }, + { + "target": "com.amazonaws.cloudformation#DeleteGeneratedTemplate" + }, { "target": "com.amazonaws.cloudformation#DeleteStack" }, @@ -1123,12 +1129,18 @@ { "target": "com.amazonaws.cloudformation#DescribeChangeSetHooks" }, + { + "target": "com.amazonaws.cloudformation#DescribeGeneratedTemplate" + }, { "target": "com.amazonaws.cloudformation#DescribeOrganizationsAccess" }, { "target": "com.amazonaws.cloudformation#DescribePublisher" }, + { + "target": "com.amazonaws.cloudformation#DescribeResourceScan" + }, { "target": "com.amazonaws.cloudformation#DescribeStackDriftDetectionStatus" }, @@ -1177,6 +1189,9 @@ { "target": "com.amazonaws.cloudformation#ExecuteChangeSet" }, + { + "target": "com.amazonaws.cloudformation#GetGeneratedTemplate" + }, { "target": "com.amazonaws.cloudformation#GetStackPolicy" }, @@ -1195,9 +1210,21 @@ { "target": "com.amazonaws.cloudformation#ListExports" }, + { + "target": "com.amazonaws.cloudformation#ListGeneratedTemplates" + }, { "target": "com.amazonaws.cloudformation#ListImports" }, + { + "target": "com.amazonaws.cloudformation#ListResourceScanRelatedResources" + }, + { + "target": "com.amazonaws.cloudformation#ListResourceScanResources" + }, + { + "target": "com.amazonaws.cloudformation#ListResourceScans" + }, { "target": "com.amazonaws.cloudformation#ListStackInstanceResourceDrifts" }, @@ -1255,12 +1282,18 @@ { "target": "com.amazonaws.cloudformation#SignalResource" }, + { + "target": "com.amazonaws.cloudformation#StartResourceScan" + }, { "target": "com.amazonaws.cloudformation#StopStackSetOperation" }, { "target": "com.amazonaws.cloudformation#TestType" }, + { + "target": "com.amazonaws.cloudformation#UpdateGeneratedTemplate" + }, { "target": "com.amazonaws.cloudformation#UpdateStack" }, @@ -2330,6 +2363,23 @@ } } }, + "com.amazonaws.cloudformation#ConcurrentResourcesLimitExceededException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudformation#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ConcurrentResourcesLimitExceeded", + "httpResponseCode": 429 + }, + "smithy.api#documentation": "

No more than 5 generated templates can be in an InProgress or Pending status at one\n time. This error is also returned if a generated template that is in an InProgress or\n Pending status is attempted to be updated or deleted.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429 + } + }, "com.amazonaws.cloudformation#ConfigurationSchema": { "type": "string", "traits": { @@ -2581,6 +2631,103 @@ "smithy.api#output": {} } }, + "com.amazonaws.cloudformation#CreateGeneratedTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#CreateGeneratedTemplateInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#CreateGeneratedTemplateOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudformation#AlreadyExistsException" + }, + { + "target": "com.amazonaws.cloudformation#ConcurrentResourcesLimitExceededException" + }, + { + "target": "com.amazonaws.cloudformation#LimitExceededException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a template from existing resources that are not already managed with CloudFormation. You can check the status of\n the template generation using the DescribeGeneratedTemplate API action.

", + "smithy.api#examples": [ + { + "title": "To create a generated template", + "documentation": "This example creates a generated template with a resources file.", + "input": { + "Resources": [ + { + "ResourceType": "AWS::S3::Bucket", + "ResourceIdentifier": { + "BucketName": "jazz-bucket" + } + }, + { + "ResourceType": "AWS::EC2::DHCPOptions", + "ResourceIdentifier": { + "DhcpOptionsId": "random-id123" + } + } + ], + "GeneratedTemplateName": "JazzyTemplate" + }, + "output": { + "GeneratedTemplateId": "arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/88f09db1-d211-4cb7-964b-434e2b8469ca" + } + } + ] + } + }, + "com.amazonaws.cloudformation#CreateGeneratedTemplateInput": { + "type": "structure", + "members": { + "Resources": { + "target": "com.amazonaws.cloudformation#ResourceDefinitions", + "traits": { + "smithy.api#documentation": "

An optional list of resources to be included in the generated template.

\n

If no resources are specified,the template will be created without any resources. Resources can be added to the\n template using the UpdateGeneratedTemplate API action.

" + } + }, + "GeneratedTemplateName": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateName", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The name assigned to the generated template.

", + "smithy.api#required": {} + } + }, + "StackName": { + "target": "com.amazonaws.cloudformation#StackName", + "traits": { + "smithy.api#documentation": "

An optional name or ARN of a stack to use as the base stack for the generated template.

" + } + }, + "TemplateConfiguration": { + "target": "com.amazonaws.cloudformation#TemplateConfiguration", + "traits": { + "smithy.api#documentation": "

The configuration details of the generated template, including the DeletionPolicy and\n UpdateReplacePolicy.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.cloudformation#CreateGeneratedTemplateOutput": { + "type": "structure", + "members": { + "GeneratedTemplateId": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateId", + "traits": { + "smithy.api#documentation": "

The ID of the generated template.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.cloudformation#CreateStack": { "type": "operation", "input": { @@ -2651,7 +2798,7 @@ "TimeoutInMinutes": { "target": "com.amazonaws.cloudformation#TimeoutMinutes", "traits": { - "smithy.api#documentation": "

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback\n is not set or is set to false, the stack will be rolled back.

" + "smithy.api#documentation": "

The amount of time that can pass before the stack status becomes CREATE_FAILED; if\n DisableRollback is not set or is set to false, the stack will be rolled back.

" } }, "NotificationARNs": { @@ -3142,6 +3289,51 @@ "smithy.api#output": {} } }, + "com.amazonaws.cloudformation#DeleteGeneratedTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#DeleteGeneratedTemplateInput" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.amazonaws.cloudformation#ConcurrentResourcesLimitExceededException" + }, + { + "target": "com.amazonaws.cloudformation#GeneratedTemplateNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Deleted a generated template.

", + "smithy.api#examples": [ + { + "title": "To delete a generated template", + "documentation": "This example deletes a generated template", + "input": { + "GeneratedTemplateName": "JazzyTemplate" + } + } + ] + } + }, + "com.amazonaws.cloudformation#DeleteGeneratedTemplateInput": { + "type": "structure", + "members": { + "GeneratedTemplateName": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateName", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The name or Amazon Resource Name (ARN) of a generated template.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, "com.amazonaws.cloudformation#DeleteStack": { "type": "operation", "input": { @@ -3833,6 +4025,113 @@ "smithy.api#output": {} } }, + "com.amazonaws.cloudformation#DescribeGeneratedTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#DescribeGeneratedTemplateInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#DescribeGeneratedTemplateOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudformation#GeneratedTemplateNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Describes a generated template. The output includes details about the progress of the creation of a generated\n template started by a CreateGeneratedTemplate API action or the update of a generated template started\n with an UpdateGeneratedTemplate API action.

" + } + }, + "com.amazonaws.cloudformation#DescribeGeneratedTemplateInput": { + "type": "structure", + "members": { + "GeneratedTemplateName": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateName", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The name or Amazon Resource Name (ARN) of a generated template.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.cloudformation#DescribeGeneratedTemplateOutput": { + "type": "structure", + "members": { + "GeneratedTemplateId": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateId", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the generated template. The format is\n arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example,\n arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc\n .

" + } + }, + "GeneratedTemplateName": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateName", + "traits": { + "smithy.api#documentation": "

The name of the generated template.

" + } + }, + "Resources": { + "target": "com.amazonaws.cloudformation#ResourceDetails", + "traits": { + "smithy.api#documentation": "

A list of objects describing the details of the resources in the template generation.

" + } + }, + "Status": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateStatus", + "traits": { + "smithy.api#documentation": "

The status of the template generation. Supported values are:

\n " + } + }, + "StatusReason": { + "target": "com.amazonaws.cloudformation#TemplateStatusReason", + "traits": { + "smithy.api#documentation": "

The reason for the current template generation status. This will provide more details if a failure\n happened.

" + } + }, + "CreationTime": { + "target": "com.amazonaws.cloudformation#CreationTime", + "traits": { + "smithy.api#documentation": "

The time the generated template was created.

" + } + }, + "LastUpdatedTime": { + "target": "com.amazonaws.cloudformation#LastUpdatedTime", + "traits": { + "smithy.api#documentation": "

The time the generated template was last updated.

" + } + }, + "Progress": { + "target": "com.amazonaws.cloudformation#TemplateProgress", + "traits": { + "smithy.api#documentation": "

An object describing the progress of the template generation.

" + } + }, + "StackId": { + "target": "com.amazonaws.cloudformation#StackId", + "traits": { + "smithy.api#documentation": "

The stack ARN of the base stack if a base stack was provided when generating the template.

" + } + }, + "TemplateConfiguration": { + "target": "com.amazonaws.cloudformation#TemplateConfiguration", + "traits": { + "smithy.api#documentation": "

The configuration details of the generated template, including the DeletionPolicy and\n UpdateReplacePolicy.

" + } + }, + "TotalWarnings": { + "target": "com.amazonaws.cloudformation#TotalWarnings", + "traits": { + "smithy.api#documentation": "

The number of warnings generated for this template. The warnings are found in the details of each of the\n resources in the template.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.cloudformation#DescribeOrganizationsAccess": { "type": "operation", "input": { @@ -3945,26 +4244,31 @@ "smithy.api#output": {} } }, - "com.amazonaws.cloudformation#DescribeStackDriftDetectionStatus": { + "com.amazonaws.cloudformation#DescribeResourceScan": { "type": "operation", "input": { - "target": "com.amazonaws.cloudformation#DescribeStackDriftDetectionStatusInput" + "target": "com.amazonaws.cloudformation#DescribeResourceScanInput" }, "output": { - "target": "com.amazonaws.cloudformation#DescribeStackDriftDetectionStatusOutput" + "target": "com.amazonaws.cloudformation#DescribeResourceScanOutput" }, + "errors": [ + { + "target": "com.amazonaws.cloudformation#ResourceScanNotFoundException" + } + ], "traits": { - "smithy.api#documentation": "

Returns information about a stack drift detection operation. A stack drift detection operation detects whether a\n stack's actual configuration differs, or has drifted, from its expected configuration, as\n defined in the stack template and any values specified as template parameters. A stack is considered to have drifted\n if one or more of its resources have drifted. For more information about stack and resource drift, see Detecting Unregulated\n Configuration Changes to Stacks and Resources.

\n

Use DetectStackDrift to initiate a stack drift detection operation.\n DetectStackDrift returns a StackDriftDetectionId you can use to monitor the progress of\n the operation using DescribeStackDriftDetectionStatus. Once the drift detection operation has completed,\n use DescribeStackResourceDrifts to return drift information about the stack and its\n resources.

" + "smithy.api#documentation": "

Describes details of a resource scan.

" } }, - "com.amazonaws.cloudformation#DescribeStackDriftDetectionStatusInput": { + "com.amazonaws.cloudformation#DescribeResourceScanInput": { "type": "structure", "members": { - "StackDriftDetectionId": { - "target": "com.amazonaws.cloudformation#StackDriftDetectionId", + "ResourceScanId": { + "target": "com.amazonaws.cloudformation#ResourceScanId", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The ID of the drift detection results of this operation.

\n

CloudFormation generates new results, with a new drift detection ID, each time this operation is run. However, the number\n of drift results CloudFormation retains for any given stack, and for how long, may vary.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource scan.

", "smithy.api#required": {} } } @@ -3973,57 +4277,61 @@ "smithy.api#input": {} } }, - "com.amazonaws.cloudformation#DescribeStackDriftDetectionStatusOutput": { + "com.amazonaws.cloudformation#DescribeResourceScanOutput": { "type": "structure", "members": { - "StackId": { - "target": "com.amazonaws.cloudformation#StackId", + "ResourceScanId": { + "target": "com.amazonaws.cloudformation#ResourceScanId", "traits": { - "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The ID of the stack.

", - "smithy.api#required": {} + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource scan. The format is\n arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is\n arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772\n .

" } }, - "StackDriftDetectionId": { - "target": "com.amazonaws.cloudformation#StackDriftDetectionId", + "Status": { + "target": "com.amazonaws.cloudformation#ResourceScanStatus", "traits": { - "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The ID of the drift detection results of this operation.

\n

CloudFormation generates new results, with a new drift detection ID, each time this operation is run. However, the number\n of reports CloudFormation retains for any given stack, and for how long, may vary.

", - "smithy.api#required": {} + "smithy.api#documentation": "

Status of the resource scan.

\n
\n
INPROGRESS
\n
\n

The resource scan is still in progress.

\n
\n
COMPLETE
\n
\n

The resource scan is complete.

\n
\n
EXPIRED
\n
\n

The resource scan has expired.

\n
\n
FAILED
\n
\n

The resource scan has failed.

\n
\n
" } }, - "StackDriftStatus": { - "target": "com.amazonaws.cloudformation#StackDriftStatus", + "StatusReason": { + "target": "com.amazonaws.cloudformation#ResourceScanStatusReason", "traits": { - "smithy.api#documentation": "

Status of the stack's actual configuration compared to its expected configuration.

\n " + "smithy.api#documentation": "

The reason for the resource scan status, providing more information if a failure happened.

" } }, - "DetectionStatus": { - "target": "com.amazonaws.cloudformation#StackDriftDetectionStatus", + "StartTime": { + "target": "com.amazonaws.cloudformation#Timestamp", "traits": { - "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The status of the stack drift detection operation.

\n ", - "smithy.api#required": {} + "smithy.api#documentation": "

The time that the resource scan was started.

" } }, - "DetectionStatusReason": { - "target": "com.amazonaws.cloudformation#StackDriftDetectionStatusReason", + "EndTime": { + "target": "com.amazonaws.cloudformation#Timestamp", "traits": { - "smithy.api#documentation": "

The reason the stack drift detection operation has its current status.

" + "smithy.api#documentation": "

The time that the resource scan was finished.

" } }, - "DriftedStackResourceCount": { - "target": "com.amazonaws.cloudformation#BoxedInteger", + "PercentageCompleted": { + "target": "com.amazonaws.cloudformation#PercentageCompleted", "traits": { - "smithy.api#documentation": "

Total number of stack resources that have drifted. This is NULL until the drift detection operation reaches a\n status of DETECTION_COMPLETE. This value will be 0 for stacks whose drift status is\n IN_SYNC.

" + "smithy.api#documentation": "

The percentage of the resource scan that has been completed.

" } }, - "Timestamp": { - "target": "com.amazonaws.cloudformation#Timestamp", + "ResourceTypes": { + "target": "com.amazonaws.cloudformation#ResourceTypes", "traits": { - "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

Time at which the stack drift detection operation was initiated.

", - "smithy.api#required": {} + "smithy.api#documentation": "

The list of resource types for the specified scan. Resource types are only available for scans with a\n Status set to COMPLETE or FAILED .

" + } + }, + "ResourcesScanned": { + "target": "com.amazonaws.cloudformation#ResourcesScanned", + "traits": { + "smithy.api#documentation": "

The number of resources that were listed. This is only available for scans with a Status set to\n COMPLETE, EXPIRED, or FAILED .

" + } + }, + "ResourcesRead": { + "target": "com.amazonaws.cloudformation#ResourcesRead", + "traits": { + "smithy.api#documentation": "

The number of resources that were read. This is only available for scans with a Status set to\n COMPLETE, EXPIRED, or FAILED .

\n \n

This field may be 0 if the resource scan failed with a ResourceScanLimitExceededException.

\n
" } } }, @@ -4031,13 +4339,99 @@ "smithy.api#output": {} } }, - "com.amazonaws.cloudformation#DescribeStackEvents": { + "com.amazonaws.cloudformation#DescribeStackDriftDetectionStatus": { "type": "operation", "input": { - "target": "com.amazonaws.cloudformation#DescribeStackEventsInput" + "target": "com.amazonaws.cloudformation#DescribeStackDriftDetectionStatusInput" }, "output": { - "target": "com.amazonaws.cloudformation#DescribeStackEventsOutput" + "target": "com.amazonaws.cloudformation#DescribeStackDriftDetectionStatusOutput" + }, + "traits": { + "smithy.api#documentation": "

Returns information about a stack drift detection operation. A stack drift detection operation detects whether a\n stack's actual configuration differs, or has drifted, from its expected configuration, as\n defined in the stack template and any values specified as template parameters. A stack is considered to have drifted\n if one or more of its resources have drifted. For more information about stack and resource drift, see Detecting Unregulated\n Configuration Changes to Stacks and Resources.

\n

Use DetectStackDrift to initiate a stack drift detection operation.\n DetectStackDrift returns a StackDriftDetectionId you can use to monitor the progress of\n the operation using DescribeStackDriftDetectionStatus. Once the drift detection operation has completed,\n use DescribeStackResourceDrifts to return drift information about the stack and its\n resources.

" + } + }, + "com.amazonaws.cloudformation#DescribeStackDriftDetectionStatusInput": { + "type": "structure", + "members": { + "StackDriftDetectionId": { + "target": "com.amazonaws.cloudformation#StackDriftDetectionId", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The ID of the drift detection results of this operation.

\n

CloudFormation generates new results, with a new drift detection ID, each time this operation is run. However, the number\n of drift results CloudFormation retains for any given stack, and for how long, may vary.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.cloudformation#DescribeStackDriftDetectionStatusOutput": { + "type": "structure", + "members": { + "StackId": { + "target": "com.amazonaws.cloudformation#StackId", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The ID of the stack.

", + "smithy.api#required": {} + } + }, + "StackDriftDetectionId": { + "target": "com.amazonaws.cloudformation#StackDriftDetectionId", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The ID of the drift detection results of this operation.

\n

CloudFormation generates new results, with a new drift detection ID, each time this operation is run. However, the number\n of reports CloudFormation retains for any given stack, and for how long, may vary.

", + "smithy.api#required": {} + } + }, + "StackDriftStatus": { + "target": "com.amazonaws.cloudformation#StackDriftStatus", + "traits": { + "smithy.api#documentation": "

Status of the stack's actual configuration compared to its expected configuration.

\n " + } + }, + "DetectionStatus": { + "target": "com.amazonaws.cloudformation#StackDriftDetectionStatus", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The status of the stack drift detection operation.

\n ", + "smithy.api#required": {} + } + }, + "DetectionStatusReason": { + "target": "com.amazonaws.cloudformation#StackDriftDetectionStatusReason", + "traits": { + "smithy.api#documentation": "

The reason the stack drift detection operation has its current status.

" + } + }, + "DriftedStackResourceCount": { + "target": "com.amazonaws.cloudformation#BoxedInteger", + "traits": { + "smithy.api#documentation": "

Total number of stack resources that have drifted. This is NULL until the drift detection operation reaches a\n status of DETECTION_COMPLETE. This value will be 0 for stacks whose drift status is\n IN_SYNC.

" + } + }, + "Timestamp": { + "target": "com.amazonaws.cloudformation#Timestamp", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

Time at which the stack drift detection operation was initiated.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.cloudformation#DescribeStackEvents": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#DescribeStackEventsInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#DescribeStackEventsOutput" }, "traits": { "smithy.api#documentation": "

Returns all stack related events for a specified stack in reverse chronological order. For more information\n about a stack's event history, go to Stacks in the\n CloudFormation User Guide.

\n \n

You can list events for stacks that have failed to create or have been deleted by specifying the unique stack\n identifier (stack ID).

\n
", @@ -5789,163 +6183,398 @@ } } }, - "com.amazonaws.cloudformation#GetStackPolicy": { - "type": "operation", - "input": { - "target": "com.amazonaws.cloudformation#GetStackPolicyInput" - }, - "output": { - "target": "com.amazonaws.cloudformation#GetStackPolicyOutput" - }, - "traits": { - "smithy.api#documentation": "

Returns the stack policy for a specified stack. If a stack doesn't have a policy, a null value is\n returned.

" - } - }, - "com.amazonaws.cloudformation#GetStackPolicyInput": { - "type": "structure", + "com.amazonaws.cloudformation#GeneratedTemplateDeletionPolicy": { + "type": "enum", "members": { - "StackName": { - "target": "com.amazonaws.cloudformation#StackName", + "DELETE": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The name or unique stack ID that's associated with the stack whose policy you want to get.

", - "smithy.api#required": {} + "smithy.api#enumValue": "DELETE" + } + }, + "RETAIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RETAIN" } } - }, - "traits": { - "smithy.api#documentation": "

The input for the GetStackPolicy action.

", - "smithy.api#input": {} } }, - "com.amazonaws.cloudformation#GetStackPolicyOutput": { - "type": "structure", - "members": { - "StackPolicyBody": { - "target": "com.amazonaws.cloudformation#StackPolicyBody", - "traits": { - "smithy.api#documentation": "

Structure containing the stack policy body. (For more information, go to Prevent Updates to Stack Resources in\n the CloudFormation User Guide.)

" - } + "com.amazonaws.cloudformation#GeneratedTemplateId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 } - }, + } + }, + "com.amazonaws.cloudformation#GeneratedTemplateName": { + "type": "string", "traits": { - "smithy.api#documentation": "

The output for the GetStackPolicy action.

", - "smithy.api#output": {} + "smithy.api#length": { + "min": 1, + "max": 128 + } } }, - "com.amazonaws.cloudformation#GetTemplate": { - "type": "operation", - "input": { - "target": "com.amazonaws.cloudformation#GetTemplateInput" - }, - "output": { - "target": "com.amazonaws.cloudformation#GetTemplateOutput" - }, - "errors": [ - { - "target": "com.amazonaws.cloudformation#ChangeSetNotFoundException" + "com.amazonaws.cloudformation#GeneratedTemplateNotFoundException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudformation#ErrorMessage" } - ], + }, "traits": { - "smithy.api#documentation": "

Returns the template body for a specified stack. You can get the template for running or deleted stacks.

\n

For deleted stacks, GetTemplate returns the template for up to 90 days after the stack has been\n deleted.

\n \n

If the template doesn't exist, a ValidationError is returned.

\n
" + "aws.protocols#awsQueryError": { + "code": "GeneratedTemplateNotFound", + "httpResponseCode": 404 + }, + "smithy.api#documentation": "

The generated template was not found.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 } }, - "com.amazonaws.cloudformation#GetTemplateInput": { - "type": "structure", + "com.amazonaws.cloudformation#GeneratedTemplateResourceStatus": { + "type": "enum", "members": { - "StackName": { - "target": "com.amazonaws.cloudformation#StackName", + "PENDING": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

The name or the unique stack ID that's associated with the stack, which aren't always interchangeable:

\n \n

Default: There is no default value.

" + "smithy.api#enumValue": "PENDING" } }, - "ChangeSetName": { - "target": "com.amazonaws.cloudformation#ChangeSetNameOrId", + "IN_PROGRESS": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

The name or Amazon Resource Name (ARN) of a change set for which CloudFormation returns the associated\n template. If you specify a name, you must also specify the StackName.

" + "smithy.api#enumValue": "IN_PROGRESS" } }, - "TemplateStage": { - "target": "com.amazonaws.cloudformation#TemplateStage", - "traits": { - "smithy.api#documentation": "

For templates that include transforms, the stage of the template that CloudFormation returns. To get the\n user-submitted template, specify Original. To get the template after CloudFormation has\n processed all transforms, specify Processed.

\n

If the template doesn't include transforms, Original and Processed return the same\n template. By default, CloudFormation specifies Processed.

" - } - } - }, - "traits": { - "smithy.api#documentation": "

The input for a GetTemplate action.

", - "smithy.api#input": {} - } - }, - "com.amazonaws.cloudformation#GetTemplateOutput": { - "type": "structure", - "members": { - "TemplateBody": { - "target": "com.amazonaws.cloudformation#TemplateBody", + "FAILED": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

Structure containing the template body. (For more information, go to Template Anatomy in the\n CloudFormation User Guide.)

\n

CloudFormation returns the same template that was used when the stack was created.

" + "smithy.api#enumValue": "FAILED" } }, - "StagesAvailable": { - "target": "com.amazonaws.cloudformation#StageList", + "COMPLETE": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

The stage of the template that you can retrieve. For stacks, the Original and\n Processed templates are always available. For change sets, the Original template is always\n available. After CloudFormation finishes creating the change set, the Processed template becomes\n available.

" + "smithy.api#enumValue": "COMPLETE" } } - }, - "traits": { - "smithy.api#documentation": "

The output for GetTemplate action.

", - "smithy.api#output": {} - } - }, - "com.amazonaws.cloudformation#GetTemplateSummary": { - "type": "operation", - "input": { - "target": "com.amazonaws.cloudformation#GetTemplateSummaryInput" - }, - "output": { - "target": "com.amazonaws.cloudformation#GetTemplateSummaryOutput" - }, - "errors": [ - { - "target": "com.amazonaws.cloudformation#StackSetNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Returns information about a new or existing template. The GetTemplateSummary action is useful for\n viewing parameter information, such as default parameter values and parameter types, before you create or update a\n stack or stack set.

\n

You can use the GetTemplateSummary action when you submit a template, or you can get template\n information for a stack set, or a running or deleted stack.

\n

For deleted stacks, GetTemplateSummary returns the template information for up to 90 days after the\n stack has been deleted. If the template doesn't exist, a ValidationError is returned.

" } }, - "com.amazonaws.cloudformation#GetTemplateSummaryInput": { - "type": "structure", + "com.amazonaws.cloudformation#GeneratedTemplateStatus": { + "type": "enum", "members": { - "TemplateBody": { - "target": "com.amazonaws.cloudformation#TemplateBody", + "CREATE_PENDING": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For\n more information about templates, see Template anatomy in the\n CloudFormation User Guide.

\n

Conditional: You must specify only one of the following parameters: StackName,\n StackSetName, TemplateBody, or TemplateURL.

" + "smithy.api#enumValue": "CREATE_PENDING" } }, - "TemplateURL": { - "target": "com.amazonaws.cloudformation#TemplateURL", + "UPDATE_PENDING": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

Location of file containing the template body. The URL must point to a template (max size: 460,800 bytes) that's\n located in an Amazon S3 bucket or a Systems Manager document. For more information about templates, see\n Template anatomy\n in the CloudFormation User Guide.

\n

Conditional: You must specify only one of the following parameters: StackName,\n StackSetName, TemplateBody, or TemplateURL.

" + "smithy.api#enumValue": "UPDATE_PENDING" } }, - "StackName": { - "target": "com.amazonaws.cloudformation#StackNameOrId", + "DELETE_PENDING": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

The name or the stack ID that's associated with the stack, which aren't always interchangeable. For running\n stacks, you can specify either the stack's name or its unique stack ID. For deleted stack, you must specify the\n unique stack ID.

\n

Conditional: You must specify only one of the following parameters: StackName,\n StackSetName, TemplateBody, or TemplateURL.

" + "smithy.api#enumValue": "DELETE_PENDING" } }, - "StackSetName": { - "target": "com.amazonaws.cloudformation#StackSetNameOrId", + "CREATE_IN_PROGRESS": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

The name or unique ID of the stack set from which the stack was created.

\n

Conditional: You must specify only one of the following parameters: StackName,\n StackSetName, TemplateBody, or TemplateURL.

" + "smithy.api#enumValue": "CREATE_IN_PROGRESS" } }, - "CallAs": { - "target": "com.amazonaws.cloudformation#CallAs", + "UPDATE_IN_PROGRESS": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

[Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's\n management account or as a delegated administrator in a member account.

\n

By default, SELF is specified. Use SELF for stack sets with self-managed\n permissions.

\n " + "smithy.api#enumValue": "UPDATE_IN_PROGRESS" + } + }, + "DELETE_IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETE_IN_PROGRESS" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "COMPLETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETE" + } + } + } + }, + "com.amazonaws.cloudformation#GeneratedTemplateUpdateReplacePolicy": { + "type": "enum", + "members": { + "DELETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETE" + } + }, + "RETAIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RETAIN" + } + } + } + }, + "com.amazonaws.cloudformation#GetGeneratedTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#GetGeneratedTemplateInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#GetGeneratedTemplateOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudformation#GeneratedTemplateNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves a generated template. If the template is in an InProgress or Pending status\n then the template returned will be the template when the template was last in a Complete status. If the\n template has not yet been in a Complete status then an empty template will be returned.

", + "smithy.api#examples": [ + { + "title": "To get a generated template in JSON format", + "documentation": "This example gets a generated template ins JSON format.", + "input": { + "GeneratedTemplateName": "JazzyTemplate" + }, + "output": { + "Status": "COMPLETE", + "TemplateBody": "{\"Metadata\":{\"TemplateId\":\"arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/*\"},\"Parameters\":{\"Stage\":{\"Default\":\"beta\",\"Type\":\"String\"}},\"Resources\":{\"TestRole\":{\"Properties\":{\"AssumeRolePolicyDocument\":{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":{\"Fn::Sub\":[\"arn:${AWS::Partition}:iam::${AccountId}:root\",{\"AccountId\":{\"Fn::AccountIdFromAlias\":\"test-account-alias\"}}]}},\"Action\":\"sts:AssumeRole\"}]}},\"Type\":\"AWS::IAM::Role\",\"DeletionPolicy\":\"Delete\"},\"DocumentationPartl7ob4vsd76vs\":{\"UpdateReplacePolicy\":\"Retain\",\"Type\":\"AWS::ApiGateway::DocumentationPart\",\"DeletionPolicy\":\"Retain\",\"Properties\":{\"RestApiId\":\"l7ob4vsd76\",\"Properties\":\"{\\n \\\"description\\\" : \\\"ListGeneratedTemplates 200 response\\\"\\n}\",\"Location\":{\"Path\":\"/ListGeneratedTemplates\",\"Type\":\"RESPONSE\",\"Method\":\"POST\",\"StatusCode\":\"200\"}}}}}" + } + }, + { + "title": "To get a generated template in YAML format", + "documentation": "This example gets a generated template in YAML format.", + "input": { + "GeneratedTemplateName": "JazzyTemplate", + "Format": "YAML" + }, + "output": { + "Status": "COMPLETE", + "TemplateBody": "---\nMetadata:\n TemplateId: \"arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/*\"\nParameters:\n Stage:\n Default: \"beta\"\n Type: \"String\"\nResources:\n TestRole:\n Properties:\n AssumeRolePolicyDocument:\n Version: \"2012-10-17\"\n Statement:\n - Effect: \"Allow\"\n Principal:\n AWS:\n Fn::Sub:\n - \"arn:${AWS::Partition}:iam::${AccountId}:root\"\n - AccountId:\n Fn::AccountIdFromAlias: \"test-account-alias\"\n Action: \"sts:AssumeRole\"\n Type: \"AWS::IAM::Role\"\n DeletionPolicy: \"Delete\"\n DocumentationPartl7ob4vsd76vsnAlFMLXKVm:\n UpdateReplacePolicy: \"Retain\"\n Type: \"AWS::ApiGateway::DocumentationPart\"\n DeletionPolicy: \"Retain\"\n Properties:\n RestApiId: \"l7ob4vsd76\"\n Properties: \"{\\n \\\"description\\\" : \\\"ListGeneratedTemplates 200 response\\\"\\n\\\n }\"\n Location:\n Path: \"/ListGeneratedTemplates\"\n Type: \"RESPONSE\"\n Method: \"POST\"\n StatusCode: \"200\"\n" + } + } + ] + } + }, + "com.amazonaws.cloudformation#GetGeneratedTemplateInput": { + "type": "structure", + "members": { + "Format": { + "target": "com.amazonaws.cloudformation#TemplateFormat", + "traits": { + "smithy.api#documentation": "

The language to use to retrieve for the generated template. Supported values are:

\n " + } + }, + "GeneratedTemplateName": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateName", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The name or Amazon Resource Name (ARN) of the generated template. The format is\n arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example,\n arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc\n .

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.cloudformation#GetGeneratedTemplateOutput": { + "type": "structure", + "members": { + "Status": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateStatus", + "traits": { + "smithy.api#documentation": "

The status of the template generation. Supported values are:

\n " + } + }, + "TemplateBody": { + "target": "com.amazonaws.cloudformation#TemplateBody", + "traits": { + "smithy.api#documentation": "

The template body of the generated template, in the language specified by the Language\n parameter.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.cloudformation#GetStackPolicy": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#GetStackPolicyInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#GetStackPolicyOutput" + }, + "traits": { + "smithy.api#documentation": "

Returns the stack policy for a specified stack. If a stack doesn't have a policy, a null value is\n returned.

" + } + }, + "com.amazonaws.cloudformation#GetStackPolicyInput": { + "type": "structure", + "members": { + "StackName": { + "target": "com.amazonaws.cloudformation#StackName", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The name or unique stack ID that's associated with the stack whose policy you want to get.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The input for the GetStackPolicy action.

", + "smithy.api#input": {} + } + }, + "com.amazonaws.cloudformation#GetStackPolicyOutput": { + "type": "structure", + "members": { + "StackPolicyBody": { + "target": "com.amazonaws.cloudformation#StackPolicyBody", + "traits": { + "smithy.api#documentation": "

Structure containing the stack policy body. (For more information, go to Prevent Updates to Stack Resources in\n the CloudFormation User Guide.)

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The output for the GetStackPolicy action.

", + "smithy.api#output": {} + } + }, + "com.amazonaws.cloudformation#GetTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#GetTemplateInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#GetTemplateOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudformation#ChangeSetNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns the template body for a specified stack. You can get the template for running or deleted stacks.

\n

For deleted stacks, GetTemplate returns the template for up to 90 days after the stack has been\n deleted.

\n \n

If the template doesn't exist, a ValidationError is returned.

\n
" + } + }, + "com.amazonaws.cloudformation#GetTemplateInput": { + "type": "structure", + "members": { + "StackName": { + "target": "com.amazonaws.cloudformation#StackName", + "traits": { + "smithy.api#documentation": "

The name or the unique stack ID that's associated with the stack, which aren't always interchangeable:

\n \n

Default: There is no default value.

" + } + }, + "ChangeSetName": { + "target": "com.amazonaws.cloudformation#ChangeSetNameOrId", + "traits": { + "smithy.api#documentation": "

The name or Amazon Resource Name (ARN) of a change set for which CloudFormation returns the associated\n template. If you specify a name, you must also specify the StackName.

" + } + }, + "TemplateStage": { + "target": "com.amazonaws.cloudformation#TemplateStage", + "traits": { + "smithy.api#documentation": "

For templates that include transforms, the stage of the template that CloudFormation returns. To get the\n user-submitted template, specify Original. To get the template after CloudFormation has\n processed all transforms, specify Processed.

\n

If the template doesn't include transforms, Original and Processed return the same\n template. By default, CloudFormation specifies Processed.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The input for a GetTemplate action.

", + "smithy.api#input": {} + } + }, + "com.amazonaws.cloudformation#GetTemplateOutput": { + "type": "structure", + "members": { + "TemplateBody": { + "target": "com.amazonaws.cloudformation#TemplateBody", + "traits": { + "smithy.api#documentation": "

Structure containing the template body. (For more information, go to Template Anatomy in the\n CloudFormation User Guide.)

\n

CloudFormation returns the same template that was used when the stack was created.

" + } + }, + "StagesAvailable": { + "target": "com.amazonaws.cloudformation#StageList", + "traits": { + "smithy.api#documentation": "

The stage of the template that you can retrieve. For stacks, the Original and\n Processed templates are always available. For change sets, the Original template is always\n available. After CloudFormation finishes creating the change set, the Processed template becomes\n available.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The output for GetTemplate action.

", + "smithy.api#output": {} + } + }, + "com.amazonaws.cloudformation#GetTemplateSummary": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#GetTemplateSummaryInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#GetTemplateSummaryOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudformation#StackSetNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about a new or existing template. The GetTemplateSummary action is useful for\n viewing parameter information, such as default parameter values and parameter types, before you create or update a\n stack or stack set.

\n

You can use the GetTemplateSummary action when you submit a template, or you can get template\n information for a stack set, or a running or deleted stack.

\n

For deleted stacks, GetTemplateSummary returns the template information for up to 90 days after the\n stack has been deleted. If the template doesn't exist, a ValidationError is returned.

" + } + }, + "com.amazonaws.cloudformation#GetTemplateSummaryInput": { + "type": "structure", + "members": { + "TemplateBody": { + "target": "com.amazonaws.cloudformation#TemplateBody", + "traits": { + "smithy.api#documentation": "

Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For\n more information about templates, see Template anatomy in the\n CloudFormation User Guide.

\n

Conditional: You must specify only one of the following parameters: StackName,\n StackSetName, TemplateBody, or TemplateURL.

" + } + }, + "TemplateURL": { + "target": "com.amazonaws.cloudformation#TemplateURL", + "traits": { + "smithy.api#documentation": "

Location of file containing the template body. The URL must point to a template (max size: 460,800 bytes) that's\n located in an Amazon S3 bucket or a Systems Manager document. For more information about templates, see\n Template anatomy\n in the CloudFormation User Guide.

\n

Conditional: You must specify only one of the following parameters: StackName,\n StackSetName, TemplateBody, or TemplateURL.

" + } + }, + "StackName": { + "target": "com.amazonaws.cloudformation#StackNameOrId", + "traits": { + "smithy.api#documentation": "

The name or the stack ID that's associated with the stack, which aren't always interchangeable. For running\n stacks, you can specify either the stack's name or its unique stack ID. For deleted stack, you must specify the\n unique stack ID.

\n

Conditional: You must specify only one of the following parameters: StackName,\n StackSetName, TemplateBody, or TemplateURL.

" + } + }, + "StackSetName": { + "target": "com.amazonaws.cloudformation#StackSetNameOrId", + "traits": { + "smithy.api#documentation": "

The name or unique ID of the stack set from which the stack was created.

\n

Conditional: You must specify only one of the following parameters: StackName,\n StackSetName, TemplateBody, or TemplateURL.

" + } + }, + "CallAs": { + "target": "com.amazonaws.cloudformation#CallAs", + "traits": { + "smithy.api#documentation": "

[Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's\n management account or as a delegated administrator in a member account.

\n

By default, SELF is specified. Use SELF for stack sets with self-managed\n permissions.

\n " } }, "TemplateSummaryConfig": { @@ -6512,6 +7141,33 @@ "com.amazonaws.cloudformation#IsDefaultVersion": { "type": "boolean" }, + "com.amazonaws.cloudformation#JazzLogicalResourceIds": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#LogicalResourceId" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 500 + } + } + }, + "com.amazonaws.cloudformation#JazzResourceIdentifierProperties": { + "type": "map", + "key": { + "target": "com.amazonaws.cloudformation#JazzResourceIdentifierPropertyKey" + }, + "value": { + "target": "com.amazonaws.cloudformation#JazzResourceIdentifierPropertyValue" + } + }, + "com.amazonaws.cloudformation#JazzResourceIdentifierPropertyKey": { + "type": "string" + }, + "com.amazonaws.cloudformation#JazzResourceIdentifierPropertyValue": { + "type": "string" + }, "com.amazonaws.cloudformation#Key": { "type": "string" }, @@ -6526,106 +7182,516 @@ } }, "traits": { - "aws.protocols#awsQueryError": { - "code": "LimitExceededException", - "httpResponseCode": 400 - }, - "smithy.api#documentation": "

The quota for the resource has already been reached.

\n

For information about resource and stack limitations, see CloudFormation quotas in the\n CloudFormation User Guide.

", - "smithy.api#error": "client", - "smithy.api#httpError": 400 + "aws.protocols#awsQueryError": { + "code": "LimitExceededException", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

The quota for the resource has already been reached.

\n

For information about resource and stack limitations, see CloudFormation quotas in the\n CloudFormation User Guide.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.cloudformation#LimitName": { + "type": "string" + }, + "com.amazonaws.cloudformation#LimitValue": { + "type": "integer" + }, + "com.amazonaws.cloudformation#ListChangeSets": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#ListChangeSetsInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#ListChangeSetsOutput" + }, + "traits": { + "smithy.api#documentation": "

Returns the ID and status of each active change set for a stack. For example, CloudFormation lists change\n sets that are in the CREATE_IN_PROGRESS or CREATE_PENDING state.

", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "items": "Summaries" + } + } + }, + "com.amazonaws.cloudformation#ListChangeSetsInput": { + "type": "structure", + "members": { + "StackName": { + "target": "com.amazonaws.cloudformation#StackNameOrId", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The name or the Amazon Resource Name (ARN) of the stack for which you want to list change sets.

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "com.amazonaws.cloudformation#NextToken", + "traits": { + "smithy.api#documentation": "

A string (provided by the ListChangeSets response output) that identifies the next page of\n change sets that you want to retrieve.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The input for the ListChangeSets action.

", + "smithy.api#input": {} + } + }, + "com.amazonaws.cloudformation#ListChangeSetsOutput": { + "type": "structure", + "members": { + "Summaries": { + "target": "com.amazonaws.cloudformation#ChangeSetSummaries", + "traits": { + "smithy.api#documentation": "

A list of ChangeSetSummary structures that provides the ID and status of each change set for the\n specified stack.

" + } + }, + "NextToken": { + "target": "com.amazonaws.cloudformation#NextToken", + "traits": { + "smithy.api#documentation": "

If the output exceeds 1 MB, a string that identifies the next page of change sets. If there is no additional\n page, this value is null.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The output for the ListChangeSets action.

", + "smithy.api#output": {} + } + }, + "com.amazonaws.cloudformation#ListExports": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#ListExportsInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#ListExportsOutput" + }, + "traits": { + "smithy.api#documentation": "

Lists all exported output values in the account and Region in which you call this action. Use this action to see\n the exported output values that you can import into other stacks. To import values, use the \n Fn::ImportValue function.

\n

For more information, see \n CloudFormation export stack output values.

", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "items": "Exports" + } + } + }, + "com.amazonaws.cloudformation#ListExportsInput": { + "type": "structure", + "members": { + "NextToken": { + "target": "com.amazonaws.cloudformation#NextToken", + "traits": { + "smithy.api#documentation": "

A string (provided by the ListExports response output) that identifies the next page of\n exported output values that you asked to retrieve.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.cloudformation#ListExportsOutput": { + "type": "structure", + "members": { + "Exports": { + "target": "com.amazonaws.cloudformation#Exports", + "traits": { + "smithy.api#documentation": "

The output for the ListExports action.

" + } + }, + "NextToken": { + "target": "com.amazonaws.cloudformation#NextToken", + "traits": { + "smithy.api#documentation": "

If the output exceeds 100 exported output values, a string that identifies the next page of exports. If there is\n no additional page, this value is null.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.cloudformation#ListGeneratedTemplates": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#ListGeneratedTemplatesInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#ListGeneratedTemplatesOutput" + }, + "traits": { + "smithy.api#documentation": "

Lists your generated templates in this Region.

", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "items": "Summaries", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.cloudformation#ListGeneratedTemplatesInput": { + "type": "structure", + "members": { + "NextToken": { + "target": "com.amazonaws.cloudformation#NextToken", + "traits": { + "smithy.api#documentation": "

A string that identifies the next page of resource scan results.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.cloudformation#MaxResults", + "traits": { + "smithy.api#documentation": "

If the number of available results exceeds this maximum, the response includes a NextToken value\n that you can use for the NextToken parameter to get the next set of results. By default the\n ListGeneratedTemplates API action will return at most 50 results in each response. The maximum value is\n 100.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.cloudformation#ListGeneratedTemplatesOutput": { + "type": "structure", + "members": { + "Summaries": { + "target": "com.amazonaws.cloudformation#TemplateSummaries", + "traits": { + "smithy.api#documentation": "

A list of summaries of the generated templates.

" + } + }, + "NextToken": { + "target": "com.amazonaws.cloudformation#NextToken", + "traits": { + "smithy.api#documentation": "

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve\n the next set of results, call ListGeneratedTemplates again and use that value for the\n NextToken parameter. If the request returns all results, NextToken is set to an empty\n string.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.cloudformation#ListImports": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#ListImportsInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#ListImportsOutput" + }, + "traits": { + "smithy.api#documentation": "

Lists all stacks that are importing an exported output value. To modify or remove an exported output value,\n first use this action to see which stacks are using it. To see the exported output values in your account, see ListExports.

\n

For more information about importing an exported output value, see the Fn::ImportValue\n function.

", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "items": "Imports" + } + } + }, + "com.amazonaws.cloudformation#ListImportsInput": { + "type": "structure", + "members": { + "ExportName": { + "target": "com.amazonaws.cloudformation#ExportName", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The name of the exported output value. CloudFormation returns the stack names that are importing this\n value.

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "com.amazonaws.cloudformation#NextToken", + "traits": { + "smithy.api#documentation": "

A string (provided by the ListImports response output) that identifies the next page of stacks\n that are importing the specified exported output value.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.cloudformation#ListImportsOutput": { + "type": "structure", + "members": { + "Imports": { + "target": "com.amazonaws.cloudformation#Imports", + "traits": { + "smithy.api#documentation": "

A list of stack names that are importing the specified exported output value.

" + } + }, + "NextToken": { + "target": "com.amazonaws.cloudformation#NextToken", + "traits": { + "smithy.api#documentation": "

A string that identifies the next page of exports. If there is no additional page, this value is null.

" + } + } + }, + "traits": { + "smithy.api#output": {} } }, - "com.amazonaws.cloudformation#LimitName": { - "type": "string" - }, - "com.amazonaws.cloudformation#LimitValue": { - "type": "integer" - }, - "com.amazonaws.cloudformation#ListChangeSets": { + "com.amazonaws.cloudformation#ListResourceScanRelatedResources": { "type": "operation", "input": { - "target": "com.amazonaws.cloudformation#ListChangeSetsInput" + "target": "com.amazonaws.cloudformation#ListResourceScanRelatedResourcesInput" }, "output": { - "target": "com.amazonaws.cloudformation#ListChangeSetsOutput" + "target": "com.amazonaws.cloudformation#ListResourceScanRelatedResourcesOutput" }, + "errors": [ + { + "target": "com.amazonaws.cloudformation#ResourceScanInProgressException" + }, + { + "target": "com.amazonaws.cloudformation#ResourceScanNotFoundException" + } + ], "traits": { - "smithy.api#documentation": "

Returns the ID and status of each active change set for a stack. For example, CloudFormation lists change\n sets that are in the CREATE_IN_PROGRESS or CREATE_PENDING state.

", + "smithy.api#documentation": "

Lists the related resources for a list of resources from a resource scan. The response indicates whether each\n returned resource is already managed by CloudFormation.

", + "smithy.api#examples": [ + { + "title": "To list resource scan related resources", + "documentation": "This example lists the resources related to the passed in resources", + "input": { + "ResourceScanId": "arn:aws:cloudformation:us-east-1:123456789012:resourceScan/c19304f6-c4f1-4ff8-8e1f-35162e41d7e1", + "Resources": [ + { + "ResourceType": "AWS::S3::Bucket", + "ResourceIdentifier": { + "BucketName": "jazz-bucket" + } + }, + { + "ResourceType": "AWS::EC2::DHCPOptions", + "ResourceIdentifier": { + "DhcpOptionsId": "random-id123" + } + } + ] + }, + "output": { + "RelatedResources": [ + { + "ResourceType": "AWS::EC2::VPCDHCPOptionsAssociation", + "ResourceIdentifier": { + "VpcId": "vpc-0123456abcdefg", + "DhcpOptionsId": "dopt-98765edcba" + }, + "ManagedByStack": false + }, + { + "ResourceType": "AWS::EC2::VPC", + "ResourceIdentifier": { + "VpcId": "vpc-0123456abcdefgabc" + }, + "ManagedByStack": false + }, + { + "ResourceType": "AWS::EC2::VPCDHCPOptionsAssociation", + "ResourceIdentifier": { + "VpcId": "vpc-123456abcdef", + "DhcpOptionsId": "dopt-98765edcba" + }, + "ManagedByStack": false + }, + { + "ResourceType": "AWS::EC2::VPC", + "ResourceIdentifier": { + "VpcId": "vpc-12345678abcd" + }, + "ManagedByStack": false + } + ] + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", - "items": "Summaries" + "items": "RelatedResources", + "pageSize": "MaxResults" } } }, - "com.amazonaws.cloudformation#ListChangeSetsInput": { + "com.amazonaws.cloudformation#ListResourceScanRelatedResourcesInput": { "type": "structure", "members": { - "StackName": { - "target": "com.amazonaws.cloudformation#StackNameOrId", + "ResourceScanId": { + "target": "com.amazonaws.cloudformation#ResourceScanId", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The name or the Amazon Resource Name (ARN) of the stack for which you want to list change sets.

", + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource scan.

", + "smithy.api#required": {} + } + }, + "Resources": { + "target": "com.amazonaws.cloudformation#ScannedResourceIdentifiers", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The list of resources for which you want to get the related resources. Up to 100 resources can be\n provided.

", "smithy.api#required": {} } }, "NextToken": { "target": "com.amazonaws.cloudformation#NextToken", "traits": { - "smithy.api#documentation": "

A string (provided by the ListChangeSets response output) that identifies the next page of\n change sets that you want to retrieve.

" + "smithy.api#documentation": "

A string that identifies the next page of resource scan results.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.cloudformation#BoxedMaxResults", + "traits": { + "smithy.api#documentation": "

If the number of available results exceeds this maximum, the response includes a NextToken value\n that you can use for the NextToken parameter to get the next set of results. By default the\n ListResourceScanRelatedResources API action will return up to 100 results in each response. The maximum\n value is 100.

" } } }, "traits": { - "smithy.api#documentation": "

The input for the ListChangeSets action.

", "smithy.api#input": {} } }, - "com.amazonaws.cloudformation#ListChangeSetsOutput": { + "com.amazonaws.cloudformation#ListResourceScanRelatedResourcesOutput": { "type": "structure", "members": { - "Summaries": { - "target": "com.amazonaws.cloudformation#ChangeSetSummaries", + "RelatedResources": { + "target": "com.amazonaws.cloudformation#RelatedResources", "traits": { - "smithy.api#documentation": "

A list of ChangeSetSummary structures that provides the ID and status of each change set for the\n specified stack.

" + "smithy.api#documentation": "

List of up to MaxResults resources in the specified resource scan related to the specified\n resources.

" } }, "NextToken": { "target": "com.amazonaws.cloudformation#NextToken", "traits": { - "smithy.api#documentation": "

If the output exceeds 1 MB, a string that identifies the next page of change sets. If there is no additional\n page, this value is null.

" + "smithy.api#documentation": "

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve\n the next set of results, call ListResourceScanRelatedResources again and use that value for the\n NextToken parameter. If the request returns all results, NextToken is set to an empty\n string.

" } } }, "traits": { - "smithy.api#documentation": "

The output for the ListChangeSets action.

", "smithy.api#output": {} } }, - "com.amazonaws.cloudformation#ListExports": { + "com.amazonaws.cloudformation#ListResourceScanResources": { "type": "operation", "input": { - "target": "com.amazonaws.cloudformation#ListExportsInput" + "target": "com.amazonaws.cloudformation#ListResourceScanResourcesInput" }, "output": { - "target": "com.amazonaws.cloudformation#ListExportsOutput" + "target": "com.amazonaws.cloudformation#ListResourceScanResourcesOutput" }, + "errors": [ + { + "target": "com.amazonaws.cloudformation#ResourceScanInProgressException" + }, + { + "target": "com.amazonaws.cloudformation#ResourceScanNotFoundException" + } + ], "traits": { - "smithy.api#documentation": "

Lists all exported output values in the account and Region in which you call this action. Use this action to see\n the exported output values that you can import into other stacks. To import values, use the \n Fn::ImportValue function.

\n

For more information, see \n CloudFormation export stack output values.

", + "smithy.api#documentation": "

Lists the resources from a resource scan. The results can be filtered by resource identifier, resource type\n prefix, tag key, and tag value. Only resources that match all specified filters are returned. The response indicates\n whether each returned resource is already managed by CloudFormation.

", + "smithy.api#examples": [ + { + "title": "To list the resources in your resource scan", + "documentation": "This example lists the resources in your resource scan", + "input": { + "ResourceScanId": "arn:aws:cloudformation:us-east-1:123456789012:resourceScan/c19304f6-c4f1-4ff8-8e1f-35162e41d7e1" + }, + "output": { + "Resources": [ + { + "ResourceType": "AWS::Amplify::App", + "ResourceIdentifier": { + "Arn": "arn:aws:amplify:us-east-1:123456789012:apps/12345678" + }, + "ManagedByStack": false + }, + { + "ResourceType": "AWS::ApiGateway::Deployment", + "ResourceIdentifier": { + "DeploymentId": "1234567", + "RestApiId": "abcdefgh" + }, + "ManagedByStack": true + } + ], + "NextToken": "AQICAHjOiFofVZCZ0aEN1VnF1m9jq/xxpTY7MyPexz72BHuAkgETVS8c+PVCFpE6uGVJDxCFAAACbjCCAmoGCSqGSIb3DQEHBqCCAlswggJXAgEAMIICUAYJKoZIhvcNAQcBMB4GCWCGSAFlAwQBLjARBAwJ9QJAYeDzUoBeimECARCAggIh8brcL6H6uMvcZafRTB79hUkdJlOoFavrhYA2U7qdlPUwyvaVqN2DvFMxsl2XC1SaWmr5esMKxg1fLjbOEF32lVQn0Jp8QuoFUvREnqEsR32ZQmiI/Oc9HmwIr/BS3rzljki2Kr8Y0nriS7aFDLUCYsdsRdQ9iL5/iCc6oW7IisCzq1VKcHijlXvuiEipZAinsxEbmYBjmWgT7UYZdrrb6Hq3COEgPzS490ucndtwPjyvuCIMiAfTLMuBgjkzEfp4U97aLwPWaiKw94dMXj/3K67uuH9BjWZO+j6d3nnyZ14FOgI7SQvvVBnxARbTmINttHWjXPrIuE9YuuSWgn6GmuzEEDqkuglOS/OeTHYSPvLPRrFieUiawblljLVoVY9/HDjL/EErSTWiCnytGXIRoMI9Ozp2Yjfm3MBwSDXvMIrscw6QAa3bUA6uJSV2skCBnDoqV8EXd8umh788OgEtDxQ7d/NlUYEhN6AJ0K9TVz/2rZgOlzLCmtvmbIy7loAZCmf/uPNkyu6WuoLWTzQz78SnA8jWPKnxrzhNyPuaIgUH23U3mExhfMRDczitpOo5JM81oHVPECslGoqktLhP55BQqMbJy4w16SZJfr993TXhF5jOZenRN1zDsK3J5cLdJgPK1Ds1Z9DnRKMfXOqoAyme2l94/h0kLIxgAtxOeJFP/g/9hUtt1qGkZeV3Xqw1nkFQnafGIg4fJoWg74Sr7yo=" + } + }, + { + "title": "To list the resources in your resource scan for specific resource type", + "documentation": "This example lists the resources in your resource scan filtering only the resources that start with the passed in prefix", + "input": { + "ResourceScanId": "arn:aws:cloudformation:us-east-1:123456789012:resourceScan/c19304f6-c4f1-4ff8-8e1f-35162e41d7e1", + "ResourceTypePrefix": "AWS::S3" + }, + "output": { + "Resources": [ + { + "ResourceType": "AWS::S3::AccessPoint", + "ResourceIdentifier": { + "Name": "test-access-point" + }, + "ManagedByStack": true + }, + { + "ResourceType": "AWS::S3::BucketPolicy", + "ResourceIdentifier": { + "Bucket": "a-random-bucket" + }, + "ManagedByStack": false + } + ], + "NextToken": "AQICAHjOiFofVZCZ0aEN1VnF1m9jq/xxpTY7MyPexz72BHuAkgETVS8c+PVCFpE6uGVJDxCFAAACbjCCAmoGCSqGSIb3DQEHBqCCAlswggJXAgEAMIICUAYJKoZIhvcNAQcBMB4GCWCGSAFlAwQBLjARBAwJ9QJAYeDzUoBeimECARCAggIh8brcL6H6uMvcZafRTB79hUkdJlOoFavrhYA2U7qdlPUwyvaVqN2DvFMxsl2XC1SaWmr5esMKxg1fLjbOEF32lVQn0Jp8QuoFUvREnqEsR32ZQmiI/Oc9HmwIr/BS3rzljki2Kr8Y0nriS7aFDLUCYsdsRdQ9iL5/iCc6oW7IisCzq1VKcHijlXvuiEipZAinsxEbmYBjmWgT7UYZdrrb6Hq3COEgPzS490ucndtwPjyvuCIMiAfTLMuBgjkzEfp4U97aLwPWaiKw94dMXj/3K67uuH9BjWZO+j6d3nnyZ14FOgI7SQvvVBnxARbTmINttHWjXPrIuE9YuuSWgn6GmuzEEDqkuglOS/OeTHYSPvLPRrFieUiawblljLVoVY9/HDjL/EErSTWiCnytGXIRoMI9Ozp2Yjfm3MBwSDXvMIrscw6QAa3bUA6uJSV2skCBnDoqV8EXd8umh788OgEtDxQ7d/NlUYEhN6AJ0K9TVz/2rZgOlzLCmtvmbIy7loAZCmf/uPNkyu6WuoLWTzQz78SnA8jWPKnxrzhNyPuaIgUH23U3mExhfMRDczitpOo5JM81oHVPECslGoqktLhP55BQqMbJy4w16SZJfr993TXhF5jOZenRN1zDsK3J5cLdJgPK1Ds1Z9DnRKMfXOqoAyme2l94/h0kLIxgAtxOeJFP/g/9hUtt1qGkZeV3Xqw1nkFQnafGIg4fJoWg74Sr7yo=" + } + } + ], "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", - "items": "Exports" + "items": "Resources", + "pageSize": "MaxResults" } } }, - "com.amazonaws.cloudformation#ListExportsInput": { + "com.amazonaws.cloudformation#ListResourceScanResourcesInput": { "type": "structure", "members": { + "ResourceScanId": { + "target": "com.amazonaws.cloudformation#ResourceScanId", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource scan.

", + "smithy.api#required": {} + } + }, + "ResourceIdentifier": { + "target": "com.amazonaws.cloudformation#ResourceIdentifier", + "traits": { + "smithy.api#documentation": "

If specified, the returned resources will have the specified resource identifier (or one of them in the case\n where the resource has multiple identifiers).

" + } + }, + "ResourceTypePrefix": { + "target": "com.amazonaws.cloudformation#ResourceTypePrefix", + "traits": { + "smithy.api#documentation": "

If specified, the returned resources will be of any of the resource types with the specified prefix.

" + } + }, + "TagKey": { + "target": "com.amazonaws.cloudformation#TagKey", + "traits": { + "smithy.api#documentation": "

If specified, the returned resources will have a matching tag key.

" + } + }, + "TagValue": { + "target": "com.amazonaws.cloudformation#TagValue", + "traits": { + "smithy.api#documentation": "

If specified, the returned resources will have a matching tag value.

" + } + }, "NextToken": { "target": "com.amazonaws.cloudformation#NextToken", "traits": { - "smithy.api#documentation": "

A string (provided by the ListExports response output) that identifies the next page of\n exported output values that you asked to retrieve.

" + "smithy.api#documentation": "

A string that identifies the next page of resource scan results.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.cloudformation#ResourceScannerMaxResults", + "traits": { + "smithy.api#documentation": "

If the number of available results exceeds this maximum, the response includes a NextToken value\n that you can use for the NextToken parameter to get the next set of results. By default the\n ListResourceScanResources API action will return at most 100 results in each response. The maximum value\n is 100.

" } } }, @@ -6633,19 +7699,19 @@ "smithy.api#input": {} } }, - "com.amazonaws.cloudformation#ListExportsOutput": { + "com.amazonaws.cloudformation#ListResourceScanResourcesOutput": { "type": "structure", "members": { - "Exports": { - "target": "com.amazonaws.cloudformation#Exports", + "Resources": { + "target": "com.amazonaws.cloudformation#ScannedResources", "traits": { - "smithy.api#documentation": "

The output for the ListExports action.

" + "smithy.api#documentation": "

List of up to MaxResults resources in the specified resource scan that match all of the specified\n filters.

" } }, "NextToken": { "target": "com.amazonaws.cloudformation#NextToken", "traits": { - "smithy.api#documentation": "

If the output exceeds 100 exported output values, a string that identifies the next page of exports. If there is\n no additional page, this value is null.

" + "smithy.api#documentation": "

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve\n the next set of results, call ListResourceScanResources again and use that value for the\n NextToken parameter. If the request returns all results, NextToken is set to an empty\n string.

" } } }, @@ -6653,38 +7719,37 @@ "smithy.api#output": {} } }, - "com.amazonaws.cloudformation#ListImports": { + "com.amazonaws.cloudformation#ListResourceScans": { "type": "operation", "input": { - "target": "com.amazonaws.cloudformation#ListImportsInput" + "target": "com.amazonaws.cloudformation#ListResourceScansInput" }, "output": { - "target": "com.amazonaws.cloudformation#ListImportsOutput" + "target": "com.amazonaws.cloudformation#ListResourceScansOutput" }, "traits": { - "smithy.api#documentation": "

Lists all stacks that are importing an exported output value. To modify or remove an exported output value,\n first use this action to see which stacks are using it. To see the exported output values in your account, see ListExports.

\n

For more information about importing an exported output value, see the Fn::ImportValue\n function.

", + "smithy.api#documentation": "

List the resource scans from newest to oldest. By default it will return up to 10 resource scans.

", "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", - "items": "Imports" + "items": "ResourceScanSummaries", + "pageSize": "MaxResults" } } }, - "com.amazonaws.cloudformation#ListImportsInput": { + "com.amazonaws.cloudformation#ListResourceScansInput": { "type": "structure", "members": { - "ExportName": { - "target": "com.amazonaws.cloudformation#ExportName", + "NextToken": { + "target": "com.amazonaws.cloudformation#NextToken", "traits": { - "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The name of the exported output value. CloudFormation returns the stack names that are importing this\n value.

", - "smithy.api#required": {} + "smithy.api#documentation": "

A string that identifies the next page of resource scan results.

" } }, - "NextToken": { - "target": "com.amazonaws.cloudformation#NextToken", + "MaxResults": { + "target": "com.amazonaws.cloudformation#ResourceScannerMaxResults", "traits": { - "smithy.api#documentation": "

A string (provided by the ListImports response output) that identifies the next page of stacks\n that are importing the specified exported output value.

" + "smithy.api#documentation": "

If the number of available results exceeds this maximum, the response includes a NextToken value\n that you can use for the NextToken parameter to get the next set of results. The default value is 10.\n The maximum value is 100.

" } } }, @@ -6692,19 +7757,19 @@ "smithy.api#input": {} } }, - "com.amazonaws.cloudformation#ListImportsOutput": { + "com.amazonaws.cloudformation#ListResourceScansOutput": { "type": "structure", "members": { - "Imports": { - "target": "com.amazonaws.cloudformation#Imports", + "ResourceScanSummaries": { + "target": "com.amazonaws.cloudformation#ResourceScanSummaries", "traits": { - "smithy.api#documentation": "

A list of stack names that are importing the specified exported output value.

" + "smithy.api#documentation": "

The list of scans returned.

" } }, "NextToken": { "target": "com.amazonaws.cloudformation#NextToken", "traits": { - "smithy.api#documentation": "

A string that identifies the next page of exports. If there is no additional page, this value is null.

" + "smithy.api#documentation": "

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve\n the next set of results, call ListResourceScans again and use that value for the NextToken\n parameter. If the request returns all results, NextToken is set to an empty string.

" } } }, @@ -7610,6 +8675,9 @@ } } }, + "com.amazonaws.cloudformation#ManagedByStack": { + "type": "boolean" + }, "com.amazonaws.cloudformation#ManagedExecution": { "type": "structure", "members": { @@ -7729,6 +8797,14 @@ } } }, + "com.amazonaws.cloudformation#NumberOfResources": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0 + } + } + }, "com.amazonaws.cloudformation#OnFailure": { "type": "enum", "members": { @@ -8124,6 +9200,9 @@ "target": "com.amazonaws.cloudformation#Parameter" } }, + "com.amazonaws.cloudformation#PercentageCompleted": { + "type": "double" + }, "com.amazonaws.cloudformation#PermissionModels": { "type": "enum", "members": { @@ -8193,6 +9272,9 @@ "com.amazonaws.cloudformation#Properties": { "type": "string" }, + "com.amazonaws.cloudformation#PropertyDescription": { + "type": "string" + }, "com.amazonaws.cloudformation#PropertyDifference": { "type": "structure", "members": { @@ -8479,6 +9561,9 @@ "smithy.api#output": {} } }, + "com.amazonaws.cloudformation#RefreshAllResources": { + "type": "boolean" + }, "com.amazonaws.cloudformation#Region": { "type": "string", "traits": { @@ -8702,6 +9787,12 @@ } } }, + "com.amazonaws.cloudformation#RelatedResources": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#ScannedResource" + } + }, "com.amazonaws.cloudformation#Replacement": { "type": "enum", "members": { @@ -8773,6 +9864,9 @@ "target": "com.amazonaws.cloudformation#RequiredActivatedType" } }, + "com.amazonaws.cloudformation#RequiredProperty": { + "type": "boolean" + }, "com.amazonaws.cloudformation#RequiresRecreation": { "type": "enum", "members": { @@ -8920,29 +10014,130 @@ "smithy.api#documentation": "

Indicates whether CloudFormation can determine the target value, and whether the target value will change\n before you execute a change set.

\n

For Static evaluations, CloudFormation can determine that the target value will change, and its\n value. For example, if you directly modify the InstanceType property of an EC2 instance, CloudFormation knows that this property value will change, and its value, so this is a Static\n evaluation.

\n

For Dynamic evaluations, can't determine the target value because it depends on the result of an\n intrinsic function, such as a Ref or Fn::GetAtt intrinsic function, when the stack is\n updated. For example, if your template includes a reference to a resource that's conditionally recreated, the value\n of the reference (the physical ID of the resource) might change, depending on if the resource is recreated. If the\n resource is recreated, it will have a new physical ID, so all references to that resource will also be\n updated.

" } }, - "ChangeSource": { - "target": "com.amazonaws.cloudformation#ChangeSource", + "ChangeSource": { + "target": "com.amazonaws.cloudformation#ChangeSource", + "traits": { + "smithy.api#documentation": "

The group to which the CausingEntity value belongs. There are five entity groups:

\n " + } + }, + "CausingEntity": { + "target": "com.amazonaws.cloudformation#CausingEntity", + "traits": { + "smithy.api#documentation": "

The identity of the entity that triggered this change. This entity is a member of the group that's specified by\n the ChangeSource field. For example, if you modified the value of the KeyPairName\n parameter, the CausingEntity is the name of the parameter (KeyPairName).

\n

If the ChangeSource value is DirectModification, no value is given for\n CausingEntity.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

For a resource with Modify as the action, the ResourceChange structure describes the\n changes CloudFormation will make to that resource.

" + } + }, + "com.amazonaws.cloudformation#ResourceChangeDetails": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#ResourceChangeDetail" + } + }, + "com.amazonaws.cloudformation#ResourceDefinition": { + "type": "structure", + "members": { + "ResourceType": { + "target": "com.amazonaws.cloudformation#ResourceType", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see\n IaC\n generator supported resource types in the CloudFormation User Guide\n

", + "smithy.api#required": {} + } + }, + "LogicalResourceId": { + "target": "com.amazonaws.cloudformation#LogicalResourceId", + "traits": { + "smithy.api#documentation": "

The logical resource id for this resource in the generated template.

" + } + }, + "ResourceIdentifier": { + "target": "com.amazonaws.cloudformation#ResourceIdentifierProperties", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the\n primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list\n in the resource schema.) The value is the value of that primary identifier. For example, for a\n AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair\n could be \"TableName\": \"MyDDBTable\". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension\n development.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

A resource included in a generated template. This data type is used with the\n CreateGeneratedTemplate and UpdateGeneratedTemplate API actions.

" + } + }, + "com.amazonaws.cloudformation#ResourceDefinitions": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#ResourceDefinition" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 500 + } + } + }, + "com.amazonaws.cloudformation#ResourceDetail": { + "type": "structure", + "members": { + "ResourceType": { + "target": "com.amazonaws.cloudformation#ResourceType", + "traits": { + "smithy.api#documentation": "

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see\n IaC\n generator supported resource types In the CloudFormation User Guide\n

" + } + }, + "LogicalResourceId": { + "target": "com.amazonaws.cloudformation#LogicalResourceId", + "traits": { + "smithy.api#documentation": "

The logical id for this resource in the final generated template.

" + } + }, + "ResourceIdentifier": { + "target": "com.amazonaws.cloudformation#ResourceIdentifierProperties", + "traits": { + "smithy.api#documentation": "

A list of up to 256 key-value pairs that identifies the resource in the generated template. The key is the name\n of one of the primary identifiers for the resource. (Primary identifiers are specified in the\n primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For\n example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the\n key-value pair could be \"TableName\": \"MyDDBTable\". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension\n development.

" + } + }, + "ResourceStatus": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateResourceStatus", + "traits": { + "smithy.api#documentation": "

Status of the processing of a resource in a generated template.

\n
\n
InProgress
\n
\n

The resource processing is still in progress.

\n
\n
Complete
\n
\n

The resource processing is complete.

\n
\n
Pending
\n
\n

The resource processing is pending.

\n
\n
Failed
\n
\n

The resource processing has failed.

\n
\n
" + } + }, + "ResourceStatusReason": { + "target": "com.amazonaws.cloudformation#ResourceStatusReason", "traits": { - "smithy.api#documentation": "

The group to which the CausingEntity value belongs. There are five entity groups:

\n " + "smithy.api#documentation": "

The reason for the resource detail, providing more information if a failure happened.

" } }, - "CausingEntity": { - "target": "com.amazonaws.cloudformation#CausingEntity", + "Warnings": { + "target": "com.amazonaws.cloudformation#WarningDetails", "traits": { - "smithy.api#documentation": "

The identity of the entity that triggered this change. This entity is a member of the group that's specified by\n the ChangeSource field. For example, if you modified the value of the KeyPairName\n parameter, the CausingEntity is the name of the parameter (KeyPairName).

\n

If the ChangeSource value is DirectModification, no value is given for\n CausingEntity.

" + "smithy.api#documentation": "

The warnings generated for this resource.

" } } }, "traits": { - "smithy.api#documentation": "

For a resource with Modify as the action, the ResourceChange structure describes the\n changes CloudFormation will make to that resource.

" + "smithy.api#documentation": "

Details about a resource in a generated template

" } }, - "com.amazonaws.cloudformation#ResourceChangeDetails": { + "com.amazonaws.cloudformation#ResourceDetails": { "type": "list", "member": { - "target": "com.amazonaws.cloudformation#ResourceChangeDetail" + "target": "com.amazonaws.cloudformation#ResourceDetail" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 500 + } } }, + "com.amazonaws.cloudformation#ResourceIdentifier": { + "type": "string" + }, "com.amazonaws.cloudformation#ResourceIdentifierProperties": { "type": "map", "key": { @@ -9026,6 +10221,145 @@ "com.amazonaws.cloudformation#ResourceProperties": { "type": "string" }, + "com.amazonaws.cloudformation#ResourceScanId": { + "type": "string" + }, + "com.amazonaws.cloudformation#ResourceScanInProgressException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudformation#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ResourceScanInProgress", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

A resource scan is currently in progress. Only one can be run at a time for an account in a Region.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.cloudformation#ResourceScanLimitExceededException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudformation#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ResourceScanLimitExceeded", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

The limit on resource scans has been exceeded. Reasons include:

\n ", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.cloudformation#ResourceScanNotFoundException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudformation#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "ResourceScanNotFound", + "httpResponseCode": 400 + }, + "smithy.api#documentation": "

The resource scan was not found.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.cloudformation#ResourceScanStatus": { + "type": "enum", + "members": { + "IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IN_PROGRESS" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "COMPLETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETE" + } + }, + "EXPIRED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EXPIRED" + } + } + } + }, + "com.amazonaws.cloudformation#ResourceScanStatusReason": { + "type": "string" + }, + "com.amazonaws.cloudformation#ResourceScanSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#ResourceScanSummary" + } + }, + "com.amazonaws.cloudformation#ResourceScanSummary": { + "type": "structure", + "members": { + "ResourceScanId": { + "target": "com.amazonaws.cloudformation#ResourceScanId", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource scan.

" + } + }, + "Status": { + "target": "com.amazonaws.cloudformation#ResourceScanStatus", + "traits": { + "smithy.api#documentation": "

Status of the resource scan.

\n
\n
INPROGRESS
\n
\n

The resource scan is still in progress.

\n
\n
COMPLETE
\n
\n

The resource scan is complete.

\n
\n
EXPIRED
\n
\n

The resource scan has expired.

\n
\n
FAILED
\n
\n

The resource scan has failed.

\n
\n
" + } + }, + "StatusReason": { + "target": "com.amazonaws.cloudformation#ResourceScanStatusReason", + "traits": { + "smithy.api#documentation": "

The reason for the resource scan status, providing more information if a failure happened.

" + } + }, + "StartTime": { + "target": "com.amazonaws.cloudformation#Timestamp", + "traits": { + "smithy.api#documentation": "

The time that the resource scan was started.

" + } + }, + "EndTime": { + "target": "com.amazonaws.cloudformation#Timestamp", + "traits": { + "smithy.api#documentation": "

The time that the resource scan was finished.

" + } + }, + "PercentageCompleted": { + "target": "com.amazonaws.cloudformation#PercentageCompleted", + "traits": { + "smithy.api#documentation": "

The percentage of the resource scan that has been completed.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A summary of the resource scan. This is returned by the ListResourceScan API action.

" + } + }, + "com.amazonaws.cloudformation#ResourceScannerMaxResults": { + "type": "integer" + }, "com.amazonaws.cloudformation#ResourceSignalStatus": { "type": "enum", "members": { @@ -9265,12 +10599,53 @@ } } }, + "com.amazonaws.cloudformation#ResourceTypePrefix": { + "type": "string" + }, "com.amazonaws.cloudformation#ResourceTypes": { "type": "list", "member": { "target": "com.amazonaws.cloudformation#ResourceType" } }, + "com.amazonaws.cloudformation#ResourcesFailed": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0 + } + } + }, + "com.amazonaws.cloudformation#ResourcesPending": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0 + } + } + }, + "com.amazonaws.cloudformation#ResourcesProcessing": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0 + } + } + }, + "com.amazonaws.cloudformation#ResourcesRead": { + "type": "integer" + }, + "com.amazonaws.cloudformation#ResourcesScanned": { + "type": "integer" + }, + "com.amazonaws.cloudformation#ResourcesSucceeded": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0 + } + } + }, "com.amazonaws.cloudformation#ResourcesToImport": { "type": "list", "member": { @@ -9466,6 +10841,68 @@ } } }, + "com.amazonaws.cloudformation#ScannedResource": { + "type": "structure", + "members": { + "ResourceType": { + "target": "com.amazonaws.cloudformation#ResourceType", + "traits": { + "smithy.api#documentation": "

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see\n IaC\n generator supported resource types In the CloudFormation User Guide\n

" + } + }, + "ResourceIdentifier": { + "target": "com.amazonaws.cloudformation#JazzResourceIdentifierProperties", + "traits": { + "smithy.api#documentation": "

A list of up to 256 key-value pairs that identifies for the scanned resource. The key is the name of one of the\n primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list\n in the resource schema.) The value is the value of that primary identifier. For example, for a\n AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair\n could be \"TableName\": \"MyDDBTable\". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension\n development.

" + } + }, + "ManagedByStack": { + "target": "com.amazonaws.cloudformation#ManagedByStack", + "traits": { + "smithy.api#documentation": "

If true, the resource is managed by a CloudFormation stack.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A scanned resource returned by ListResourceScanResources or\n ListResourceScanRelatedResources.

" + } + }, + "com.amazonaws.cloudformation#ScannedResourceIdentifier": { + "type": "structure", + "members": { + "ResourceType": { + "target": "com.amazonaws.cloudformation#ResourceType", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see\n IaC\n generator supported resource types In the CloudFormation User Guide\n

", + "smithy.api#required": {} + } + }, + "ResourceIdentifier": { + "target": "com.amazonaws.cloudformation#JazzResourceIdentifierProperties", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the\n primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list\n in the resource schema.) The value is the value of that primary identifier. For example, for a\n AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair\n could be \"TableName\": \"MyDDBTable\". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension\n development.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Identifies a scanned resource. This is used with the ListResourceScanRelatedResources API\n action.

" + } + }, + "com.amazonaws.cloudformation#ScannedResourceIdentifiers": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#ScannedResourceIdentifier" + } + }, + "com.amazonaws.cloudformation#ScannedResources": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#ScannedResource" + } + }, "com.amazonaws.cloudformation#Scope": { "type": "list", "member": { @@ -11387,7 +12824,7 @@ "RegionOrder": { "target": "com.amazonaws.cloudformation#RegionList", "traits": { - "smithy.api#documentation": "

The order of the Regions where you want to perform the stack operation.

" + "smithy.api#documentation": "

The order of the Regions where you want to perform the stack operation.

\n \n

\n RegionOrder isn't followed if AutoDeployment is enabled.

\n
" } }, "FailureToleranceCount": { @@ -11945,41 +13382,98 @@ "DriftInformation": { "target": "com.amazonaws.cloudformation#StackDriftInformationSummary", "traits": { - "smithy.api#documentation": "

Summarizes information about whether a stack's actual configuration differs, or has\n drifted, from its expected configuration, as defined in the stack template and any values\n specified as template parameters. For more information, see Detecting Unregulated Configuration Changes to\n Stacks and Resources.

" + "smithy.api#documentation": "

Summarizes information about whether a stack's actual configuration differs, or has\n drifted, from its expected configuration, as defined in the stack template and any values\n specified as template parameters. For more information, see Detecting Unregulated Configuration Changes to\n Stacks and Resources.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The StackSummary Data Type

" + } + }, + "com.amazonaws.cloudformation#Stacks": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#Stack" + } + }, + "com.amazonaws.cloudformation#StageList": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#TemplateStage" + } + }, + "com.amazonaws.cloudformation#StaleRequestException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.cloudformation#ErrorMessage" + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "StaleRequestException", + "httpResponseCode": 409 + }, + "smithy.api#documentation": "

Another operation has been performed on this stack set since the specified operation was performed.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.cloudformation#StartResourceScan": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#StartResourceScanInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#StartResourceScanOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudformation#ResourceScanInProgressException" + }, + { + "target": "com.amazonaws.cloudformation#ResourceScanLimitExceededException" + } + ], + "traits": { + "smithy.api#documentation": "

Starts a scan of the resources in this account in this Region. You can the status of a scan using the\n ListResourceScans API action.

", + "smithy.api#examples": [ + { + "title": "To start a resource scan", + "documentation": "This example shows how to start a new resource scan", + "output": { + "ResourceScanId": "arn:aws:cloudformation:us-east-1:123456789012:resourceScan/88f09db1-d211-4cb7-964b-434e2b8469ca" + } + } + ] + } + }, + "com.amazonaws.cloudformation#StartResourceScanInput": { + "type": "structure", + "members": { + "ClientRequestToken": { + "target": "com.amazonaws.cloudformation#ClientRequestToken", + "traits": { + "smithy.api#documentation": "

A unique identifier for this StartResourceScan request. Specify this token if you plan to retry\n requests so that CloudFormation knows that you're not attempting to start a new resource scan.

" } } }, "traits": { - "smithy.api#documentation": "

The StackSummary Data Type

" - } - }, - "com.amazonaws.cloudformation#Stacks": { - "type": "list", - "member": { - "target": "com.amazonaws.cloudformation#Stack" - } - }, - "com.amazonaws.cloudformation#StageList": { - "type": "list", - "member": { - "target": "com.amazonaws.cloudformation#TemplateStage" + "smithy.api#input": {} } }, - "com.amazonaws.cloudformation#StaleRequestException": { + "com.amazonaws.cloudformation#StartResourceScanOutput": { "type": "structure", "members": { - "Message": { - "target": "com.amazonaws.cloudformation#ErrorMessage" + "ResourceScanId": { + "target": "com.amazonaws.cloudformation#ResourceScanId", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource scan. The format is\n arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is\n arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772\n .

" + } } }, "traits": { - "aws.protocols#awsQueryError": { - "code": "StaleRequestException", - "httpResponseCode": 409 - }, - "smithy.api#documentation": "

Another operation has been performed on this stack set since the specified operation was performed.

", - "smithy.api#error": "client", - "smithy.api#httpError": 409 + "smithy.api#output": {} } }, "com.amazonaws.cloudformation#StatusMessage": { @@ -12128,9 +13622,46 @@ } } }, + "com.amazonaws.cloudformation#TemplateConfiguration": { + "type": "structure", + "members": { + "DeletionPolicy": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateDeletionPolicy", + "traits": { + "smithy.api#documentation": "

The DeletionPolicy assigned to resources in the generated template. Supported values are:

\n \n

For more information, see \n DeletionPolicy\n attribute in the CloudFormation User Guide.

" + } + }, + "UpdateReplacePolicy": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateUpdateReplacePolicy", + "traits": { + "smithy.api#documentation": "

The UpdateReplacePolicy assigned to resources in the generated template. Supported values\n are:

\n \n

For more information, see \n UpdateReplacePolicy\n attribute in the CloudFormation User Guide.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The configuration details of a generated template.

" + } + }, "com.amazonaws.cloudformation#TemplateDescription": { "type": "string" }, + "com.amazonaws.cloudformation#TemplateFormat": { + "type": "enum", + "members": { + "JSON": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "JSON" + } + }, + "YAML": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "YAML" + } + } + } + }, "com.amazonaws.cloudformation#TemplateParameter": { "type": "structure", "members": { @@ -12169,6 +13700,38 @@ "target": "com.amazonaws.cloudformation#TemplateParameter" } }, + "com.amazonaws.cloudformation#TemplateProgress": { + "type": "structure", + "members": { + "ResourcesSucceeded": { + "target": "com.amazonaws.cloudformation#ResourcesSucceeded", + "traits": { + "smithy.api#documentation": "

The number of resources that succeeded the template generation.

" + } + }, + "ResourcesFailed": { + "target": "com.amazonaws.cloudformation#ResourcesFailed", + "traits": { + "smithy.api#documentation": "

The number of resources that failed the template generation.

" + } + }, + "ResourcesProcessing": { + "target": "com.amazonaws.cloudformation#ResourcesProcessing", + "traits": { + "smithy.api#documentation": "

The number of resources that are in-process for the template generation.

" + } + }, + "ResourcesPending": { + "target": "com.amazonaws.cloudformation#ResourcesPending", + "traits": { + "smithy.api#documentation": "

The number of resources that are still pending the template generation.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A summary of the progress of the template generation.

" + } + }, "com.amazonaws.cloudformation#TemplateStage": { "type": "enum", "members": { @@ -12186,6 +13749,71 @@ } } }, + "com.amazonaws.cloudformation#TemplateStatusReason": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + } + } + }, + "com.amazonaws.cloudformation#TemplateSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#TemplateSummary" + } + }, + "com.amazonaws.cloudformation#TemplateSummary": { + "type": "structure", + "members": { + "GeneratedTemplateId": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateId", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the generated template. The format is\n arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example,\n arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc\n .

" + } + }, + "GeneratedTemplateName": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateName", + "traits": { + "smithy.api#documentation": "

The name of the generated template.

" + } + }, + "Status": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateStatus", + "traits": { + "smithy.api#documentation": "

The status of the template generation. Supported values are:

\n " + } + }, + "StatusReason": { + "target": "com.amazonaws.cloudformation#TemplateStatusReason", + "traits": { + "smithy.api#documentation": "

The reason for the current template generation status. This will provide more details if a failure\n happened.

" + } + }, + "CreationTime": { + "target": "com.amazonaws.cloudformation#CreationTime", + "traits": { + "smithy.api#documentation": "

The time the generated template was created.

" + } + }, + "LastUpdatedTime": { + "target": "com.amazonaws.cloudformation#LastUpdatedTime", + "traits": { + "smithy.api#documentation": "

The time the generated template was last updated.

" + } + }, + "NumberOfResources": { + "target": "com.amazonaws.cloudformation#NumberOfResources", + "traits": { + "smithy.api#documentation": "

The number of resources in the generated template. This is a total of resources in pending, in-progress,\n completed, and failed states.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The summary of a generated template.

" + } + }, "com.amazonaws.cloudformation#TemplateSummaryConfig": { "type": "structure", "members": { @@ -12351,6 +13979,14 @@ } } }, + "com.amazonaws.cloudformation#TotalWarnings": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0 + } + } + }, "com.amazonaws.cloudformation#TransformName": { "type": "string" }, @@ -12818,6 +14454,140 @@ "target": "com.amazonaws.cloudformation#TypeConfigurationIdentifier" } }, + "com.amazonaws.cloudformation#UpdateGeneratedTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.cloudformation#UpdateGeneratedTemplateInput" + }, + "output": { + "target": "com.amazonaws.cloudformation#UpdateGeneratedTemplateOutput" + }, + "errors": [ + { + "target": "com.amazonaws.cloudformation#AlreadyExistsException" + }, + { + "target": "com.amazonaws.cloudformation#GeneratedTemplateNotFoundException" + }, + { + "target": "com.amazonaws.cloudformation#LimitExceededException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates a generated template. This can be used to change the name, add and remove resources, refresh resources,\n and change the DeletionPolicy and UpdateReplacePolicy settings. You can check the status of\n the update to the generated template using the DescribeGeneratedTemplate API action.

", + "smithy.api#examples": [ + { + "title": "To update a generated template's name", + "documentation": "This example updates a generated template with a new name.", + "input": { + "GeneratedTemplateName": "JazzyTemplate", + "NewGeneratedTemplateName": "JazzierTemplate" + }, + "output": { + "GeneratedTemplateId": "arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/88f09db1-d211-4cb7-964b-434e2b8469ca" + } + }, + { + "title": "To remove resources from a generated template", + "documentation": "This example removes resources from a generated template", + "input": { + "GeneratedTemplateName": "JazzyTemplate", + "RemoveResources": [ + "LogicalResourceId1", + "LogicalResourceId2" + ] + }, + "output": { + "GeneratedTemplateId": "arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/88f09db1-d211-4cb7-964b-434e2b8469ca" + } + }, + { + "title": "To add resources to a generated template", + "documentation": "This example adds resources to a generated template", + "input": { + "GeneratedTemplateName": "JazzyTemplate", + "AddResources": [ + { + "ResourceType": "AWS::S3::Bucket", + "ResourceIdentifier": { + "BucketName": "jazz-bucket" + } + }, + { + "ResourceType": "AWS::EC2::DHCPOptions", + "ResourceIdentifier": { + "DhcpOptionsId": "random-id123" + } + } + ] + }, + "output": { + "GeneratedTemplateId": "arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/88f09db1-d211-4cb7-964b-434e2b8469ca" + } + } + ] + } + }, + "com.amazonaws.cloudformation#UpdateGeneratedTemplateInput": { + "type": "structure", + "members": { + "GeneratedTemplateName": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateName", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The name or Amazon Resource Name (ARN) of a generated template.

", + "smithy.api#required": {} + } + }, + "NewGeneratedTemplateName": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateName", + "traits": { + "smithy.api#documentation": "

An optional new name to assign to the generated template.

" + } + }, + "AddResources": { + "target": "com.amazonaws.cloudformation#ResourceDefinitions", + "traits": { + "smithy.api#documentation": "

An optional list of resources to be added to the generated template.

" + } + }, + "RemoveResources": { + "target": "com.amazonaws.cloudformation#JazzLogicalResourceIds", + "traits": { + "smithy.api#documentation": "

A list of logical ids for resources to remove from the generated template.

" + } + }, + "RefreshAllResources": { + "target": "com.amazonaws.cloudformation#RefreshAllResources", + "traits": { + "smithy.api#documentation": "

If true, update the resource properties in the generated template with their current live state.\n This feature is useful when the resource properties in your generated a template does not reflect the live state of\n the resource properties. This happens when a user update the resource properties after generating a template.

" + } + }, + "TemplateConfiguration": { + "target": "com.amazonaws.cloudformation#TemplateConfiguration", + "traits": { + "smithy.api#documentation": "

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.cloudformation#UpdateGeneratedTemplateOutput": { + "type": "structure", + "members": { + "GeneratedTemplateId": { + "target": "com.amazonaws.cloudformation#GeneratedTemplateId", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the generated template. The format is\n arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example,\n arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc\n .

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.cloudformation#UpdateStack": { "type": "operation", "input": { @@ -13421,6 +15191,87 @@ } } }, + "com.amazonaws.cloudformation#WarningDetail": { + "type": "structure", + "members": { + "Type": { + "target": "com.amazonaws.cloudformation#WarningType", + "traits": { + "smithy.api#documentation": "

The type of this warning. For more information, see IaC generator and write-only\n properties in the CloudFormation User Guide.

\n \n \n

Currently the resource and property reference documentation does not indicate if a property uses a type of\n oneOf or anyOf. You need to look at the resource provider schema.

\n
" + } + }, + "Properties": { + "target": "com.amazonaws.cloudformation#WarningProperties", + "traits": { + "smithy.api#documentation": "

The properties of the resource that are impacted by this warning.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The warnings generated for a specific resource for this generated template.

" + } + }, + "com.amazonaws.cloudformation#WarningDetails": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#WarningDetail" + } + }, + "com.amazonaws.cloudformation#WarningProperties": { + "type": "list", + "member": { + "target": "com.amazonaws.cloudformation#WarningProperty" + } + }, + "com.amazonaws.cloudformation#WarningProperty": { + "type": "structure", + "members": { + "PropertyPath": { + "target": "com.amazonaws.cloudformation#PropertyPath", + "traits": { + "smithy.api#documentation": "

The path of the property. For example, if this is for the S3Bucket member of the Code\n property, the property path would be Code/S3Bucket.

" + } + }, + "Required": { + "target": "com.amazonaws.cloudformation#RequiredProperty", + "traits": { + "smithy.api#documentation": "

If true, the specified property is required.

" + } + }, + "Description": { + "target": "com.amazonaws.cloudformation#PropertyDescription", + "traits": { + "smithy.api#documentation": "

The description of the property from the resource provider schema.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A specific property that is impacted by a warning.

" + } + }, + "com.amazonaws.cloudformation#WarningType": { + "type": "enum", + "members": { + "MUTUALLY_EXCLUSIVE_PROPERTIES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MUTUALLY_EXCLUSIVE_PROPERTIES" + } + }, + "UNSUPPORTED_PROPERTIES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UNSUPPORTED_PROPERTIES" + } + }, + "MUTUALLY_EXCLUSIVE_TYPES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MUTUALLY_EXCLUSIVE_TYPES" + } + } + } + }, "com.amazonaws.cloudformation#Warnings": { "type": "structure", "members": { diff --git a/aws-models/elastic-load-balancing-v2.json b/aws-models/elastic-load-balancing-v2.json index 32c4a8e90051..086c3188548a 100644 --- a/aws-models/elastic-load-balancing-v2.json +++ b/aws-models/elastic-load-balancing-v2.json @@ -971,6 +971,49 @@ } ] } + }, + { + "title": "To create an HTTPS listener", + "documentation": "This example creates an HTTPS listener for the specified load balancer that forwards requests to the specified target group. Note that you must specify an SSL certificate for an HTTPS listener. You can create and manage certificates using AWS Certificate Manager (ACM). Alternatively, you can create a certificate using SSL/TLS tools, get the certificate signed by a certificate authority (CA), and upload the certificate to AWS Identity and Access Management (IAM).", + "input": { + "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", + "Protocol": "HTTPS", + "Port": 443, + "SslPolicy": "ELBSecurityPolicy-2015-05", + "Certificates": [ + { + "CertificateArn": "arn:aws:iam::123456789012:server-certificate/my-server-cert" + } + ], + "DefaultActions": [ + { + "Type": "forward", + "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067" + } + ] + }, + "output": { + "Listeners": [ + { + "Protocol": "HTTPS", + "DefaultActions": [ + { + "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", + "Type": "forward" + } + ], + "SslPolicy": "ELBSecurityPolicy-2015-05", + "Certificates": [ + { + "CertificateArn": "arn:aws:iam::123456789012:server-certificate/my-server-cert" + } + ], + "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", + "Port": 443, + "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2" + } + ] + } } ] } @@ -1147,6 +1190,49 @@ } ] } + }, + { + "title": "To create an internal load balancer", + "documentation": "This example creates an internal load balancer and enables the Availability Zones for the specified subnets.", + "input": { + "Name": "my-internal-load-balancer", + "Subnets": [ + "subnet-b7d581c0", + "subnet-8360a9e7" + ], + "SecurityGroups": [], + "Scheme": "internal" + }, + "output": { + "LoadBalancers": [ + { + "VpcId": "vpc-3ac0fb5f", + "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-internal-load-balancer/5b49b8d4303115c2", + "State": { + "Code": "provisioning" + }, + "DNSName": "internal-my-internal-load-balancer-1529930873.us-west-2.elb.amazonaws.com", + "SecurityGroups": [ + "sg-5943793c" + ], + "LoadBalancerName": "my-internal-load-balancer", + "CreatedTime": "2016-03-25T21:29:48.850Z", + "Scheme": "internal", + "Type": "application", + "CanonicalHostedZoneId": "Z2P70J7EXAMPLE", + "AvailabilityZones": [ + { + "SubnetId": "subnet-8360a9e7", + "ZoneName": "us-west-2a" + }, + { + "SubnetId": "subnet-b7d581c0", + "ZoneName": "us-west-2b" + } + ] + } + ] + } } ] } @@ -1165,13 +1251,13 @@ "Subnets": { "target": "com.amazonaws.elasticloadbalancingv2#Subnets", "traits": { - "smithy.api#documentation": "

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You\n must specify either subnets or subnet mappings, but not both. To specify an Elastic IP\n address, specify subnet mappings instead of subnets.

\n

[Application Load Balancers] You must specify subnets from at least two Availability\n Zones.

\n

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

\n

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local\n Zones.

\n

[Network Load Balancers] You can specify subnets from one or more Availability\n Zones.

\n

[Gateway Load Balancers] You can specify subnets from one or more Availability\n Zones.

" + "smithy.api#documentation": "

The IDs of the subnets. You can specify only one subnet per Availability Zone. You\n must specify either subnets or subnet mappings, but not both. To specify an Elastic IP\n address, specify subnet mappings instead of subnets.

\n

[Application Load Balancers] You must specify subnets from at least two Availability\n Zones.

\n

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

\n

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local\n Zones.

\n

[Network Load Balancers] You can specify subnets from one or more Availability\n Zones.

\n

[Gateway Load Balancers] You can specify subnets from one or more Availability\n Zones.

" } }, "SubnetMappings": { "target": "com.amazonaws.elasticloadbalancingv2#SubnetMappings", "traits": { - "smithy.api#documentation": "

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You\n must specify either subnets or subnet mappings, but not both.

\n

[Application Load Balancers] You must specify subnets from at least two Availability\n Zones. You cannot specify Elastic IP addresses for your subnets.

\n

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

\n

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local\n Zones.

\n

[Network Load Balancers] You can specify subnets from one or more Availability Zones. You\n can specify one Elastic IP address per subnet if you need static IP addresses for your\n internet-facing load balancer. For internal load balancers, you can specify one private IP\n address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you\n can specify one IPv6 address per subnet.

\n

[Gateway Load Balancers] You can specify subnets from one or more Availability Zones. You\n cannot specify Elastic IP addresses for your subnets.

" + "smithy.api#documentation": "

The IDs of the subnets. You can specify only one subnet per Availability Zone. You\n must specify either subnets or subnet mappings, but not both.

\n

[Application Load Balancers] You must specify subnets from at least two Availability\n Zones. You cannot specify Elastic IP addresses for your subnets.

\n

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

\n

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local\n Zones.

\n

[Network Load Balancers] You can specify subnets from one or more Availability Zones. You\n can specify one Elastic IP address per subnet if you need static IP addresses for your\n internet-facing load balancer. For internal load balancers, you can specify one private IP\n address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you\n can specify one IPv6 address per subnet.

\n

[Gateway Load Balancers] You can specify subnets from one or more Availability Zones. You\n cannot specify Elastic IP addresses for your subnets.

" } }, "SecurityGroups": { @@ -3111,6 +3197,33 @@ } ] } + }, + { + "title": "To describe the health of a target", + "documentation": "This example describes the health of the specified target. This target is healthy.", + "input": { + "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", + "Targets": [ + { + "Id": "i-0f76fade", + "Port": 80 + } + ] + }, + "output": { + "TargetHealthDescriptions": [ + { + "HealthCheckPort": "80", + "Target": { + "Id": "i-0f76fade", + "Port": 80 + }, + "TargetHealth": { + "State": "healthy" + } + } + ] + } } ], "smithy.api#suppress": [ @@ -5823,6 +5936,40 @@ } ] } + }, + { + "title": "To change the server certificate", + "documentation": "This example changes the server certificate for the specified HTTPS listener.", + "input": { + "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65", + "Certificates": [ + { + "CertificateArn": "arn:aws:iam::123456789012:server-certificate/my-new-server-cert" + } + ] + }, + "output": { + "Listeners": [ + { + "Protocol": "HTTPS", + "DefaultActions": [ + { + "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", + "Type": "forward" + } + ], + "SslPolicy": "ELBSecurityPolicy-2015-05", + "Certificates": [ + { + "CertificateArn": "arn:aws:iam::123456789012:server-certificate/my-new-server-cert" + } + ], + "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", + "Port": 443, + "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65" + } + ] + } } ] } @@ -5954,6 +6101,88 @@ } ] } + }, + { + "title": "To change the idle timeout", + "documentation": "This example changes the idle timeout value for the specified load balancer.", + "input": { + "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", + "Attributes": [ + { + "Key": "idle_timeout.timeout_seconds", + "Value": "30" + } + ] + }, + "output": { + "Attributes": [ + { + "Value": "30", + "Key": "idle_timeout.timeout_seconds" + }, + { + "Value": "false", + "Key": "access_logs.s3.enabled" + }, + { + "Value": "", + "Key": "access_logs.s3.prefix" + }, + { + "Value": "true", + "Key": "deletion_protection.enabled" + }, + { + "Value": "", + "Key": "access_logs.s3.bucket" + } + ] + } + }, + { + "title": "To enable access logs", + "documentation": "This example enables access logs for the specified load balancer. Note that the S3 bucket must exist in the same region as the load balancer and must have a policy attached that grants access to the Elastic Load Balancing service.", + "input": { + "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", + "Attributes": [ + { + "Key": "access_logs.s3.enabled", + "Value": "true" + }, + { + "Key": "access_logs.s3.bucket", + "Value": "my-loadbalancer-logs" + }, + { + "Key": "access_logs.s3.prefix", + "Value": "myapp" + } + ] + }, + "output": { + "Attributes": [ + { + "Value": "true", + "Key": "access_logs.s3.enabled" + }, + { + "Value": "my-load-balancer-logs", + "Key": "access_logs.s3.bucket" + }, + { + "Value": "myapp", + "Key": "access_logs.s3.prefix" + }, + { + "Value": "60", + "Key": "idle_timeout.timeout_seconds" + }, + { + "Value": "false", + "Key": "deletion_protection.enabled" + } + ] + } } ] } @@ -6775,6 +7004,23 @@ } ] } + }, + { + "title": "To register targets with a target group using port overrides", + "documentation": "This example registers the specified instance with the specified target group using multiple ports. This enables you to register ECS containers on the same instance as targets in the target group.", + "input": { + "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/3bb63f11dfb0faf9", + "Targets": [ + { + "Id": "i-80c8dd94", + "Port": 80 + }, + { + "Id": "i-80c8dd94", + "Port": 766 + } + ] + } } ] } @@ -7668,7 +7914,7 @@ "Values": { "target": "com.amazonaws.elasticloadbalancingv2#ListOfString", "traits": { - "smithy.api#documentation": "

The source IP addresses, in CIDR format. You can use both IPv4 and IPv6 addresses.\n Wildcards are not supported.

\n

If you specify multiple addresses, the condition is satisfied if the source IP address of\n the request matches one of the CIDR blocks. This condition is not satisfied by the addresses\n in the X-Forwarded-For header. To search for addresses in the X-Forwarded-For header, use\n HttpHeaderConditionConfig.

" + "smithy.api#documentation": "

The source IP addresses, in CIDR format. You can use both IPv4 and IPv6 addresses.\n Wildcards are not supported.

\n

If you specify multiple addresses, the condition is satisfied if the source IP address of\n the request matches one of the CIDR blocks. This condition is not satisfied by the addresses\n in the X-Forwarded-For header. To search for addresses in the X-Forwarded-For header, use\n HttpHeaderConditionConfig.

\n

The total number of values must be less than, or equal to five.

" } } }, @@ -8072,7 +8318,7 @@ "Key": { "target": "com.amazonaws.elasticloadbalancingv2#TargetGroupAttributeKey", "traits": { - "smithy.api#documentation": "

The name of the attribute.

\n

The following attributes are supported by all load balancers:

\n \n

The following attributes are supported by Application Load Balancers and \n Network Load Balancers:

\n \n

The following attributes are supported only if the load balancer is an Application Load\n Balancer and the target is an instance or an IP address:

\n \n

The following attribute is supported only if the load balancer is an Application Load\n Balancer and the target is a Lambda function:

\n \n

The following attributes are supported only by Network Load Balancers:

\n \n

The following attributes are supported only by Gateway Load Balancers:

\n " + "smithy.api#documentation": "

The name of the attribute.

\n

The following attributes are supported by all load balancers:

\n \n

The following attributes are supported by Application Load Balancers and \n Network Load Balancers:

\n \n

The following attributes are supported only if the load balancer is an Application Load\n Balancer and the target is an instance or an IP address:

\n \n

The following attribute is supported only if the load balancer is an Application Load\n Balancer and the target is a Lambda function:

\n \n

The following attributes are supported only by Network Load Balancers:

\n \n

The following attributes are supported only by Gateway Load Balancers:

\n " } }, "Value": { @@ -8371,6 +8617,12 @@ "smithy.api#enumValue": "unhealthy" } }, + "UNHEALTHY_DRAINING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "unhealthy.draining" + } + }, "UNUSED": { "target": "smithy.api#Unit", "traits": { diff --git a/aws-models/glue.json b/aws-models/glue.json index 95dbf687787e..9b3c16db2117 100644 --- a/aws-models/glue.json +++ b/aws-models/glue.json @@ -17102,7 +17102,7 @@ } }, "MaxResults": { - "target": "com.amazonaws.glue#PageSize", + "target": "com.amazonaws.glue#OrchestrationPageSize200", "traits": { "smithy.api#documentation": "

The maximum size of the response.

" } @@ -19646,7 +19646,7 @@ } }, "MaxResults": { - "target": "com.amazonaws.glue#PageSize", + "target": "com.amazonaws.glue#OrchestrationPageSize200", "traits": { "smithy.api#documentation": "

The maximum size of the response.

" } @@ -22089,7 +22089,7 @@ "Runtime": { "target": "com.amazonaws.glue#RuntimeNameString", "traits": { - "smithy.api#documentation": "

In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional\n libraries available in your environment. This field is not used in other job types. For\n supported runtime environment values, see Working with Ray jobs\n in the Glue Developer Guide.

" + "smithy.api#documentation": "

In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional\n libraries available in your environment. This field is not used in other job types. For\n supported runtime environment values, see Supported Ray runtime environments\n in the Glue Developer Guide.

" } } }, @@ -23188,7 +23188,7 @@ } }, "MaxResults": { - "target": "com.amazonaws.glue#PageSize", + "target": "com.amazonaws.glue#OrchestrationPageSize25", "traits": { "smithy.api#documentation": "

The maximum size of a list to return.

" } @@ -24616,7 +24616,7 @@ } }, "MaxResults": { - "target": "com.amazonaws.glue#PageSize", + "target": "com.amazonaws.glue#OrchestrationPageSize200", "traits": { "smithy.api#documentation": "

The maximum size of a list to return.

" } @@ -24690,7 +24690,7 @@ } }, "MaxResults": { - "target": "com.amazonaws.glue#PageSize", + "target": "com.amazonaws.glue#OrchestrationPageSize25", "traits": { "smithy.api#documentation": "

The maximum size of a list to return.

" } @@ -25996,6 +25996,24 @@ "smithy.api#pattern": "^[\\.\\-_A-Za-z0-9]+$" } }, + "com.amazonaws.glue#OrchestrationPageSize200": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 200 + } + } + }, + "com.amazonaws.glue#OrchestrationPageSize25": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 25 + } + } + }, "com.amazonaws.glue#OrchestrationRoleArn": { "type": "string", "traits": { diff --git a/aws-models/sdk-endpoints.json b/aws-models/sdk-endpoints.json index a82679440588..44492f21523b 100644 --- a/aws-models/sdk-endpoints.json +++ b/aws-models/sdk-endpoints.json @@ -16869,6 +16869,7 @@ "deprecated" : true, "hostname" : "sms-voice-fips.us-west-2.amazonaws.com" }, + "il-central-1" : { }, "us-east-1" : { "variants" : [ { "hostname" : "sms-voice-fips.us-east-1.amazonaws.com", diff --git a/aws-models/ssm.json b/aws-models/ssm.json index 8511482b06a5..cc5f43713a5c 100644 --- a/aws-models/ssm.json +++ b/aws-models/ssm.json @@ -2031,6 +2031,12 @@ "smithy.api#documentation": "

Number of days to wait after the scheduled day to run an association.

" } }, + "Duration": { + "target": "com.amazonaws.ssm#Duration", + "traits": { + "smithy.api#documentation": "

The number of hours that an association can run on specified targets. After the resulting\n cutoff time passes, associations that are currently running are cancelled, and no pending\n executions are started on remaining targets.

" + } + }, "TargetMaps": { "target": "com.amazonaws.ssm#TargetMaps", "traits": { @@ -2243,6 +2249,12 @@ "smithy.api#documentation": "

Number of days to wait after the scheduled day to run an association.

" } }, + "Duration": { + "target": "com.amazonaws.ssm#Duration", + "traits": { + "smithy.api#documentation": "

The number of hours that an association can run on specified targets. After the resulting\n cutoff time passes, associations that are currently running are cancelled, and no pending\n executions are started on remaining targets.

" + } + }, "TargetMaps": { "target": "com.amazonaws.ssm#TargetMaps", "traits": { @@ -3007,6 +3019,12 @@ "smithy.api#documentation": "

Number of days to wait after the scheduled day to run an association.

" } }, + "Duration": { + "target": "com.amazonaws.ssm#Duration", + "traits": { + "smithy.api#documentation": "

The number of hours that an association can run on specified targets. After the resulting\n cutoff time passes, associations that are currently running are cancelled, and no pending\n executions are started on remaining targets.

" + } + }, "TargetMaps": { "target": "com.amazonaws.ssm#TargetMaps", "traits": { @@ -5924,6 +5942,12 @@ "smithy.api#documentation": "

Number of days to wait after the scheduled day to run an association.

" } }, + "Duration": { + "target": "com.amazonaws.ssm#Duration", + "traits": { + "smithy.api#documentation": "

The number of hours the association can run before it is canceled. Duration applies to\n associations that are currently running, and any pending and in progress commands on all targets.\n If a target was taken offline for the association to run, it is made available again immediately,\n without a reboot.

\n

The Duration parameter applies only when both these conditions are true:

\n " + } + }, "TargetMaps": { "target": "com.amazonaws.ssm#TargetMaps", "traits": { @@ -6065,6 +6089,12 @@ "smithy.api#documentation": "

Number of days to wait after the scheduled day to run an association. For example, if you\n specified a cron schedule of cron(0 0 ? * THU#2 *), you could specify an offset of 3\n to run the association each Sunday after the second Thursday of the month. For more information\n about cron schedules for associations, see Reference: Cron\n and rate expressions for Systems Manager in the Amazon Web Services Systems Manager User Guide.

\n \n

To use offsets, you must specify the ApplyOnlyAtCronInterval parameter. This\n option tells the system not to run an association immediately after you create it.

\n
" } }, + "Duration": { + "target": "com.amazonaws.ssm#Duration", + "traits": { + "smithy.api#documentation": "

The number of hours the association can run before it is canceled. Duration applies to\n associations that are currently running, and any pending and in progress commands on all targets.\n If a target was taken offline for the association to run, it is made available again immediately,\n without a reboot.

\n

The Duration parameter applies only when both these conditions are true:

\n " + } + }, "TargetMaps": { "target": "com.amazonaws.ssm#TargetMaps", "traits": { @@ -8253,7 +8283,7 @@ } ], "traits": { - "smithy.api#documentation": "

Lists all patches eligible to be included in a patch baseline.

", + "smithy.api#documentation": "

Lists all patches eligible to be included in a patch baseline.

\n \n

Currently, DescribeAvailablePatches supports only the Amazon Linux 1, Amazon\n Linux 2, and Windows Server operating systems.

\n
", "smithy.api#paginated": { "inputToken": "NextToken", "outputToken": "NextToken", @@ -8439,7 +8469,7 @@ "VersionName": { "target": "com.amazonaws.ssm#DocumentVersionName", "traits": { - "smithy.api#documentation": "

An optional field specifying the version of the artifact associated with the document. For\n example, \"Release 12, Update 6\". This value is unique across all versions of a document, and\n can't be changed.

" + "smithy.api#documentation": "

An optional field specifying the version of the artifact associated with the document. For\n example, 12.6. This value is unique across all versions of a document, and\n can't be changed.

" } } }, @@ -10784,7 +10814,7 @@ "VersionName": { "target": "com.amazonaws.ssm#DocumentVersionName", "traits": { - "smithy.api#documentation": "

An optional field specifying the version of the artifact associated with the document. For\n example, \"Release 12, Update 6\". This value is unique across all versions of a document, and\n can't be changed.

" + "smithy.api#documentation": "

An optional field specifying the version of the artifact associated with the document. For\n example, 12.6. This value is unique across all versions of a document, and\n can't be changed.

" } }, "PlatformTypes": { @@ -11095,7 +11125,7 @@ "VersionName": { "target": "com.amazonaws.ssm#DocumentVersionName", "traits": { - "smithy.api#documentation": "

An optional field specifying the version of the artifact associated with the document. For\n example, \"Release 12, Update 6\". This value is unique across all versions of a document, and\n can't be changed.

" + "smithy.api#documentation": "

An optional field specifying the version of the artifact associated with the document. For\n example, 12.6. This value is unique across all versions of a document, and\n can't be changed.

" } } }, @@ -11436,7 +11466,7 @@ "VersionName": { "target": "com.amazonaws.ssm#DocumentVersionName", "traits": { - "smithy.api#documentation": "

The version of the artifact associated with the document. For example, \"Release 12, Update\n 6\". This value is unique across all versions of a document, and can't be changed.

" + "smithy.api#documentation": "

The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

" } }, "CreatedDate": { @@ -11586,6 +11616,15 @@ "smithy.api#error": "client" } }, + "com.amazonaws.ssm#Duration": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 24 + } + } + }, "com.amazonaws.ssm#EffectiveInstanceAssociationMaxResults": { "type": "integer", "traits": { @@ -12201,7 +12240,7 @@ "Status": { "target": "com.amazonaws.ssm#ConnectionStatus", "traits": { - "smithy.api#documentation": "

The status of the connection to the managed node. For example, 'Connected' or 'Not\n Connected'.

" + "smithy.api#documentation": "

The status of the connection to the managed node.

" } } }, @@ -12379,7 +12418,7 @@ "VersionName": { "target": "com.amazonaws.ssm#DocumentVersionName", "traits": { - "smithy.api#documentation": "

An optional field specifying the version of the artifact associated with the document. For\n example, \"Release 12, Update 6\". This value is unique across all versions of a document and can't\n be changed.

" + "smithy.api#documentation": "

An optional field specifying the version of the artifact associated with the document. For\n example, 12.6. This value is unique across all versions of a document and can't\n be changed.

" } }, "DocumentVersion": { @@ -12423,7 +12462,7 @@ "VersionName": { "target": "com.amazonaws.ssm#DocumentVersionName", "traits": { - "smithy.api#documentation": "

The version of the artifact associated with the document. For example, \"Release 12, Update\n 6\". This value is unique across all versions of a document, and can't be changed.

" + "smithy.api#documentation": "

The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

" } }, "DocumentVersion": { @@ -21808,7 +21847,7 @@ "KeyId": { "target": "com.amazonaws.ssm#ParameterKeyId", "traits": { - "smithy.api#documentation": "

The ID of the query key used for this parameter.

" + "smithy.api#documentation": "

The alias of the Key Management Service (KMS) key used to encrypt the\n parameter. Applies to SecureString parameters only

" } }, "LastModifiedDate": { @@ -21996,7 +22035,7 @@ "KeyId": { "target": "com.amazonaws.ssm#ParameterKeyId", "traits": { - "smithy.api#documentation": "

The ID of the query key used for this parameter.

" + "smithy.api#documentation": "

The alias of the Key Management Service (KMS) key used to encrypt the\n parameter. Applies to SecureString parameters only.

" } }, "LastModifiedDate": { @@ -22709,7 +22748,7 @@ "CVEIds": { "target": "com.amazonaws.ssm#PatchCVEIds", "traits": { - "smithy.api#documentation": "

The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by\n the patch.

" + "smithy.api#documentation": "

The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by\n the patch.

\n \n

Currently, CVE ID values are reported only for patches with a status of\n Missing or Failed.

\n
" } } }, @@ -28268,6 +28307,12 @@ "smithy.api#documentation": "

Number of days to wait after the scheduled day to run an association. For example, if you\n specified a cron schedule of cron(0 0 ? * THU#2 *), you could specify an offset of 3\n to run the association each Sunday after the second Thursday of the month. For more information\n about cron schedules for associations, see Reference: Cron\n and rate expressions for Systems Manager in the Amazon Web Services Systems Manager User Guide.

\n \n

To use offsets, you must specify the ApplyOnlyAtCronInterval parameter. This\n option tells the system not to run an association immediately after you create it.

\n
" } }, + "Duration": { + "target": "com.amazonaws.ssm#Duration", + "traits": { + "smithy.api#documentation": "

The number of hours the association can run before it is canceled. Duration applies to\n associations that are currently running, and any pending and in progress commands on all targets.\n If a target was taken offline for the association to run, it is made available again immediately,\n without a reboot.

\n

The Duration parameter applies only when both these conditions are true:

\n " + } + }, "TargetMaps": { "target": "com.amazonaws.ssm#TargetMaps", "traits": { @@ -28570,7 +28615,7 @@ "VersionName": { "target": "com.amazonaws.ssm#DocumentVersionName", "traits": { - "smithy.api#documentation": "

An optional field specifying the version of the artifact you are updating with the document.\n For example, \"Release 12, Update 6\". This value is unique across all versions of a document, and\n can't be changed.

" + "smithy.api#documentation": "

An optional field specifying the version of the artifact you are updating with the document.\n For example, 12.6. This value is unique across all versions of a document, and\n can't be changed.

" } }, "DocumentVersion": { diff --git a/examples/examples/cloudformation/Cargo.toml b/examples/examples/cloudformation/Cargo.toml index a8273b7d7a59..61268842b127 100644 --- a/examples/examples/cloudformation/Cargo.toml +++ b/examples/examples/cloudformation/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] aws-config= { version = "1.1.4", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-cloudformation= { version = "1.13.0", path = "../../../sdk/cloudformation" } +aws-sdk-cloudformation= { version = "1.14.0", path = "../../../sdk/cloudformation" } [dependencies.tokio] version = "1.20.1" diff --git a/examples/examples/glue/Cargo.toml b/examples/examples/glue/Cargo.toml index f2f8bbf0bb0b..ca386594a24c 100644 --- a/examples/examples/glue/Cargo.toml +++ b/examples/examples/glue/Cargo.toml @@ -19,7 +19,7 @@ secrecy = "0.8.0" futures = "0.3.25" tracing-bunyan-formatter = "0.3.4" aws-config= { version = "1.1.4", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-glue= { version = "1.14.0", path = "../../../sdk/glue" } +aws-sdk-glue= { version = "1.15.0", path = "../../../sdk/glue" } aws-sdk-s3= { version = "1.14.0", path = "../../../sdk/s3" } aws-http= { version = "0.60.5", path = "../../../sdk/aws-http" } aws-smithy-types= { version = "1.1.4", path = "../../../sdk/aws-smithy-types" } diff --git a/examples/examples/ssm/Cargo.toml b/examples/examples/ssm/Cargo.toml index 39d2121efc93..126c15ad3193 100644 --- a/examples/examples/ssm/Cargo.toml +++ b/examples/examples/ssm/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] aws-config= { version = "1.1.4", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-ssm= { version = "1.12.0", path = "../../../sdk/ssm" } +aws-sdk-ssm= { version = "1.13.0", path = "../../../sdk/ssm" } [dependencies.tokio] version = "1.20.1" diff --git a/sdk/cloudformation/Cargo.toml b/sdk/cloudformation/Cargo.toml index 0950183a9ae4..8b8dc7221d71 100644 --- a/sdk/cloudformation/Cargo.toml +++ b/sdk/cloudformation/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-cloudformation" -version = "1.13.0" +version = "1.14.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWS CloudFormation" edition = "2021" diff --git a/sdk/cloudformation/README.md b/sdk/cloudformation/README.md index bd11bd1c4798..e6861ff5bce0 100644 --- a/sdk/cloudformation/README.md +++ b/sdk/cloudformation/README.md @@ -20,7 +20,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.4", features = ["behavior-version-latest"] } -aws-sdk-cloudformation = "1.13.0" +aws-sdk-cloudformation = "1.14.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/cloudformation/src/client.rs b/sdk/cloudformation/src/client.rs index dedbe1297bd5..742ea437305c 100644 --- a/sdk/cloudformation/src/client.rs +++ b/sdk/cloudformation/src/client.rs @@ -148,6 +148,8 @@ mod continue_update_rollback; mod create_change_set; +mod create_generated_template; + mod create_stack; mod create_stack_instances; @@ -187,6 +189,8 @@ mod deactivate_type; mod delete_change_set; +mod delete_generated_template; + mod delete_stack; mod delete_stack_instances; @@ -201,10 +205,14 @@ mod describe_change_set; mod describe_change_set_hooks; +mod describe_generated_template; + mod describe_organizations_access; mod describe_publisher; +mod describe_resource_scan; + mod describe_stack_drift_detection_status; mod describe_stack_events; @@ -237,6 +245,8 @@ mod estimate_template_cost; mod execute_change_set; +mod get_generated_template; + mod get_stack_policy; mod get_template; @@ -249,8 +259,16 @@ mod list_change_sets; mod list_exports; +mod list_generated_templates; + mod list_imports; +mod list_resource_scan_related_resources; + +mod list_resource_scan_resources; + +mod list_resource_scans; + mod list_stack_instance_resource_drifts; mod list_stack_instances; @@ -289,10 +307,14 @@ mod set_type_default_version; mod signal_resource; +mod start_resource_scan; + mod stop_stack_set_operation; mod test_type; +mod update_generated_template; + mod update_stack; mod update_stack_instances; diff --git a/sdk/cloudformation/src/client/create_generated_template.rs b/sdk/cloudformation/src/client/create_generated_template.rs new file mode 100644 index 000000000000..65ea2b69003b --- /dev/null +++ b/sdk/cloudformation/src/client/create_generated_template.rs @@ -0,0 +1,16 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`CreateGeneratedTemplate`](crate::operation::create_generated_template::builders::CreateGeneratedTemplateFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`resources(ResourceDefinition)`](crate::operation::create_generated_template::builders::CreateGeneratedTemplateFluentBuilder::resources) / [`set_resources(Option>)`](crate::operation::create_generated_template::builders::CreateGeneratedTemplateFluentBuilder::set_resources):
required: **false**

An optional list of resources to be included in the generated template.

If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action.


+ /// - [`generated_template_name(impl Into)`](crate::operation::create_generated_template::builders::CreateGeneratedTemplateFluentBuilder::generated_template_name) / [`set_generated_template_name(Option)`](crate::operation::create_generated_template::builders::CreateGeneratedTemplateFluentBuilder::set_generated_template_name):
required: **true**

The name assigned to the generated template.


+ /// - [`stack_name(impl Into)`](crate::operation::create_generated_template::builders::CreateGeneratedTemplateFluentBuilder::stack_name) / [`set_stack_name(Option)`](crate::operation::create_generated_template::builders::CreateGeneratedTemplateFluentBuilder::set_stack_name):
required: **false**

An optional name or ARN of a stack to use as the base stack for the generated template.


+ /// - [`template_configuration(TemplateConfiguration)`](crate::operation::create_generated_template::builders::CreateGeneratedTemplateFluentBuilder::template_configuration) / [`set_template_configuration(Option)`](crate::operation::create_generated_template::builders::CreateGeneratedTemplateFluentBuilder::set_template_configuration):
required: **false**

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.


+ /// - On success, responds with [`CreateGeneratedTemplateOutput`](crate::operation::create_generated_template::CreateGeneratedTemplateOutput) with field(s): + /// - [`generated_template_id(Option)`](crate::operation::create_generated_template::CreateGeneratedTemplateOutput::generated_template_id):

The ID of the generated template.

+ /// - On failure, responds with [`SdkError`](crate::operation::create_generated_template::CreateGeneratedTemplateError) + pub fn create_generated_template(&self) -> crate::operation::create_generated_template::builders::CreateGeneratedTemplateFluentBuilder { + crate::operation::create_generated_template::builders::CreateGeneratedTemplateFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/cloudformation/src/client/create_stack.rs b/sdk/cloudformation/src/client/create_stack.rs index 1d869a1df81e..96e40b83badb 100644 --- a/sdk/cloudformation/src/client/create_stack.rs +++ b/sdk/cloudformation/src/client/create_stack.rs @@ -9,7 +9,7 @@ impl super::Client { /// - [`parameters(Parameter)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::parameters) / [`set_parameters(Option>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_parameters):
required: **false**

A list of Parameter structures that specify input parameters for the stack. For more information, see the Parameter data type.


/// - [`disable_rollback(bool)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::disable_rollback) / [`set_disable_rollback(Option)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_disable_rollback):
required: **false**

Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure, but not both.

Default: false


/// - [`rollback_configuration(RollbackConfiguration)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::rollback_configuration) / [`set_rollback_configuration(Option)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_rollback_configuration):
required: **false**

The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards.


- /// - [`timeout_in_minutes(i32)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::timeout_in_minutes) / [`set_timeout_in_minutes(Option)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_timeout_in_minutes):
required: **false**

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.


+ /// - [`timeout_in_minutes(i32)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::timeout_in_minutes) / [`set_timeout_in_minutes(Option)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_timeout_in_minutes):
required: **false**

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.


/// - [`notification_arns(impl Into)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::notification_arns) / [`set_notification_arns(Option>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_notification_arns):
required: **false**

The Amazon Simple Notification Service (Amazon SNS) topic ARNs to publish stack related events. You can find your Amazon SNS topic ARNs using the Amazon SNS console or your Command Line Interface (CLI).


/// - [`capabilities(Capability)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::capabilities) / [`set_capabilities(Option>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_capabilities):
required: **false**

In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order for CloudFormation to create the stack.

  • CAPABILITY_IAM and CAPABILITY_NAMED_IAM

    Some stack templates might include resources that can affect permissions in your Amazon Web Services account; for example, by creating new Identity and Access Management (IAM) users. For those stacks, you must explicitly acknowledge this by specifying one of these capabilities.

    The following IAM resources require you to specify either the CAPABILITY_IAM or CAPABILITY_NAMED_IAM capability.

    • If you have IAM resources, you can specify either capability.

    • If you have IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM.

    • If you don't specify either of these capabilities, CloudFormation returns an InsufficientCapabilities error.

    If your stack template contains these resources, we recommend that you review all permissions associated with them and edit their permissions if necessary.

    For more information, see Acknowledging IAM Resources in CloudFormation Templates.

  • CAPABILITY_AUTO_EXPAND

    Some template contain macros. Macros perform custom processing on templates; this can include simple actions like find-and-replace operations, all the way to extensive transformations of entire templates. Because of this, users typically create a change set from the processed template, so that they can review the changes resulting from the macros before actually creating the stack. If your stack template contains one or more macros, and you choose to create a stack directly from the processed template, without first reviewing the resulting changes in a change set, you must acknowledge this capability. This includes the AWS::Include and AWS::Serverless transforms, which are macros hosted by CloudFormation.

    If you want to create a stack from a stack template that contains macros and nested stacks, you must create the stack directly from the template using this capability.

    You should only create stacks directly from a stack template that contains macros if you know what processing the macro performs.

    Each macro relies on an underlying Lambda service function for processing stack templates. Be aware that the Lambda function owner can update the function operation without CloudFormation being notified.

    For more information, see Using CloudFormation macros to perform custom processing on templates.

Only one of the Capabilities and ResourceType parameters can be specified.


/// - [`resource_types(impl Into)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::resource_types) / [`set_resource_types(Option>)`](crate::operation::create_stack::builders::CreateStackFluentBuilder::set_resource_types):
required: **false**

The template resource types that you have permissions to work with for this create stack action, such as AWS::EC2::Instance, AWS::EC2::*, or Custom::MyCustomInstance. Use the following syntax to describe template resource types: AWS::* (for all Amazon Web Services resources), Custom::* (for all custom resources), Custom::logical_ID (for a specific custom resource), AWS::service_name::* (for all resources of a particular Amazon Web Services service), and AWS::service_name::resource_logical_ID (for a specific Amazon Web Services resource).

If the list of resource types doesn't include a resource that you're creating, the stack creation fails. By default, CloudFormation grants permissions to all resource types. Identity and Access Management (IAM) uses this parameter for CloudFormation-specific condition keys in IAM policies. For more information, see Controlling Access with Identity and Access Management.

Only one of the Capabilities and ResourceType parameters can be specified.


diff --git a/sdk/cloudformation/src/client/delete_generated_template.rs b/sdk/cloudformation/src/client/delete_generated_template.rs new file mode 100644 index 000000000000..61b376142a82 --- /dev/null +++ b/sdk/cloudformation/src/client/delete_generated_template.rs @@ -0,0 +1,12 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`DeleteGeneratedTemplate`](crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`generated_template_name(impl Into)`](crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateFluentBuilder::generated_template_name) / [`set_generated_template_name(Option)`](crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateFluentBuilder::set_generated_template_name):
required: **true**

The name or Amazon Resource Name (ARN) of a generated template.


+ /// - On success, responds with [`DeleteGeneratedTemplateOutput`](crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput) + /// - On failure, responds with [`SdkError`](crate::operation::delete_generated_template::DeleteGeneratedTemplateError) + pub fn delete_generated_template(&self) -> crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateFluentBuilder { + crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/cloudformation/src/client/describe_generated_template.rs b/sdk/cloudformation/src/client/describe_generated_template.rs new file mode 100644 index 000000000000..64cc706ba5d4 --- /dev/null +++ b/sdk/cloudformation/src/client/describe_generated_template.rs @@ -0,0 +1,23 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`DescribeGeneratedTemplate`](crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`generated_template_name(impl Into)`](crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateFluentBuilder::generated_template_name) / [`set_generated_template_name(Option)`](crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateFluentBuilder::set_generated_template_name):
required: **true**

The name or Amazon Resource Name (ARN) of a generated template.


+ /// - On success, responds with [`DescribeGeneratedTemplateOutput`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput) with field(s): + /// - [`generated_template_id(Option)`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput::generated_template_id):

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ /// - [`generated_template_name(Option)`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput::generated_template_name):

The name of the generated template.

+ /// - [`resources(Option>)`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput::resources):

A list of objects describing the details of the resources in the template generation.

+ /// - [`status(Option)`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput::status):

The status of the template generation. Supported values are:

  • CreatePending - the creation of the template is pending.

  • CreateInProgress - the creation of the template is in progress.

  • DeletePending - the deletion of the template is pending.

  • DeleteInProgress - the deletion of the template is in progress.

  • UpdatePending - the update of the template is pending.

  • UpdateInProgress - the update of the template is in progress.

  • Failed - the template operation failed.

  • Complete - the template operation is complete.

+ /// - [`status_reason(Option)`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput::status_reason):

The reason for the current template generation status. This will provide more details if a failure happened.

+ /// - [`creation_time(Option)`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput::creation_time):

The time the generated template was created.

+ /// - [`last_updated_time(Option)`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput::last_updated_time):

The time the generated template was last updated.

+ /// - [`progress(Option)`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput::progress):

An object describing the progress of the template generation.

+ /// - [`stack_id(Option)`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput::stack_id):

The stack ARN of the base stack if a base stack was provided when generating the template.

+ /// - [`template_configuration(Option)`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput::template_configuration):

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ /// - [`total_warnings(Option)`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput::total_warnings):

The number of warnings generated for this template. The warnings are found in the details of each of the resources in the template.

+ /// - On failure, responds with [`SdkError`](crate::operation::describe_generated_template::DescribeGeneratedTemplateError) + pub fn describe_generated_template(&self) -> crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateFluentBuilder { + crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/cloudformation/src/client/describe_resource_scan.rs b/sdk/cloudformation/src/client/describe_resource_scan.rs new file mode 100644 index 000000000000..9a819f7eb04f --- /dev/null +++ b/sdk/cloudformation/src/client/describe_resource_scan.rs @@ -0,0 +1,21 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`DescribeResourceScan`](crate::operation::describe_resource_scan::builders::DescribeResourceScanFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`resource_scan_id(impl Into)`](crate::operation::describe_resource_scan::builders::DescribeResourceScanFluentBuilder::resource_scan_id) / [`set_resource_scan_id(Option)`](crate::operation::describe_resource_scan::builders::DescribeResourceScanFluentBuilder::set_resource_scan_id):
required: **true**

The Amazon Resource Name (ARN) of the resource scan.


+ /// - On success, responds with [`DescribeResourceScanOutput`](crate::operation::describe_resource_scan::DescribeResourceScanOutput) with field(s): + /// - [`resource_scan_id(Option)`](crate::operation::describe_resource_scan::DescribeResourceScanOutput::resource_scan_id):

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ /// - [`status(Option)`](crate::operation::describe_resource_scan::DescribeResourceScanOutput::status):

Status of the resource scan.

INPROGRESS

The resource scan is still in progress.

COMPLETE

The resource scan is complete.

EXPIRED

The resource scan has expired.

FAILED

The resource scan has failed.

+ /// - [`status_reason(Option)`](crate::operation::describe_resource_scan::DescribeResourceScanOutput::status_reason):

The reason for the resource scan status, providing more information if a failure happened.

+ /// - [`start_time(Option)`](crate::operation::describe_resource_scan::DescribeResourceScanOutput::start_time):

The time that the resource scan was started.

+ /// - [`end_time(Option)`](crate::operation::describe_resource_scan::DescribeResourceScanOutput::end_time):

The time that the resource scan was finished.

+ /// - [`percentage_completed(Option)`](crate::operation::describe_resource_scan::DescribeResourceScanOutput::percentage_completed):

The percentage of the resource scan that has been completed.

+ /// - [`resource_types(Option>)`](crate::operation::describe_resource_scan::DescribeResourceScanOutput::resource_types):

The list of resource types for the specified scan. Resource types are only available for scans with a Status set to COMPLETE or FAILED .

+ /// - [`resources_scanned(Option)`](crate::operation::describe_resource_scan::DescribeResourceScanOutput::resources_scanned):

The number of resources that were listed. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

+ /// - [`resources_read(Option)`](crate::operation::describe_resource_scan::DescribeResourceScanOutput::resources_read):

The number of resources that were read. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

This field may be 0 if the resource scan failed with a ResourceScanLimitExceededException.

+ /// - On failure, responds with [`SdkError`](crate::operation::describe_resource_scan::DescribeResourceScanError) + pub fn describe_resource_scan(&self) -> crate::operation::describe_resource_scan::builders::DescribeResourceScanFluentBuilder { + crate::operation::describe_resource_scan::builders::DescribeResourceScanFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/cloudformation/src/client/get_generated_template.rs b/sdk/cloudformation/src/client/get_generated_template.rs new file mode 100644 index 000000000000..2dd5794c3354 --- /dev/null +++ b/sdk/cloudformation/src/client/get_generated_template.rs @@ -0,0 +1,15 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`GetGeneratedTemplate`](crate::operation::get_generated_template::builders::GetGeneratedTemplateFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`format(TemplateFormat)`](crate::operation::get_generated_template::builders::GetGeneratedTemplateFluentBuilder::format) / [`set_format(Option)`](crate::operation::get_generated_template::builders::GetGeneratedTemplateFluentBuilder::set_format):
required: **false**

The language to use to retrieve for the generated template. Supported values are:

  • JSON

  • YAML


+ /// - [`generated_template_name(impl Into)`](crate::operation::get_generated_template::builders::GetGeneratedTemplateFluentBuilder::generated_template_name) / [`set_generated_template_name(Option)`](crate::operation::get_generated_template::builders::GetGeneratedTemplateFluentBuilder::set_generated_template_name):
required: **true**

The name or Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .


+ /// - On success, responds with [`GetGeneratedTemplateOutput`](crate::operation::get_generated_template::GetGeneratedTemplateOutput) with field(s): + /// - [`status(Option)`](crate::operation::get_generated_template::GetGeneratedTemplateOutput::status):

The status of the template generation. Supported values are:

  • CreatePending - the creation of the template is pending.

  • CreateInProgress - the creation of the template is in progress.

  • DeletePending - the deletion of the template is pending.

  • DeleteInProgress - the deletion of the template is in progress.

  • UpdatePending - the update of the template is pending.

  • UpdateInProgress - the update of the template is in progress.

  • Failed - the template operation failed.

  • Complete - the template operation is complete.

+ /// - [`template_body(Option)`](crate::operation::get_generated_template::GetGeneratedTemplateOutput::template_body):

The template body of the generated template, in the language specified by the Language parameter.

+ /// - On failure, responds with [`SdkError`](crate::operation::get_generated_template::GetGeneratedTemplateError) + pub fn get_generated_template(&self) -> crate::operation::get_generated_template::builders::GetGeneratedTemplateFluentBuilder { + crate::operation::get_generated_template::builders::GetGeneratedTemplateFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/cloudformation/src/client/list_generated_templates.rs b/sdk/cloudformation/src/client/list_generated_templates.rs new file mode 100644 index 000000000000..c3bdf7914e57 --- /dev/null +++ b/sdk/cloudformation/src/client/list_generated_templates.rs @@ -0,0 +1,16 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListGeneratedTemplates`](crate::operation::list_generated_templates::builders::ListGeneratedTemplatesFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_generated_templates::builders::ListGeneratedTemplatesFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`next_token(impl Into)`](crate::operation::list_generated_templates::builders::ListGeneratedTemplatesFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_generated_templates::builders::ListGeneratedTemplatesFluentBuilder::set_next_token):
required: **false**

A string that identifies the next page of resource scan results.


+ /// - [`max_results(i32)`](crate::operation::list_generated_templates::builders::ListGeneratedTemplatesFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_generated_templates::builders::ListGeneratedTemplatesFluentBuilder::set_max_results):
required: **false**

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListGeneratedTemplates API action will return at most 50 results in each response. The maximum value is 100.


+ /// - On success, responds with [`ListGeneratedTemplatesOutput`](crate::operation::list_generated_templates::ListGeneratedTemplatesOutput) with field(s): + /// - [`summaries(Option>)`](crate::operation::list_generated_templates::ListGeneratedTemplatesOutput::summaries):

A list of summaries of the generated templates.

+ /// - [`next_token(Option)`](crate::operation::list_generated_templates::ListGeneratedTemplatesOutput::next_token):

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListGeneratedTemplates again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ /// - On failure, responds with [`SdkError`](crate::operation::list_generated_templates::ListGeneratedTemplatesError) + pub fn list_generated_templates(&self) -> crate::operation::list_generated_templates::builders::ListGeneratedTemplatesFluentBuilder { + crate::operation::list_generated_templates::builders::ListGeneratedTemplatesFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/cloudformation/src/client/list_resource_scan_related_resources.rs b/sdk/cloudformation/src/client/list_resource_scan_related_resources.rs new file mode 100644 index 000000000000..077803d26b98 --- /dev/null +++ b/sdk/cloudformation/src/client/list_resource_scan_related_resources.rs @@ -0,0 +1,20 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListResourceScanRelatedResources`](crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`resource_scan_id(impl Into)`](crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder::resource_scan_id) / [`set_resource_scan_id(Option)`](crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder::set_resource_scan_id):
required: **true**

The Amazon Resource Name (ARN) of the resource scan.


+ /// - [`resources(ScannedResourceIdentifier)`](crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder::resources) / [`set_resources(Option>)`](crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder::set_resources):
required: **true**

The list of resources for which you want to get the related resources. Up to 100 resources can be provided.


+ /// - [`next_token(impl Into)`](crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder::set_next_token):
required: **false**

A string that identifies the next page of resource scan results.


+ /// - [`max_results(i32)`](crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder::set_max_results):
required: **false**

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanRelatedResources API action will return up to 100 results in each response. The maximum value is 100.


+ /// - On success, responds with [`ListResourceScanRelatedResourcesOutput`](crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput) with field(s): + /// - [`related_resources(Option>)`](crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput::related_resources):

List of up to MaxResults resources in the specified resource scan related to the specified resources.

+ /// - [`next_token(Option)`](crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput::next_token):

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanRelatedResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ /// - On failure, responds with [`SdkError`](crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError) + pub fn list_resource_scan_related_resources( + &self, + ) -> crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder { + crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/cloudformation/src/client/list_resource_scan_resources.rs b/sdk/cloudformation/src/client/list_resource_scan_resources.rs new file mode 100644 index 000000000000..094d4591ed22 --- /dev/null +++ b/sdk/cloudformation/src/client/list_resource_scan_resources.rs @@ -0,0 +1,21 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListResourceScanResources`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`resource_scan_id(impl Into)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::resource_scan_id) / [`set_resource_scan_id(Option)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::set_resource_scan_id):
required: **true**

The Amazon Resource Name (ARN) of the resource scan.


+ /// - [`resource_identifier(impl Into)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::resource_identifier) / [`set_resource_identifier(Option)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::set_resource_identifier):
required: **false**

If specified, the returned resources will have the specified resource identifier (or one of them in the case where the resource has multiple identifiers).


+ /// - [`resource_type_prefix(impl Into)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::resource_type_prefix) / [`set_resource_type_prefix(Option)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::set_resource_type_prefix):
required: **false**

If specified, the returned resources will be of any of the resource types with the specified prefix.


+ /// - [`tag_key(impl Into)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::tag_key) / [`set_tag_key(Option)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::set_tag_key):
required: **false**

If specified, the returned resources will have a matching tag key.


+ /// - [`tag_value(impl Into)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::tag_value) / [`set_tag_value(Option)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::set_tag_value):
required: **false**

If specified, the returned resources will have a matching tag value.


+ /// - [`next_token(impl Into)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::set_next_token):
required: **false**

A string that identifies the next page of resource scan results.


+ /// - [`max_results(i32)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::set_max_results):
required: **false**

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanResources API action will return at most 100 results in each response. The maximum value is 100.


+ /// - On success, responds with [`ListResourceScanResourcesOutput`](crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput) with field(s): + /// - [`resources(Option>)`](crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput::resources):

List of up to MaxResults resources in the specified resource scan that match all of the specified filters.

+ /// - [`next_token(Option)`](crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput::next_token):

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ /// - On failure, responds with [`SdkError`](crate::operation::list_resource_scan_resources::ListResourceScanResourcesError) + pub fn list_resource_scan_resources(&self) -> crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder { + crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/cloudformation/src/client/list_resource_scans.rs b/sdk/cloudformation/src/client/list_resource_scans.rs new file mode 100644 index 000000000000..d39e05f37a60 --- /dev/null +++ b/sdk/cloudformation/src/client/list_resource_scans.rs @@ -0,0 +1,16 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListResourceScans`](crate::operation::list_resource_scans::builders::ListResourceScansFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_resource_scans::builders::ListResourceScansFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`next_token(impl Into)`](crate::operation::list_resource_scans::builders::ListResourceScansFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_resource_scans::builders::ListResourceScansFluentBuilder::set_next_token):
required: **false**

A string that identifies the next page of resource scan results.


+ /// - [`max_results(i32)`](crate::operation::list_resource_scans::builders::ListResourceScansFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_resource_scans::builders::ListResourceScansFluentBuilder::set_max_results):
required: **false**

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. The default value is 10. The maximum value is 100.


+ /// - On success, responds with [`ListResourceScansOutput`](crate::operation::list_resource_scans::ListResourceScansOutput) with field(s): + /// - [`resource_scan_summaries(Option>)`](crate::operation::list_resource_scans::ListResourceScansOutput::resource_scan_summaries):

The list of scans returned.

+ /// - [`next_token(Option)`](crate::operation::list_resource_scans::ListResourceScansOutput::next_token):

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScans again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ /// - On failure, responds with [`SdkError`](crate::operation::list_resource_scans::ListResourceScansError) + pub fn list_resource_scans(&self) -> crate::operation::list_resource_scans::builders::ListResourceScansFluentBuilder { + crate::operation::list_resource_scans::builders::ListResourceScansFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/cloudformation/src/client/start_resource_scan.rs b/sdk/cloudformation/src/client/start_resource_scan.rs new file mode 100644 index 000000000000..6ac2fc39c2ed --- /dev/null +++ b/sdk/cloudformation/src/client/start_resource_scan.rs @@ -0,0 +1,13 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`StartResourceScan`](crate::operation::start_resource_scan::builders::StartResourceScanFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`client_request_token(impl Into)`](crate::operation::start_resource_scan::builders::StartResourceScanFluentBuilder::client_request_token) / [`set_client_request_token(Option)`](crate::operation::start_resource_scan::builders::StartResourceScanFluentBuilder::set_client_request_token):
required: **false**

A unique identifier for this StartResourceScan request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to start a new resource scan.


+ /// - On success, responds with [`StartResourceScanOutput`](crate::operation::start_resource_scan::StartResourceScanOutput) with field(s): + /// - [`resource_scan_id(Option)`](crate::operation::start_resource_scan::StartResourceScanOutput::resource_scan_id):

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ /// - On failure, responds with [`SdkError`](crate::operation::start_resource_scan::StartResourceScanError) + pub fn start_resource_scan(&self) -> crate::operation::start_resource_scan::builders::StartResourceScanFluentBuilder { + crate::operation::start_resource_scan::builders::StartResourceScanFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/cloudformation/src/client/update_generated_template.rs b/sdk/cloudformation/src/client/update_generated_template.rs new file mode 100644 index 000000000000..5233f343d3a8 --- /dev/null +++ b/sdk/cloudformation/src/client/update_generated_template.rs @@ -0,0 +1,18 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`UpdateGeneratedTemplate`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`generated_template_name(impl Into)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::generated_template_name) / [`set_generated_template_name(Option)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::set_generated_template_name):
required: **true**

The name or Amazon Resource Name (ARN) of a generated template.


+ /// - [`new_generated_template_name(impl Into)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::new_generated_template_name) / [`set_new_generated_template_name(Option)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::set_new_generated_template_name):
required: **false**

An optional new name to assign to the generated template.


+ /// - [`add_resources(ResourceDefinition)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::add_resources) / [`set_add_resources(Option>)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::set_add_resources):
required: **false**

An optional list of resources to be added to the generated template.


+ /// - [`remove_resources(impl Into)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::remove_resources) / [`set_remove_resources(Option>)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::set_remove_resources):
required: **false**

A list of logical ids for resources to remove from the generated template.


+ /// - [`refresh_all_resources(bool)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::refresh_all_resources) / [`set_refresh_all_resources(Option)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::set_refresh_all_resources):
required: **false**

If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template.


+ /// - [`template_configuration(TemplateConfiguration)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::template_configuration) / [`set_template_configuration(Option)`](crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::set_template_configuration):
required: **false**

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.


+ /// - On success, responds with [`UpdateGeneratedTemplateOutput`](crate::operation::update_generated_template::UpdateGeneratedTemplateOutput) with field(s): + /// - [`generated_template_id(Option)`](crate::operation::update_generated_template::UpdateGeneratedTemplateOutput::generated_template_id):

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ /// - On failure, responds with [`SdkError`](crate::operation::update_generated_template::UpdateGeneratedTemplateError) + pub fn update_generated_template(&self) -> crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder { + crate::operation::update_generated_template::builders::UpdateGeneratedTemplateFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/cloudformation/src/error_meta.rs b/sdk/cloudformation/src/error_meta.rs index f6750e0b380b..8ed9839fc062 100644 --- a/sdk/cloudformation/src/error_meta.rs +++ b/sdk/cloudformation/src/error_meta.rs @@ -9,8 +9,12 @@ pub enum Error { CfnRegistryException(crate::types::error::CfnRegistryException), ///

The specified change set name or ID doesn't exit. To view valid change sets for a stack, use the ListChangeSets operation.

ChangeSetNotFoundException(crate::types::error::ChangeSetNotFoundException), + ///

No more than 5 generated templates can be in an InProgress or Pending status at one time. This error is also returned if a generated template that is in an InProgress or Pending status is attempted to be updated or deleted.

+ ConcurrentResourcesLimitExceededException(crate::types::error::ConcurrentResourcesLimitExceededException), ///

The specified resource exists, but has been changed.

CreatedButModifiedException(crate::types::error::CreatedButModifiedException), + ///

The generated template was not found.

+ GeneratedTemplateNotFoundException(crate::types::error::GeneratedTemplateNotFoundException), ///

The template contains resources with capabilities that weren't specified in the Capabilities parameter.

InsufficientCapabilitiesException(crate::types::error::InsufficientCapabilitiesException), ///

The specified change set can't be used to update the stack. For example, the change set status might be CREATE_IN_PROGRESS, or the stack status might be UPDATE_IN_PROGRESS.

@@ -32,6 +36,20 @@ pub enum Error { OperationNotFoundException(crate::types::error::OperationNotFoundException), ///

Error reserved for use by the CloudFormation CLI. CloudFormation doesn't return this error to users.

OperationStatusCheckFailedException(crate::types::error::OperationStatusCheckFailedException), + ///

A resource scan is currently in progress. Only one can be run at a time for an account in a Region.

+ ResourceScanInProgressException(crate::types::error::ResourceScanInProgressException), + ///

The limit on resource scans has been exceeded. Reasons include:

+ ///
    + ///
  • + ///

    Exceeded the daily quota for resource scans.

  • + ///
  • + ///

    A resource scan recently failed. You must wait 10 minutes before starting a new resource scan.

  • + ///
  • + ///

    The last resource scan failed after exceeding 100,000 resources. When this happens, you must wait 24 hours before starting a new resource scan.

  • + ///
+ ResourceScanLimitExceededException(crate::types::error::ResourceScanLimitExceededException), + ///

The resource scan was not found.

+ ResourceScanNotFoundException(crate::types::error::ResourceScanNotFoundException), ///

The specified stack instance doesn't exist.

StackInstanceNotFoundException(crate::types::error::StackInstanceNotFoundException), ///

The specified stack ARN doesn't exist or stack doesn't exist corresponding to the ARN in input.

@@ -63,7 +81,9 @@ impl ::std::fmt::Display for Error { Error::AlreadyExistsException(inner) => inner.fmt(f), Error::CfnRegistryException(inner) => inner.fmt(f), Error::ChangeSetNotFoundException(inner) => inner.fmt(f), + Error::ConcurrentResourcesLimitExceededException(inner) => inner.fmt(f), Error::CreatedButModifiedException(inner) => inner.fmt(f), + Error::GeneratedTemplateNotFoundException(inner) => inner.fmt(f), Error::InsufficientCapabilitiesException(inner) => inner.fmt(f), Error::InvalidChangeSetStatusException(inner) => inner.fmt(f), Error::InvalidOperationException(inner) => inner.fmt(f), @@ -74,6 +94,9 @@ impl ::std::fmt::Display for Error { Error::OperationInProgressException(inner) => inner.fmt(f), Error::OperationNotFoundException(inner) => inner.fmt(f), Error::OperationStatusCheckFailedException(inner) => inner.fmt(f), + Error::ResourceScanInProgressException(inner) => inner.fmt(f), + Error::ResourceScanLimitExceededException(inner) => inner.fmt(f), + Error::ResourceScanNotFoundException(inner) => inner.fmt(f), Error::StackInstanceNotFoundException(inner) => inner.fmt(f), Error::StackNotFoundException(inner) => inner.fmt(f), Error::StackSetNotEmptyException(inner) => inner.fmt(f), @@ -106,7 +129,9 @@ impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error { Self::AlreadyExistsException(inner) => inner.meta(), Self::CfnRegistryException(inner) => inner.meta(), Self::ChangeSetNotFoundException(inner) => inner.meta(), + Self::ConcurrentResourcesLimitExceededException(inner) => inner.meta(), Self::CreatedButModifiedException(inner) => inner.meta(), + Self::GeneratedTemplateNotFoundException(inner) => inner.meta(), Self::InsufficientCapabilitiesException(inner) => inner.meta(), Self::InvalidChangeSetStatusException(inner) => inner.meta(), Self::InvalidOperationException(inner) => inner.meta(), @@ -117,6 +142,9 @@ impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error { Self::OperationInProgressException(inner) => inner.meta(), Self::OperationNotFoundException(inner) => inner.meta(), Self::OperationStatusCheckFailedException(inner) => inner.meta(), + Self::ResourceScanInProgressException(inner) => inner.meta(), + Self::ResourceScanLimitExceededException(inner) => inner.meta(), + Self::ResourceScanNotFoundException(inner) => inner.meta(), Self::StackInstanceNotFoundException(inner) => inner.meta(), Self::StackNotFoundException(inner) => inner.meta(), Self::StackSetNotEmptyException(inner) => inner.meta(), @@ -296,6 +324,39 @@ impl From for Error { } } } +impl From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::create_generated_template::CreateGeneratedTemplateError) -> Self { + match err { + crate::operation::create_generated_template::CreateGeneratedTemplateError::AlreadyExistsException(inner) => { + Error::AlreadyExistsException(inner) + } + crate::operation::create_generated_template::CreateGeneratedTemplateError::ConcurrentResourcesLimitExceededException(inner) => { + Error::ConcurrentResourcesLimitExceededException(inner) + } + crate::operation::create_generated_template::CreateGeneratedTemplateError::LimitExceededException(inner) => { + Error::LimitExceededException(inner) + } + crate::operation::create_generated_template::CreateGeneratedTemplateError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, @@ -465,6 +526,36 @@ impl From for Error { } } } +impl From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::delete_generated_template::DeleteGeneratedTemplateError) -> Self { + match err { + crate::operation::delete_generated_template::DeleteGeneratedTemplateError::ConcurrentResourcesLimitExceededException(inner) => { + Error::ConcurrentResourcesLimitExceededException(inner) + } + crate::operation::delete_generated_template::DeleteGeneratedTemplateError::GeneratedTemplateNotFoundException(inner) => { + Error::GeneratedTemplateNotFoundException(inner) + } + crate::operation::delete_generated_template::DeleteGeneratedTemplateError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, @@ -643,6 +734,33 @@ impl From From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::describe_generated_template::DescribeGeneratedTemplateError) -> Self { + match err { + crate::operation::describe_generated_template::DescribeGeneratedTemplateError::GeneratedTemplateNotFoundException(inner) => { + Error::GeneratedTemplateNotFoundException(inner) + } + crate::operation::describe_generated_template::DescribeGeneratedTemplateError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where @@ -695,6 +813,30 @@ impl From for Erro } } } +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::describe_resource_scan::DescribeResourceScanError) -> Self { + match err { + crate::operation::describe_resource_scan::DescribeResourceScanError::ResourceScanNotFoundException(inner) => { + Error::ResourceScanNotFoundException(inner) + } + crate::operation::describe_resource_scan::DescribeResourceScanError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From< ::aws_smithy_runtime_api::client::result::SdkError< @@ -1105,6 +1247,30 @@ impl From for Error } } } +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::get_generated_template::GetGeneratedTemplateError) -> Self { + match err { + crate::operation::get_generated_template::GetGeneratedTemplateError::GeneratedTemplateNotFoundException(inner) => { + Error::GeneratedTemplateNotFoundException(inner) + } + crate::operation::get_generated_template::GetGeneratedTemplateError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, @@ -1259,6 +1425,29 @@ impl From for Error { } } } +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_generated_templates::ListGeneratedTemplatesError) -> Self { + match err { + crate::operation::list_generated_templates::ListGeneratedTemplatesError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, @@ -1280,6 +1469,97 @@ impl From for Error { } } } +impl + From< + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + R, + >, + > for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + R, + >, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError) -> Self { + match err { + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError::ResourceScanInProgressException(inner) => { + Error::ResourceScanInProgressException(inner) + } + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError::ResourceScanNotFoundException(inner) => { + Error::ResourceScanNotFoundException(inner) + } + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError::Unhandled(inner) => { + Error::Unhandled(inner) + } + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_resource_scan_resources::ListResourceScanResourcesError) -> Self { + match err { + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError::ResourceScanInProgressException(inner) => { + Error::ResourceScanInProgressException(inner) + } + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError::ResourceScanNotFoundException(inner) => { + Error::ResourceScanNotFoundException(inner) + } + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_resource_scans::ListResourceScansError) -> Self { + match err { + crate::operation::list_resource_scans::ListResourceScansError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From< ::aws_smithy_runtime_api::client::result::SdkError< @@ -1747,6 +2027,33 @@ impl From for Error { } } } +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::start_resource_scan::StartResourceScanError) -> Self { + match err { + crate::operation::start_resource_scan::StartResourceScanError::ResourceScanInProgressException(inner) => { + Error::ResourceScanInProgressException(inner) + } + crate::operation::start_resource_scan::StartResourceScanError::ResourceScanLimitExceededException(inner) => { + Error::ResourceScanLimitExceededException(inner) + } + crate::operation::start_resource_scan::StartResourceScanError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, @@ -1802,6 +2109,39 @@ impl From for Error { } } } +impl From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::update_generated_template::UpdateGeneratedTemplateError) -> Self { + match err { + crate::operation::update_generated_template::UpdateGeneratedTemplateError::AlreadyExistsException(inner) => { + Error::AlreadyExistsException(inner) + } + crate::operation::update_generated_template::UpdateGeneratedTemplateError::GeneratedTemplateNotFoundException(inner) => { + Error::GeneratedTemplateNotFoundException(inner) + } + crate::operation::update_generated_template::UpdateGeneratedTemplateError::LimitExceededException(inner) => { + Error::LimitExceededException(inner) + } + crate::operation::update_generated_template::UpdateGeneratedTemplateError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, @@ -1948,7 +2288,9 @@ impl ::std::error::Error for Error { Error::AlreadyExistsException(inner) => inner.source(), Error::CfnRegistryException(inner) => inner.source(), Error::ChangeSetNotFoundException(inner) => inner.source(), + Error::ConcurrentResourcesLimitExceededException(inner) => inner.source(), Error::CreatedButModifiedException(inner) => inner.source(), + Error::GeneratedTemplateNotFoundException(inner) => inner.source(), Error::InsufficientCapabilitiesException(inner) => inner.source(), Error::InvalidChangeSetStatusException(inner) => inner.source(), Error::InvalidOperationException(inner) => inner.source(), @@ -1959,6 +2301,9 @@ impl ::std::error::Error for Error { Error::OperationInProgressException(inner) => inner.source(), Error::OperationNotFoundException(inner) => inner.source(), Error::OperationStatusCheckFailedException(inner) => inner.source(), + Error::ResourceScanInProgressException(inner) => inner.source(), + Error::ResourceScanLimitExceededException(inner) => inner.source(), + Error::ResourceScanNotFoundException(inner) => inner.source(), Error::StackInstanceNotFoundException(inner) => inner.source(), Error::StackNotFoundException(inner) => inner.source(), Error::StackSetNotEmptyException(inner) => inner.source(), @@ -1977,7 +2322,9 @@ impl ::aws_types::request_id::RequestId for Error { Self::AlreadyExistsException(e) => e.request_id(), Self::CfnRegistryException(e) => e.request_id(), Self::ChangeSetNotFoundException(e) => e.request_id(), + Self::ConcurrentResourcesLimitExceededException(e) => e.request_id(), Self::CreatedButModifiedException(e) => e.request_id(), + Self::GeneratedTemplateNotFoundException(e) => e.request_id(), Self::InsufficientCapabilitiesException(e) => e.request_id(), Self::InvalidChangeSetStatusException(e) => e.request_id(), Self::InvalidOperationException(e) => e.request_id(), @@ -1988,6 +2335,9 @@ impl ::aws_types::request_id::RequestId for Error { Self::OperationInProgressException(e) => e.request_id(), Self::OperationNotFoundException(e) => e.request_id(), Self::OperationStatusCheckFailedException(e) => e.request_id(), + Self::ResourceScanInProgressException(e) => e.request_id(), + Self::ResourceScanLimitExceededException(e) => e.request_id(), + Self::ResourceScanNotFoundException(e) => e.request_id(), Self::StackInstanceNotFoundException(e) => e.request_id(), Self::StackNotFoundException(e) => e.request_id(), Self::StackSetNotEmptyException(e) => e.request_id(), diff --git a/sdk/cloudformation/src/lens.rs b/sdk/cloudformation/src/lens.rs index 57a4d0b56ac9..1103cf25cc4d 100644 --- a/sdk/cloudformation/src/lens.rs +++ b/sdk/cloudformation/src/lens.rs @@ -59,6 +59,16 @@ pub(crate) fn reflens_list_exports_output_output_next_token( ::std::option::Option::Some(input) } +pub(crate) fn reflens_list_generated_templates_output_output_next_token( + input: &crate::operation::list_generated_templates::ListGeneratedTemplatesOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + pub(crate) fn reflens_list_imports_output_output_next_token( input: &crate::operation::list_imports::ListImportsOutput, ) -> ::std::option::Option<&::std::string::String> { @@ -69,6 +79,36 @@ pub(crate) fn reflens_list_imports_output_output_next_token( ::std::option::Option::Some(input) } +pub(crate) fn reflens_list_resource_scan_related_resources_output_output_next_token( + input: &crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn reflens_list_resource_scan_resources_output_output_next_token( + input: &crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn reflens_list_resource_scans_output_output_next_token( + input: &crate::operation::list_resource_scans::ListResourceScansOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + pub(crate) fn reflens_list_stack_instances_output_output_next_token( input: &crate::operation::list_stack_instances::ListStackInstancesOutput, ) -> ::std::option::Option<&::std::string::String> { @@ -209,6 +249,16 @@ pub(crate) fn lens_list_exports_output_output_exports( ::std::option::Option::Some(input) } +pub(crate) fn lens_list_generated_templates_output_output_summaries( + input: crate::operation::list_generated_templates::ListGeneratedTemplatesOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = match input.summaries { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + pub(crate) fn lens_list_imports_output_output_imports( input: crate::operation::list_imports::ListImportsOutput, ) -> ::std::option::Option<::std::vec::Vec<::std::string::String>> { @@ -219,6 +269,36 @@ pub(crate) fn lens_list_imports_output_output_imports( ::std::option::Option::Some(input) } +pub(crate) fn lens_list_resource_scan_related_resources_output_output_related_resources( + input: crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = match input.related_resources { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_list_resource_scan_resources_output_output_resources( + input: crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = match input.resources { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_list_resource_scans_output_output_resource_scan_summaries( + input: crate::operation::list_resource_scans::ListResourceScansOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = match input.resource_scan_summaries { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + pub(crate) fn lens_list_stack_instances_output_output_summaries( input: crate::operation::list_stack_instances::ListStackInstancesOutput, ) -> ::std::option::Option<::std::vec::Vec> { diff --git a/sdk/cloudformation/src/lib.rs b/sdk/cloudformation/src/lib.rs index 08a156af5942..b6b4ed3400e0 100644 --- a/sdk/cloudformation/src/lib.rs +++ b/sdk/cloudformation/src/lib.rs @@ -35,7 +35,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.4", features = ["behavior-version-latest"] } -//! aws-sdk-cloudformation = "1.13.0" +//! aws-sdk-cloudformation = "1.14.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/cloudformation/src/operation.rs b/sdk/cloudformation/src/operation.rs index b8443b3b7f83..edf429c4d50b 100644 --- a/sdk/cloudformation/src/operation.rs +++ b/sdk/cloudformation/src/operation.rs @@ -19,6 +19,9 @@ pub mod continue_update_rollback; /// Types for the `CreateChangeSet` operation. pub mod create_change_set; +/// Types for the `CreateGeneratedTemplate` operation. +pub mod create_generated_template; + /// Types for the `CreateStack` operation. pub mod create_stack; @@ -37,6 +40,9 @@ pub mod deactivate_type; /// Types for the `DeleteChangeSet` operation. pub mod delete_change_set; +/// Types for the `DeleteGeneratedTemplate` operation. +pub mod delete_generated_template; + /// Types for the `DeleteStack` operation. pub mod delete_stack; @@ -58,12 +64,18 @@ pub mod describe_change_set; /// Types for the `DescribeChangeSetHooks` operation. pub mod describe_change_set_hooks; +/// Types for the `DescribeGeneratedTemplate` operation. +pub mod describe_generated_template; + /// Types for the `DescribeOrganizationsAccess` operation. pub mod describe_organizations_access; /// Types for the `DescribePublisher` operation. pub mod describe_publisher; +/// Types for the `DescribeResourceScan` operation. +pub mod describe_resource_scan; + /// Types for the `DescribeStackDriftDetectionStatus` operation. pub mod describe_stack_drift_detection_status; @@ -112,6 +124,9 @@ pub mod estimate_template_cost; /// Types for the `ExecuteChangeSet` operation. pub mod execute_change_set; +/// Types for the `GetGeneratedTemplate` operation. +pub mod get_generated_template; + /// Types for the `GetStackPolicy` operation. pub mod get_stack_policy; @@ -130,9 +145,21 @@ pub mod list_change_sets; /// Types for the `ListExports` operation. pub mod list_exports; +/// Types for the `ListGeneratedTemplates` operation. +pub mod list_generated_templates; + /// Types for the `ListImports` operation. pub mod list_imports; +/// Types for the `ListResourceScanRelatedResources` operation. +pub mod list_resource_scan_related_resources; + +/// Types for the `ListResourceScanResources` operation. +pub mod list_resource_scan_resources; + +/// Types for the `ListResourceScans` operation. +pub mod list_resource_scans; + /// Types for the `ListStackInstanceResourceDrifts` operation. pub mod list_stack_instance_resource_drifts; @@ -190,12 +217,18 @@ pub mod set_type_default_version; /// Types for the `SignalResource` operation. pub mod signal_resource; +/// Types for the `StartResourceScan` operation. +pub mod start_resource_scan; + /// Types for the `StopStackSetOperation` operation. pub mod stop_stack_set_operation; /// Types for the `TestType` operation. pub mod test_type; +/// Types for the `UpdateGeneratedTemplate` operation. +pub mod update_generated_template; + /// Types for the `UpdateStack` operation. pub mod update_stack; diff --git a/sdk/cloudformation/src/operation/create_generated_template.rs b/sdk/cloudformation/src/operation/create_generated_template.rs new file mode 100644 index 000000000000..eef7b302d55f --- /dev/null +++ b/sdk/cloudformation/src/operation/create_generated_template.rs @@ -0,0 +1,384 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `CreateGeneratedTemplate`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateGeneratedTemplate; +impl CreateGeneratedTemplate { + /// Creates a new `CreateGeneratedTemplate` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::create_generated_template::CreateGeneratedTemplateInput, + ) -> ::std::result::Result< + crate::operation::create_generated_template::CreateGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_generated_template::CreateGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::create_generated_template::CreateGeneratedTemplateInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "cloudformation", + "CreateGeneratedTemplate", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateGeneratedTemplate { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateGeneratedTemplate"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + CreateGeneratedTemplateRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + CreateGeneratedTemplateResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "CreateGeneratedTemplate", + "cloudformation", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateGeneratedTemplate") + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::new( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptorKind::ResponseBody, + ), + ) + .with_interceptor(CreateGeneratedTemplateEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::create_generated_template::CreateGeneratedTemplateError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::create_generated_template::CreateGeneratedTemplateError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::create_generated_template::CreateGeneratedTemplateError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct CreateGeneratedTemplateResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateGeneratedTemplateResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_create_generated_template::de_create_generated_template_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_create_generated_template::de_create_generated_template_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct CreateGeneratedTemplateRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateGeneratedTemplateRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::create_generated_template::CreateGeneratedTemplateInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::create_generated_template::CreateGeneratedTemplateInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_create_generated_template_input::ser_create_generated_template_input_input_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct CreateGeneratedTemplateEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateGeneratedTemplateEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "CreateGeneratedTemplateEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to CreateGeneratedTemplateInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +/// Error type for the `CreateGeneratedTemplateError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum CreateGeneratedTemplateError { + ///

The resource with the name requested already exists.

+ AlreadyExistsException(crate::types::error::AlreadyExistsException), + ///

No more than 5 generated templates can be in an InProgress or Pending status at one time. This error is also returned if a generated template that is in an InProgress or Pending status is attempted to be updated or deleted.

+ ConcurrentResourcesLimitExceededException(crate::types::error::ConcurrentResourcesLimitExceededException), + ///

The quota for the resource has already been reached.

+ ///

For information about resource and stack limitations, see CloudFormation quotas in the CloudFormation User Guide.

+ LimitExceededException(crate::types::error::LimitExceededException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateGeneratedTemplateError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl CreateGeneratedTemplateError { + /// Creates the `CreateGeneratedTemplateError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `CreateGeneratedTemplateError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConcurrentResourcesLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::LimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `CreateGeneratedTemplateError::AlreadyExistsException`. + pub fn is_already_exists_exception(&self) -> bool { + matches!(self, Self::AlreadyExistsException(_)) + } + /// Returns `true` if the error kind is `CreateGeneratedTemplateError::ConcurrentResourcesLimitExceededException`. + pub fn is_concurrent_resources_limit_exceeded_exception(&self) -> bool { + matches!(self, Self::ConcurrentResourcesLimitExceededException(_)) + } + /// Returns `true` if the error kind is `CreateGeneratedTemplateError::LimitExceededException`. + pub fn is_limit_exceeded_exception(&self) -> bool { + matches!(self, Self::LimitExceededException(_)) + } +} +impl ::std::error::Error for CreateGeneratedTemplateError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AlreadyExistsException(_inner) => ::std::option::Option::Some(_inner), + Self::ConcurrentResourcesLimitExceededException(_inner) => ::std::option::Option::Some(_inner), + Self::LimitExceededException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for CreateGeneratedTemplateError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AlreadyExistsException(_inner) => _inner.fmt(f), + Self::ConcurrentResourcesLimitExceededException(_inner) => _inner.fmt(f), + Self::LimitExceededException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for CreateGeneratedTemplateError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateGeneratedTemplateError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConcurrentResourcesLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::LimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateGeneratedTemplateError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::create_generated_template::CreateGeneratedTemplateError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::create_generated_template::_create_generated_template_output::CreateGeneratedTemplateOutput; + +pub use crate::operation::create_generated_template::_create_generated_template_input::CreateGeneratedTemplateInput; + +mod _create_generated_template_input; + +mod _create_generated_template_output; + +/// Builders +pub mod builders; diff --git a/sdk/cloudformation/src/operation/create_generated_template/_create_generated_template_input.rs b/sdk/cloudformation/src/operation/create_generated_template/_create_generated_template_input.rs new file mode 100644 index 000000000000..1b782e5e51f2 --- /dev/null +++ b/sdk/cloudformation/src/operation/create_generated_template/_create_generated_template_input.rs @@ -0,0 +1,134 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct CreateGeneratedTemplateInput { + ///

An optional list of resources to be included in the generated template.

+ ///

If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action.

+ pub resources: ::std::option::Option<::std::vec::Vec>, + ///

The name assigned to the generated template.

+ pub generated_template_name: ::std::option::Option<::std::string::String>, + ///

An optional name or ARN of a stack to use as the base stack for the generated template.

+ pub stack_name: ::std::option::Option<::std::string::String>, + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub template_configuration: ::std::option::Option, +} +impl CreateGeneratedTemplateInput { + ///

An optional list of resources to be included in the generated template.

+ ///

If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resources.is_none()`. + pub fn resources(&self) -> &[crate::types::ResourceDefinition] { + self.resources.as_deref().unwrap_or_default() + } + ///

The name assigned to the generated template.

+ pub fn generated_template_name(&self) -> ::std::option::Option<&str> { + self.generated_template_name.as_deref() + } + ///

An optional name or ARN of a stack to use as the base stack for the generated template.

+ pub fn stack_name(&self) -> ::std::option::Option<&str> { + self.stack_name.as_deref() + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn template_configuration(&self) -> ::std::option::Option<&crate::types::TemplateConfiguration> { + self.template_configuration.as_ref() + } +} +impl CreateGeneratedTemplateInput { + /// Creates a new builder-style object to manufacture [`CreateGeneratedTemplateInput`](crate::operation::create_generated_template::CreateGeneratedTemplateInput). + pub fn builder() -> crate::operation::create_generated_template::builders::CreateGeneratedTemplateInputBuilder { + crate::operation::create_generated_template::builders::CreateGeneratedTemplateInputBuilder::default() + } +} + +/// A builder for [`CreateGeneratedTemplateInput`](crate::operation::create_generated_template::CreateGeneratedTemplateInput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct CreateGeneratedTemplateInputBuilder { + pub(crate) resources: ::std::option::Option<::std::vec::Vec>, + pub(crate) generated_template_name: ::std::option::Option<::std::string::String>, + pub(crate) stack_name: ::std::option::Option<::std::string::String>, + pub(crate) template_configuration: ::std::option::Option, +} +impl CreateGeneratedTemplateInputBuilder { + /// Appends an item to `resources`. + /// + /// To override the contents of this collection use [`set_resources`](Self::set_resources). + /// + ///

An optional list of resources to be included in the generated template.

+ ///

If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action.

+ pub fn resources(mut self, input: crate::types::ResourceDefinition) -> Self { + let mut v = self.resources.unwrap_or_default(); + v.push(input); + self.resources = ::std::option::Option::Some(v); + self + } + ///

An optional list of resources to be included in the generated template.

+ ///

If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action.

+ pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.resources = input; + self + } + ///

An optional list of resources to be included in the generated template.

+ ///

If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action.

+ pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.resources + } + ///

The name assigned to the generated template.

+ /// This field is required. + pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.generated_template_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name assigned to the generated template.

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.generated_template_name = input; + self + } + ///

The name assigned to the generated template.

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + &self.generated_template_name + } + ///

An optional name or ARN of a stack to use as the base stack for the generated template.

+ pub fn stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.stack_name = ::std::option::Option::Some(input.into()); + self + } + ///

An optional name or ARN of a stack to use as the base stack for the generated template.

+ pub fn set_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.stack_name = input; + self + } + ///

An optional name or ARN of a stack to use as the base stack for the generated template.

+ pub fn get_stack_name(&self) -> &::std::option::Option<::std::string::String> { + &self.stack_name + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn template_configuration(mut self, input: crate::types::TemplateConfiguration) -> Self { + self.template_configuration = ::std::option::Option::Some(input); + self + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn set_template_configuration(mut self, input: ::std::option::Option) -> Self { + self.template_configuration = input; + self + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn get_template_configuration(&self) -> &::std::option::Option { + &self.template_configuration + } + /// Consumes the builder and constructs a [`CreateGeneratedTemplateInput`](crate::operation::create_generated_template::CreateGeneratedTemplateInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::create_generated_template::CreateGeneratedTemplateInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::create_generated_template::CreateGeneratedTemplateInput { + resources: self.resources, + generated_template_name: self.generated_template_name, + stack_name: self.stack_name, + template_configuration: self.template_configuration, + }) + } +} diff --git a/sdk/cloudformation/src/operation/create_generated_template/_create_generated_template_output.rs b/sdk/cloudformation/src/operation/create_generated_template/_create_generated_template_output.rs new file mode 100644 index 000000000000..2e6a6a6f9a48 --- /dev/null +++ b/sdk/cloudformation/src/operation/create_generated_template/_create_generated_template_output.rs @@ -0,0 +1,66 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct CreateGeneratedTemplateOutput { + ///

The ID of the generated template.

+ pub generated_template_id: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl CreateGeneratedTemplateOutput { + ///

The ID of the generated template.

+ pub fn generated_template_id(&self) -> ::std::option::Option<&str> { + self.generated_template_id.as_deref() + } +} +impl ::aws_types::request_id::RequestId for CreateGeneratedTemplateOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl CreateGeneratedTemplateOutput { + /// Creates a new builder-style object to manufacture [`CreateGeneratedTemplateOutput`](crate::operation::create_generated_template::CreateGeneratedTemplateOutput). + pub fn builder() -> crate::operation::create_generated_template::builders::CreateGeneratedTemplateOutputBuilder { + crate::operation::create_generated_template::builders::CreateGeneratedTemplateOutputBuilder::default() + } +} + +/// A builder for [`CreateGeneratedTemplateOutput`](crate::operation::create_generated_template::CreateGeneratedTemplateOutput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct CreateGeneratedTemplateOutputBuilder { + pub(crate) generated_template_id: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl CreateGeneratedTemplateOutputBuilder { + ///

The ID of the generated template.

+ pub fn generated_template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.generated_template_id = ::std::option::Option::Some(input.into()); + self + } + ///

The ID of the generated template.

+ pub fn set_generated_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.generated_template_id = input; + self + } + ///

The ID of the generated template.

+ pub fn get_generated_template_id(&self) -> &::std::option::Option<::std::string::String> { + &self.generated_template_id + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`CreateGeneratedTemplateOutput`](crate::operation::create_generated_template::CreateGeneratedTemplateOutput). + pub fn build(self) -> crate::operation::create_generated_template::CreateGeneratedTemplateOutput { + crate::operation::create_generated_template::CreateGeneratedTemplateOutput { + generated_template_id: self.generated_template_id, + _request_id: self._request_id, + } + } +} diff --git a/sdk/cloudformation/src/operation/create_generated_template/builders.rs b/sdk/cloudformation/src/operation/create_generated_template/builders.rs new file mode 100644 index 000000000000..638d3bdb10e4 --- /dev/null +++ b/sdk/cloudformation/src/operation/create_generated_template/builders.rs @@ -0,0 +1,174 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::create_generated_template::_create_generated_template_output::CreateGeneratedTemplateOutputBuilder; + +pub use crate::operation::create_generated_template::_create_generated_template_input::CreateGeneratedTemplateInputBuilder; + +impl CreateGeneratedTemplateInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::create_generated_template::CreateGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_generated_template::CreateGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.create_generated_template(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `CreateGeneratedTemplate`. +/// +///

Creates a template from existing resources that are not already managed with CloudFormation. You can check the status of the template generation using the DescribeGeneratedTemplate API action.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct CreateGeneratedTemplateFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::create_generated_template::builders::CreateGeneratedTemplateInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::create_generated_template::CreateGeneratedTemplateOutput, + crate::operation::create_generated_template::CreateGeneratedTemplateError, + > for CreateGeneratedTemplateFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::create_generated_template::CreateGeneratedTemplateOutput, + crate::operation::create_generated_template::CreateGeneratedTemplateError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl CreateGeneratedTemplateFluentBuilder { + /// Creates a new `CreateGeneratedTemplate`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the CreateGeneratedTemplate as a reference. + pub fn as_input(&self) -> &crate::operation::create_generated_template::builders::CreateGeneratedTemplateInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::create_generated_template::CreateGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_generated_template::CreateGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::create_generated_template::CreateGeneratedTemplate::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::create_generated_template::CreateGeneratedTemplate::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::create_generated_template::CreateGeneratedTemplateOutput, + crate::operation::create_generated_template::CreateGeneratedTemplateError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { + self.set_config_override(Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Appends an item to `Resources`. + /// + /// To override the contents of this collection use [`set_resources`](Self::set_resources). + /// + ///

An optional list of resources to be included in the generated template.

+ ///

If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action.

+ pub fn resources(mut self, input: crate::types::ResourceDefinition) -> Self { + self.inner = self.inner.resources(input); + self + } + ///

An optional list of resources to be included in the generated template.

+ ///

If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action.

+ pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.inner = self.inner.set_resources(input); + self + } + ///

An optional list of resources to be included in the generated template.

+ ///

If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action.

+ pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec> { + self.inner.get_resources() + } + ///

The name assigned to the generated template.

+ pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.generated_template_name(input.into()); + self + } + ///

The name assigned to the generated template.

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_generated_template_name(input); + self + } + ///

The name assigned to the generated template.

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_generated_template_name() + } + ///

An optional name or ARN of a stack to use as the base stack for the generated template.

+ pub fn stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.stack_name(input.into()); + self + } + ///

An optional name or ARN of a stack to use as the base stack for the generated template.

+ pub fn set_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_stack_name(input); + self + } + ///

An optional name or ARN of a stack to use as the base stack for the generated template.

+ pub fn get_stack_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_stack_name() + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn template_configuration(mut self, input: crate::types::TemplateConfiguration) -> Self { + self.inner = self.inner.template_configuration(input); + self + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn set_template_configuration(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_template_configuration(input); + self + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn get_template_configuration(&self) -> &::std::option::Option { + self.inner.get_template_configuration() + } +} diff --git a/sdk/cloudformation/src/operation/create_stack/_create_stack_input.rs b/sdk/cloudformation/src/operation/create_stack/_create_stack_input.rs index d25e3956c819..dba13d5adf55 100644 --- a/sdk/cloudformation/src/operation/create_stack/_create_stack_input.rs +++ b/sdk/cloudformation/src/operation/create_stack/_create_stack_input.rs @@ -21,7 +21,7 @@ pub struct CreateStackInput { pub disable_rollback: ::std::option::Option, ///

The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards.

pub rollback_configuration: ::std::option::Option, - ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

+ ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

pub timeout_in_minutes: ::std::option::Option, ///

The Amazon Simple Notification Service (Amazon SNS) topic ARNs to publish stack related events. You can find your Amazon SNS topic ARNs using the Amazon SNS console or your Command Line Interface (CLI).

pub notification_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>, @@ -129,7 +129,7 @@ impl CreateStackInput { pub fn rollback_configuration(&self) -> ::std::option::Option<&crate::types::RollbackConfiguration> { self.rollback_configuration.as_ref() } - ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

+ ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

pub fn timeout_in_minutes(&self) -> ::std::option::Option { self.timeout_in_minutes } @@ -374,17 +374,17 @@ impl CreateStackInputBuilder { pub fn get_rollback_configuration(&self) -> &::std::option::Option { &self.rollback_configuration } - ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

+ ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

pub fn timeout_in_minutes(mut self, input: i32) -> Self { self.timeout_in_minutes = ::std::option::Option::Some(input); self } - ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

+ ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

pub fn set_timeout_in_minutes(mut self, input: ::std::option::Option) -> Self { self.timeout_in_minutes = input; self } - ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

+ ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

pub fn get_timeout_in_minutes(&self) -> &::std::option::Option { &self.timeout_in_minutes } diff --git a/sdk/cloudformation/src/operation/create_stack/builders.rs b/sdk/cloudformation/src/operation/create_stack/builders.rs index 8168a3705211..c3871a30ae23 100644 --- a/sdk/cloudformation/src/operation/create_stack/builders.rs +++ b/sdk/cloudformation/src/operation/create_stack/builders.rs @@ -211,17 +211,17 @@ impl CreateStackFluentBuilder { pub fn get_rollback_configuration(&self) -> &::std::option::Option { self.inner.get_rollback_configuration() } - ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

+ ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

pub fn timeout_in_minutes(mut self, input: i32) -> Self { self.inner = self.inner.timeout_in_minutes(input); self } - ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

+ ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

pub fn set_timeout_in_minutes(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_timeout_in_minutes(input); self } - ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

+ ///

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

pub fn get_timeout_in_minutes(&self) -> &::std::option::Option { self.inner.get_timeout_in_minutes() } diff --git a/sdk/cloudformation/src/operation/delete_generated_template.rs b/sdk/cloudformation/src/operation/delete_generated_template.rs new file mode 100644 index 000000000000..78a2dfac3628 --- /dev/null +++ b/sdk/cloudformation/src/operation/delete_generated_template.rs @@ -0,0 +1,373 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `DeleteGeneratedTemplate`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DeleteGeneratedTemplate; +impl DeleteGeneratedTemplate { + /// Creates a new `DeleteGeneratedTemplate` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::delete_generated_template::DeleteGeneratedTemplateInput, + ) -> ::std::result::Result< + crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::delete_generated_template::DeleteGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::delete_generated_template::DeleteGeneratedTemplateInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "cloudformation", + "DeleteGeneratedTemplate", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteGeneratedTemplate { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DeleteGeneratedTemplate"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + DeleteGeneratedTemplateRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + DeleteGeneratedTemplateResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "DeleteGeneratedTemplate", + "cloudformation", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteGeneratedTemplate") + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::new( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptorKind::ResponseBody, + ), + ) + .with_interceptor(DeleteGeneratedTemplateEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::delete_generated_template::DeleteGeneratedTemplateError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::delete_generated_template::DeleteGeneratedTemplateError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::delete_generated_template::DeleteGeneratedTemplateError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct DeleteGeneratedTemplateResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteGeneratedTemplateResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_delete_generated_template::de_delete_generated_template_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_delete_generated_template::de_delete_generated_template_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct DeleteGeneratedTemplateRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DeleteGeneratedTemplateRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::delete_generated_template::DeleteGeneratedTemplateInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::delete_generated_template::DeleteGeneratedTemplateInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_delete_generated_template_input::ser_delete_generated_template_input_input_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct DeleteGeneratedTemplateEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteGeneratedTemplateEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "DeleteGeneratedTemplateEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to DeleteGeneratedTemplateInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +/// Error type for the `DeleteGeneratedTemplateError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum DeleteGeneratedTemplateError { + ///

No more than 5 generated templates can be in an InProgress or Pending status at one time. This error is also returned if a generated template that is in an InProgress or Pending status is attempted to be updated or deleted.

+ ConcurrentResourcesLimitExceededException(crate::types::error::ConcurrentResourcesLimitExceededException), + ///

The generated template was not found.

+ GeneratedTemplateNotFoundException(crate::types::error::GeneratedTemplateNotFoundException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DeleteGeneratedTemplateError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl DeleteGeneratedTemplateError { + /// Creates the `DeleteGeneratedTemplateError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `DeleteGeneratedTemplateError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ConcurrentResourcesLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::GeneratedTemplateNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `DeleteGeneratedTemplateError::ConcurrentResourcesLimitExceededException`. + pub fn is_concurrent_resources_limit_exceeded_exception(&self) -> bool { + matches!(self, Self::ConcurrentResourcesLimitExceededException(_)) + } + /// Returns `true` if the error kind is `DeleteGeneratedTemplateError::GeneratedTemplateNotFoundException`. + pub fn is_generated_template_not_found_exception(&self) -> bool { + matches!(self, Self::GeneratedTemplateNotFoundException(_)) + } +} +impl ::std::error::Error for DeleteGeneratedTemplateError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ConcurrentResourcesLimitExceededException(_inner) => ::std::option::Option::Some(_inner), + Self::GeneratedTemplateNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for DeleteGeneratedTemplateError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ConcurrentResourcesLimitExceededException(_inner) => _inner.fmt(f), + Self::GeneratedTemplateNotFoundException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for DeleteGeneratedTemplateError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DeleteGeneratedTemplateError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ConcurrentResourcesLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::GeneratedTemplateNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteGeneratedTemplateError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::delete_generated_template::DeleteGeneratedTemplateError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::delete_generated_template::_delete_generated_template_output::DeleteGeneratedTemplateOutput; + +pub use crate::operation::delete_generated_template::_delete_generated_template_input::DeleteGeneratedTemplateInput; + +mod _delete_generated_template_input; + +mod _delete_generated_template_output; + +/// Builders +pub mod builders; diff --git a/sdk/cloudformation/src/operation/delete_generated_template/_delete_generated_template_input.rs b/sdk/cloudformation/src/operation/delete_generated_template/_delete_generated_template_input.rs new file mode 100644 index 000000000000..b208b92cd2f9 --- /dev/null +++ b/sdk/cloudformation/src/operation/delete_generated_template/_delete_generated_template_input.rs @@ -0,0 +1,55 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DeleteGeneratedTemplateInput { + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub generated_template_name: ::std::option::Option<::std::string::String>, +} +impl DeleteGeneratedTemplateInput { + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn generated_template_name(&self) -> ::std::option::Option<&str> { + self.generated_template_name.as_deref() + } +} +impl DeleteGeneratedTemplateInput { + /// Creates a new builder-style object to manufacture [`DeleteGeneratedTemplateInput`](crate::operation::delete_generated_template::DeleteGeneratedTemplateInput). + pub fn builder() -> crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateInputBuilder { + crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateInputBuilder::default() + } +} + +/// A builder for [`DeleteGeneratedTemplateInput`](crate::operation::delete_generated_template::DeleteGeneratedTemplateInput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct DeleteGeneratedTemplateInputBuilder { + pub(crate) generated_template_name: ::std::option::Option<::std::string::String>, +} +impl DeleteGeneratedTemplateInputBuilder { + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ /// This field is required. + pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.generated_template_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.generated_template_name = input; + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + &self.generated_template_name + } + /// Consumes the builder and constructs a [`DeleteGeneratedTemplateInput`](crate::operation::delete_generated_template::DeleteGeneratedTemplateInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::delete_generated_template::DeleteGeneratedTemplateInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::delete_generated_template::DeleteGeneratedTemplateInput { + generated_template_name: self.generated_template_name, + }) + } +} diff --git a/sdk/cloudformation/src/operation/delete_generated_template/_delete_generated_template_output.rs b/sdk/cloudformation/src/operation/delete_generated_template/_delete_generated_template_output.rs new file mode 100644 index 000000000000..dd53b22cddd2 --- /dev/null +++ b/sdk/cloudformation/src/operation/delete_generated_template/_delete_generated_template_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DeleteGeneratedTemplateOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for DeleteGeneratedTemplateOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl DeleteGeneratedTemplateOutput { + /// Creates a new builder-style object to manufacture [`DeleteGeneratedTemplateOutput`](crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput). + pub fn builder() -> crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateOutputBuilder { + crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateOutputBuilder::default() + } +} + +/// A builder for [`DeleteGeneratedTemplateOutput`](crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct DeleteGeneratedTemplateOutputBuilder { + _request_id: Option, +} +impl DeleteGeneratedTemplateOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`DeleteGeneratedTemplateOutput`](crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput). + pub fn build(self) -> crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput { + crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/cloudformation/src/operation/delete_generated_template/builders.rs b/sdk/cloudformation/src/operation/delete_generated_template/builders.rs new file mode 100644 index 000000000000..4d3cbb19c610 --- /dev/null +++ b/sdk/cloudformation/src/operation/delete_generated_template/builders.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::delete_generated_template::_delete_generated_template_output::DeleteGeneratedTemplateOutputBuilder; + +pub use crate::operation::delete_generated_template::_delete_generated_template_input::DeleteGeneratedTemplateInputBuilder; + +impl DeleteGeneratedTemplateInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::delete_generated_template::DeleteGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.delete_generated_template(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `DeleteGeneratedTemplate`. +/// +///

Deleted a generated template.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct DeleteGeneratedTemplateFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput, + crate::operation::delete_generated_template::DeleteGeneratedTemplateError, + > for DeleteGeneratedTemplateFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput, + crate::operation::delete_generated_template::DeleteGeneratedTemplateError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl DeleteGeneratedTemplateFluentBuilder { + /// Creates a new `DeleteGeneratedTemplate`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the DeleteGeneratedTemplate as a reference. + pub fn as_input(&self) -> &crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::delete_generated_template::DeleteGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::delete_generated_template::DeleteGeneratedTemplate::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::delete_generated_template::DeleteGeneratedTemplate::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput, + crate::operation::delete_generated_template::DeleteGeneratedTemplateError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { + self.set_config_override(Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.generated_template_name(input.into()); + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_generated_template_name(input); + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_generated_template_name() + } +} diff --git a/sdk/cloudformation/src/operation/describe_generated_template.rs b/sdk/cloudformation/src/operation/describe_generated_template.rs new file mode 100644 index 000000000000..e61a7bd7f0e7 --- /dev/null +++ b/sdk/cloudformation/src/operation/describe_generated_template.rs @@ -0,0 +1,363 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `DescribeGeneratedTemplate`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DescribeGeneratedTemplate; +impl DescribeGeneratedTemplate { + /// Creates a new `DescribeGeneratedTemplate` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::describe_generated_template::DescribeGeneratedTemplateInput, + ) -> ::std::result::Result< + crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_generated_template::DescribeGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::describe_generated_template::DescribeGeneratedTemplateInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "cloudformation", + "DescribeGeneratedTemplate", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DescribeGeneratedTemplate { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DescribeGeneratedTemplate"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + DescribeGeneratedTemplateRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + DescribeGeneratedTemplateResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "DescribeGeneratedTemplate", + "cloudformation", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DescribeGeneratedTemplate") + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::new( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptorKind::ResponseBody, + ), + ) + .with_interceptor(DescribeGeneratedTemplateEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::describe_generated_template::DescribeGeneratedTemplateError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::describe_generated_template::DescribeGeneratedTemplateError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::describe_generated_template::DescribeGeneratedTemplateError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct DescribeGeneratedTemplateResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DescribeGeneratedTemplateResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_describe_generated_template::de_describe_generated_template_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_describe_generated_template::de_describe_generated_template_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct DescribeGeneratedTemplateRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DescribeGeneratedTemplateRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::describe_generated_template::DescribeGeneratedTemplateInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::describe_generated_template::DescribeGeneratedTemplateInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_describe_generated_template_input::ser_describe_generated_template_input_input_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct DescribeGeneratedTemplateEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeGeneratedTemplateEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "DescribeGeneratedTemplateEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to DescribeGeneratedTemplateInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +/// Error type for the `DescribeGeneratedTemplateError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum DescribeGeneratedTemplateError { + ///

The generated template was not found.

+ GeneratedTemplateNotFoundException(crate::types::error::GeneratedTemplateNotFoundException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DescribeGeneratedTemplateError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl DescribeGeneratedTemplateError { + /// Creates the `DescribeGeneratedTemplateError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `DescribeGeneratedTemplateError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::GeneratedTemplateNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `DescribeGeneratedTemplateError::GeneratedTemplateNotFoundException`. + pub fn is_generated_template_not_found_exception(&self) -> bool { + matches!(self, Self::GeneratedTemplateNotFoundException(_)) + } +} +impl ::std::error::Error for DescribeGeneratedTemplateError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::GeneratedTemplateNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for DescribeGeneratedTemplateError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::GeneratedTemplateNotFoundException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for DescribeGeneratedTemplateError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DescribeGeneratedTemplateError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::GeneratedTemplateNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DescribeGeneratedTemplateError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::describe_generated_template::DescribeGeneratedTemplateError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::describe_generated_template::_describe_generated_template_output::DescribeGeneratedTemplateOutput; + +pub use crate::operation::describe_generated_template::_describe_generated_template_input::DescribeGeneratedTemplateInput; + +mod _describe_generated_template_input; + +mod _describe_generated_template_output; + +/// Builders +pub mod builders; diff --git a/sdk/cloudformation/src/operation/describe_generated_template/_describe_generated_template_input.rs b/sdk/cloudformation/src/operation/describe_generated_template/_describe_generated_template_input.rs new file mode 100644 index 000000000000..5cdb40adf6f7 --- /dev/null +++ b/sdk/cloudformation/src/operation/describe_generated_template/_describe_generated_template_input.rs @@ -0,0 +1,55 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DescribeGeneratedTemplateInput { + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub generated_template_name: ::std::option::Option<::std::string::String>, +} +impl DescribeGeneratedTemplateInput { + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn generated_template_name(&self) -> ::std::option::Option<&str> { + self.generated_template_name.as_deref() + } +} +impl DescribeGeneratedTemplateInput { + /// Creates a new builder-style object to manufacture [`DescribeGeneratedTemplateInput`](crate::operation::describe_generated_template::DescribeGeneratedTemplateInput). + pub fn builder() -> crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateInputBuilder { + crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateInputBuilder::default() + } +} + +/// A builder for [`DescribeGeneratedTemplateInput`](crate::operation::describe_generated_template::DescribeGeneratedTemplateInput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct DescribeGeneratedTemplateInputBuilder { + pub(crate) generated_template_name: ::std::option::Option<::std::string::String>, +} +impl DescribeGeneratedTemplateInputBuilder { + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ /// This field is required. + pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.generated_template_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.generated_template_name = input; + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + &self.generated_template_name + } + /// Consumes the builder and constructs a [`DescribeGeneratedTemplateInput`](crate::operation::describe_generated_template::DescribeGeneratedTemplateInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::describe_generated_template::DescribeGeneratedTemplateInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::describe_generated_template::DescribeGeneratedTemplateInput { + generated_template_name: self.generated_template_name, + }) + } +} diff --git a/sdk/cloudformation/src/operation/describe_generated_template/_describe_generated_template_output.rs b/sdk/cloudformation/src/operation/describe_generated_template/_describe_generated_template_output.rs new file mode 100644 index 000000000000..da9be8c1fbb0 --- /dev/null +++ b/sdk/cloudformation/src/operation/describe_generated_template/_describe_generated_template_output.rs @@ -0,0 +1,384 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DescribeGeneratedTemplateOutput { + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub generated_template_id: ::std::option::Option<::std::string::String>, + ///

The name of the generated template.

+ pub generated_template_name: ::std::option::Option<::std::string::String>, + ///

A list of objects describing the details of the resources in the template generation.

+ pub resources: ::std::option::Option<::std::vec::Vec>, + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub status: ::std::option::Option, + ///

The reason for the current template generation status. This will provide more details if a failure happened.

+ pub status_reason: ::std::option::Option<::std::string::String>, + ///

The time the generated template was created.

+ pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The time the generated template was last updated.

+ pub last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

An object describing the progress of the template generation.

+ pub progress: ::std::option::Option, + ///

The stack ARN of the base stack if a base stack was provided when generating the template.

+ pub stack_id: ::std::option::Option<::std::string::String>, + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub template_configuration: ::std::option::Option, + ///

The number of warnings generated for this template. The warnings are found in the details of each of the resources in the template.

+ pub total_warnings: ::std::option::Option, + _request_id: Option, +} +impl DescribeGeneratedTemplateOutput { + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn generated_template_id(&self) -> ::std::option::Option<&str> { + self.generated_template_id.as_deref() + } + ///

The name of the generated template.

+ pub fn generated_template_name(&self) -> ::std::option::Option<&str> { + self.generated_template_name.as_deref() + } + ///

A list of objects describing the details of the resources in the template generation.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resources.is_none()`. + pub fn resources(&self) -> &[crate::types::ResourceDetail] { + self.resources.as_deref().unwrap_or_default() + } + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn status(&self) -> ::std::option::Option<&crate::types::GeneratedTemplateStatus> { + self.status.as_ref() + } + ///

The reason for the current template generation status. This will provide more details if a failure happened.

+ pub fn status_reason(&self) -> ::std::option::Option<&str> { + self.status_reason.as_deref() + } + ///

The time the generated template was created.

+ pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.creation_time.as_ref() + } + ///

The time the generated template was last updated.

+ pub fn last_updated_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.last_updated_time.as_ref() + } + ///

An object describing the progress of the template generation.

+ pub fn progress(&self) -> ::std::option::Option<&crate::types::TemplateProgress> { + self.progress.as_ref() + } + ///

The stack ARN of the base stack if a base stack was provided when generating the template.

+ pub fn stack_id(&self) -> ::std::option::Option<&str> { + self.stack_id.as_deref() + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn template_configuration(&self) -> ::std::option::Option<&crate::types::TemplateConfiguration> { + self.template_configuration.as_ref() + } + ///

The number of warnings generated for this template. The warnings are found in the details of each of the resources in the template.

+ pub fn total_warnings(&self) -> ::std::option::Option { + self.total_warnings + } +} +impl ::aws_types::request_id::RequestId for DescribeGeneratedTemplateOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl DescribeGeneratedTemplateOutput { + /// Creates a new builder-style object to manufacture [`DescribeGeneratedTemplateOutput`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput). + pub fn builder() -> crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateOutputBuilder { + crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateOutputBuilder::default() + } +} + +/// A builder for [`DescribeGeneratedTemplateOutput`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct DescribeGeneratedTemplateOutputBuilder { + pub(crate) generated_template_id: ::std::option::Option<::std::string::String>, + pub(crate) generated_template_name: ::std::option::Option<::std::string::String>, + pub(crate) resources: ::std::option::Option<::std::vec::Vec>, + pub(crate) status: ::std::option::Option, + pub(crate) status_reason: ::std::option::Option<::std::string::String>, + pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) progress: ::std::option::Option, + pub(crate) stack_id: ::std::option::Option<::std::string::String>, + pub(crate) template_configuration: ::std::option::Option, + pub(crate) total_warnings: ::std::option::Option, + _request_id: Option, +} +impl DescribeGeneratedTemplateOutputBuilder { + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn generated_template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.generated_template_id = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn set_generated_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.generated_template_id = input; + self + } + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn get_generated_template_id(&self) -> &::std::option::Option<::std::string::String> { + &self.generated_template_id + } + ///

The name of the generated template.

+ pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.generated_template_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name of the generated template.

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.generated_template_name = input; + self + } + ///

The name of the generated template.

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + &self.generated_template_name + } + /// Appends an item to `resources`. + /// + /// To override the contents of this collection use [`set_resources`](Self::set_resources). + /// + ///

A list of objects describing the details of the resources in the template generation.

+ pub fn resources(mut self, input: crate::types::ResourceDetail) -> Self { + let mut v = self.resources.unwrap_or_default(); + v.push(input); + self.resources = ::std::option::Option::Some(v); + self + } + ///

A list of objects describing the details of the resources in the template generation.

+ pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.resources = input; + self + } + ///

A list of objects describing the details of the resources in the template generation.

+ pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.resources + } + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn status(mut self, input: crate::types::GeneratedTemplateStatus) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + ///

The reason for the current template generation status. This will provide more details if a failure happened.

+ pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.status_reason = ::std::option::Option::Some(input.into()); + self + } + ///

The reason for the current template generation status. This will provide more details if a failure happened.

+ pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.status_reason = input; + self + } + ///

The reason for the current template generation status. This will provide more details if a failure happened.

+ pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> { + &self.status_reason + } + ///

The time the generated template was created.

+ pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.creation_time = ::std::option::Option::Some(input); + self + } + ///

The time the generated template was created.

+ pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.creation_time = input; + self + } + ///

The time the generated template was created.

+ pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.creation_time + } + ///

The time the generated template was last updated.

+ pub fn last_updated_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.last_updated_time = ::std::option::Option::Some(input); + self + } + ///

The time the generated template was last updated.

+ pub fn set_last_updated_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.last_updated_time = input; + self + } + ///

The time the generated template was last updated.

+ pub fn get_last_updated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.last_updated_time + } + ///

An object describing the progress of the template generation.

+ pub fn progress(mut self, input: crate::types::TemplateProgress) -> Self { + self.progress = ::std::option::Option::Some(input); + self + } + ///

An object describing the progress of the template generation.

+ pub fn set_progress(mut self, input: ::std::option::Option) -> Self { + self.progress = input; + self + } + ///

An object describing the progress of the template generation.

+ pub fn get_progress(&self) -> &::std::option::Option { + &self.progress + } + ///

The stack ARN of the base stack if a base stack was provided when generating the template.

+ pub fn stack_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.stack_id = ::std::option::Option::Some(input.into()); + self + } + ///

The stack ARN of the base stack if a base stack was provided when generating the template.

+ pub fn set_stack_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.stack_id = input; + self + } + ///

The stack ARN of the base stack if a base stack was provided when generating the template.

+ pub fn get_stack_id(&self) -> &::std::option::Option<::std::string::String> { + &self.stack_id + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn template_configuration(mut self, input: crate::types::TemplateConfiguration) -> Self { + self.template_configuration = ::std::option::Option::Some(input); + self + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn set_template_configuration(mut self, input: ::std::option::Option) -> Self { + self.template_configuration = input; + self + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn get_template_configuration(&self) -> &::std::option::Option { + &self.template_configuration + } + ///

The number of warnings generated for this template. The warnings are found in the details of each of the resources in the template.

+ pub fn total_warnings(mut self, input: i32) -> Self { + self.total_warnings = ::std::option::Option::Some(input); + self + } + ///

The number of warnings generated for this template. The warnings are found in the details of each of the resources in the template.

+ pub fn set_total_warnings(mut self, input: ::std::option::Option) -> Self { + self.total_warnings = input; + self + } + ///

The number of warnings generated for this template. The warnings are found in the details of each of the resources in the template.

+ pub fn get_total_warnings(&self) -> &::std::option::Option { + &self.total_warnings + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`DescribeGeneratedTemplateOutput`](crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput). + pub fn build(self) -> crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput { + crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput { + generated_template_id: self.generated_template_id, + generated_template_name: self.generated_template_name, + resources: self.resources, + status: self.status, + status_reason: self.status_reason, + creation_time: self.creation_time, + last_updated_time: self.last_updated_time, + progress: self.progress, + stack_id: self.stack_id, + template_configuration: self.template_configuration, + total_warnings: self.total_warnings, + _request_id: self._request_id, + } + } +} diff --git a/sdk/cloudformation/src/operation/describe_generated_template/builders.rs b/sdk/cloudformation/src/operation/describe_generated_template/builders.rs new file mode 100644 index 000000000000..4efb5b1fc344 --- /dev/null +++ b/sdk/cloudformation/src/operation/describe_generated_template/builders.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::describe_generated_template::_describe_generated_template_output::DescribeGeneratedTemplateOutputBuilder; + +pub use crate::operation::describe_generated_template::_describe_generated_template_input::DescribeGeneratedTemplateInputBuilder; + +impl DescribeGeneratedTemplateInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_generated_template::DescribeGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.describe_generated_template(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `DescribeGeneratedTemplate`. +/// +///

Describes a generated template. The output includes details about the progress of the creation of a generated template started by a CreateGeneratedTemplate API action or the update of a generated template started with an UpdateGeneratedTemplate API action.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct DescribeGeneratedTemplateFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput, + crate::operation::describe_generated_template::DescribeGeneratedTemplateError, + > for DescribeGeneratedTemplateFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput, + crate::operation::describe_generated_template::DescribeGeneratedTemplateError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl DescribeGeneratedTemplateFluentBuilder { + /// Creates a new `DescribeGeneratedTemplate`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the DescribeGeneratedTemplate as a reference. + pub fn as_input(&self) -> &crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_generated_template::DescribeGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::describe_generated_template::DescribeGeneratedTemplate::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::describe_generated_template::DescribeGeneratedTemplate::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput, + crate::operation::describe_generated_template::DescribeGeneratedTemplateError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { + self.set_config_override(Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.generated_template_name(input.into()); + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_generated_template_name(input); + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_generated_template_name() + } +} diff --git a/sdk/cloudformation/src/operation/describe_resource_scan.rs b/sdk/cloudformation/src/operation/describe_resource_scan.rs new file mode 100644 index 000000000000..2852f4dec97d --- /dev/null +++ b/sdk/cloudformation/src/operation/describe_resource_scan.rs @@ -0,0 +1,363 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `DescribeResourceScan`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DescribeResourceScan; +impl DescribeResourceScan { + /// Creates a new `DescribeResourceScan` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::describe_resource_scan::DescribeResourceScanInput, + ) -> ::std::result::Result< + crate::operation::describe_resource_scan::DescribeResourceScanOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_resource_scan::DescribeResourceScanError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::describe_resource_scan::DescribeResourceScanInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "cloudformation", + "DescribeResourceScan", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DescribeResourceScan { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DescribeResourceScan"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + DescribeResourceScanRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + DescribeResourceScanResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "DescribeResourceScan", + "cloudformation", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DescribeResourceScan") + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::new( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptorKind::ResponseBody, + ), + ) + .with_interceptor(DescribeResourceScanEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::describe_resource_scan::DescribeResourceScanError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::describe_resource_scan::DescribeResourceScanError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::describe_resource_scan::DescribeResourceScanError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct DescribeResourceScanResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DescribeResourceScanResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_describe_resource_scan::de_describe_resource_scan_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_describe_resource_scan::de_describe_resource_scan_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct DescribeResourceScanRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DescribeResourceScanRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::describe_resource_scan::DescribeResourceScanInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::describe_resource_scan::DescribeResourceScanInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_describe_resource_scan_input::ser_describe_resource_scan_input_input_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct DescribeResourceScanEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeResourceScanEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "DescribeResourceScanEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to DescribeResourceScanInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +/// Error type for the `DescribeResourceScanError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum DescribeResourceScanError { + ///

The resource scan was not found.

+ ResourceScanNotFoundException(crate::types::error::ResourceScanNotFoundException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DescribeResourceScanError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl DescribeResourceScanError { + /// Creates the `DescribeResourceScanError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `DescribeResourceScanError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceScanNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `DescribeResourceScanError::ResourceScanNotFoundException`. + pub fn is_resource_scan_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceScanNotFoundException(_)) + } +} +impl ::std::error::Error for DescribeResourceScanError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceScanNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for DescribeResourceScanError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceScanNotFoundException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for DescribeResourceScanError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DescribeResourceScanError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceScanNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DescribeResourceScanError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::describe_resource_scan::DescribeResourceScanError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::describe_resource_scan::_describe_resource_scan_output::DescribeResourceScanOutput; + +pub use crate::operation::describe_resource_scan::_describe_resource_scan_input::DescribeResourceScanInput; + +mod _describe_resource_scan_input; + +mod _describe_resource_scan_output; + +/// Builders +pub mod builders; diff --git a/sdk/cloudformation/src/operation/describe_resource_scan/_describe_resource_scan_input.rs b/sdk/cloudformation/src/operation/describe_resource_scan/_describe_resource_scan_input.rs new file mode 100644 index 000000000000..9839c1c1179c --- /dev/null +++ b/sdk/cloudformation/src/operation/describe_resource_scan/_describe_resource_scan_input.rs @@ -0,0 +1,53 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DescribeResourceScanInput { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub resource_scan_id: ::std::option::Option<::std::string::String>, +} +impl DescribeResourceScanInput { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn resource_scan_id(&self) -> ::std::option::Option<&str> { + self.resource_scan_id.as_deref() + } +} +impl DescribeResourceScanInput { + /// Creates a new builder-style object to manufacture [`DescribeResourceScanInput`](crate::operation::describe_resource_scan::DescribeResourceScanInput). + pub fn builder() -> crate::operation::describe_resource_scan::builders::DescribeResourceScanInputBuilder { + crate::operation::describe_resource_scan::builders::DescribeResourceScanInputBuilder::default() + } +} + +/// A builder for [`DescribeResourceScanInput`](crate::operation::describe_resource_scan::DescribeResourceScanInput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct DescribeResourceScanInputBuilder { + pub(crate) resource_scan_id: ::std::option::Option<::std::string::String>, +} +impl DescribeResourceScanInputBuilder { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ /// This field is required. + pub fn resource_scan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_scan_id = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn set_resource_scan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_scan_id = input; + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn get_resource_scan_id(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_scan_id + } + /// Consumes the builder and constructs a [`DescribeResourceScanInput`](crate::operation::describe_resource_scan::DescribeResourceScanInput). + pub fn build( + self, + ) -> ::std::result::Result + { + ::std::result::Result::Ok(crate::operation::describe_resource_scan::DescribeResourceScanInput { + resource_scan_id: self.resource_scan_id, + }) + } +} diff --git a/sdk/cloudformation/src/operation/describe_resource_scan/_describe_resource_scan_output.rs b/sdk/cloudformation/src/operation/describe_resource_scan/_describe_resource_scan_output.rs new file mode 100644 index 000000000000..1368c1220e58 --- /dev/null +++ b/sdk/cloudformation/src/operation/describe_resource_scan/_describe_resource_scan_output.rs @@ -0,0 +1,390 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DescribeResourceScanOutput { + ///

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ pub resource_scan_id: ::std::option::Option<::std::string::String>, + ///

Status of the resource scan.

+ ///
+ ///
+ /// INPROGRESS + ///
+ ///
+ ///

The resource scan is still in progress.

+ ///
+ ///
+ /// COMPLETE + ///
+ ///
+ ///

The resource scan is complete.

+ ///
+ ///
+ /// EXPIRED + ///
+ ///
+ ///

The resource scan has expired.

+ ///
+ ///
+ /// FAILED + ///
+ ///
+ ///

The resource scan has failed.

+ ///
+ ///
+ pub status: ::std::option::Option, + ///

The reason for the resource scan status, providing more information if a failure happened.

+ pub status_reason: ::std::option::Option<::std::string::String>, + ///

The time that the resource scan was started.

+ pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The time that the resource scan was finished.

+ pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The percentage of the resource scan that has been completed.

+ pub percentage_completed: ::std::option::Option, + ///

The list of resource types for the specified scan. Resource types are only available for scans with a Status set to COMPLETE or FAILED .

+ pub resource_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + ///

The number of resources that were listed. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

+ pub resources_scanned: ::std::option::Option, + ///

The number of resources that were read. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

+ ///

This field may be 0 if the resource scan failed with a ResourceScanLimitExceededException.

+ ///
+ pub resources_read: ::std::option::Option, + _request_id: Option, +} +impl DescribeResourceScanOutput { + ///

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ pub fn resource_scan_id(&self) -> ::std::option::Option<&str> { + self.resource_scan_id.as_deref() + } + ///

Status of the resource scan.

+ ///
+ ///
+ /// INPROGRESS + ///
+ ///
+ ///

The resource scan is still in progress.

+ ///
+ ///
+ /// COMPLETE + ///
+ ///
+ ///

The resource scan is complete.

+ ///
+ ///
+ /// EXPIRED + ///
+ ///
+ ///

The resource scan has expired.

+ ///
+ ///
+ /// FAILED + ///
+ ///
+ ///

The resource scan has failed.

+ ///
+ ///
+ pub fn status(&self) -> ::std::option::Option<&crate::types::ResourceScanStatus> { + self.status.as_ref() + } + ///

The reason for the resource scan status, providing more information if a failure happened.

+ pub fn status_reason(&self) -> ::std::option::Option<&str> { + self.status_reason.as_deref() + } + ///

The time that the resource scan was started.

+ pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.start_time.as_ref() + } + ///

The time that the resource scan was finished.

+ pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.end_time.as_ref() + } + ///

The percentage of the resource scan that has been completed.

+ pub fn percentage_completed(&self) -> ::std::option::Option { + self.percentage_completed + } + ///

The list of resource types for the specified scan. Resource types are only available for scans with a Status set to COMPLETE or FAILED .

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_types.is_none()`. + pub fn resource_types(&self) -> &[::std::string::String] { + self.resource_types.as_deref().unwrap_or_default() + } + ///

The number of resources that were listed. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

+ pub fn resources_scanned(&self) -> ::std::option::Option { + self.resources_scanned + } + ///

The number of resources that were read. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

+ ///

This field may be 0 if the resource scan failed with a ResourceScanLimitExceededException.

+ ///
+ pub fn resources_read(&self) -> ::std::option::Option { + self.resources_read + } +} +impl ::aws_types::request_id::RequestId for DescribeResourceScanOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl DescribeResourceScanOutput { + /// Creates a new builder-style object to manufacture [`DescribeResourceScanOutput`](crate::operation::describe_resource_scan::DescribeResourceScanOutput). + pub fn builder() -> crate::operation::describe_resource_scan::builders::DescribeResourceScanOutputBuilder { + crate::operation::describe_resource_scan::builders::DescribeResourceScanOutputBuilder::default() + } +} + +/// A builder for [`DescribeResourceScanOutput`](crate::operation::describe_resource_scan::DescribeResourceScanOutput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct DescribeResourceScanOutputBuilder { + pub(crate) resource_scan_id: ::std::option::Option<::std::string::String>, + pub(crate) status: ::std::option::Option, + pub(crate) status_reason: ::std::option::Option<::std::string::String>, + pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) percentage_completed: ::std::option::Option, + pub(crate) resource_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + pub(crate) resources_scanned: ::std::option::Option, + pub(crate) resources_read: ::std::option::Option, + _request_id: Option, +} +impl DescribeResourceScanOutputBuilder { + ///

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ pub fn resource_scan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_scan_id = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ pub fn set_resource_scan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_scan_id = input; + self + } + ///

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ pub fn get_resource_scan_id(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_scan_id + } + ///

Status of the resource scan.

+ ///
+ ///
+ /// INPROGRESS + ///
+ ///
+ ///

The resource scan is still in progress.

+ ///
+ ///
+ /// COMPLETE + ///
+ ///
+ ///

The resource scan is complete.

+ ///
+ ///
+ /// EXPIRED + ///
+ ///
+ ///

The resource scan has expired.

+ ///
+ ///
+ /// FAILED + ///
+ ///
+ ///

The resource scan has failed.

+ ///
+ ///
+ pub fn status(mut self, input: crate::types::ResourceScanStatus) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + ///

Status of the resource scan.

+ ///
+ ///
+ /// INPROGRESS + ///
+ ///
+ ///

The resource scan is still in progress.

+ ///
+ ///
+ /// COMPLETE + ///
+ ///
+ ///

The resource scan is complete.

+ ///
+ ///
+ /// EXPIRED + ///
+ ///
+ ///

The resource scan has expired.

+ ///
+ ///
+ /// FAILED + ///
+ ///
+ ///

The resource scan has failed.

+ ///
+ ///
+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + ///

Status of the resource scan.

+ ///
+ ///
+ /// INPROGRESS + ///
+ ///
+ ///

The resource scan is still in progress.

+ ///
+ ///
+ /// COMPLETE + ///
+ ///
+ ///

The resource scan is complete.

+ ///
+ ///
+ /// EXPIRED + ///
+ ///
+ ///

The resource scan has expired.

+ ///
+ ///
+ /// FAILED + ///
+ ///
+ ///

The resource scan has failed.

+ ///
+ ///
+ pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + ///

The reason for the resource scan status, providing more information if a failure happened.

+ pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.status_reason = ::std::option::Option::Some(input.into()); + self + } + ///

The reason for the resource scan status, providing more information if a failure happened.

+ pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.status_reason = input; + self + } + ///

The reason for the resource scan status, providing more information if a failure happened.

+ pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> { + &self.status_reason + } + ///

The time that the resource scan was started.

+ pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.start_time = ::std::option::Option::Some(input); + self + } + ///

The time that the resource scan was started.

+ pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.start_time = input; + self + } + ///

The time that the resource scan was started.

+ pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.start_time + } + ///

The time that the resource scan was finished.

+ pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.end_time = ::std::option::Option::Some(input); + self + } + ///

The time that the resource scan was finished.

+ pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.end_time = input; + self + } + ///

The time that the resource scan was finished.

+ pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.end_time + } + ///

The percentage of the resource scan that has been completed.

+ pub fn percentage_completed(mut self, input: f64) -> Self { + self.percentage_completed = ::std::option::Option::Some(input); + self + } + ///

The percentage of the resource scan that has been completed.

+ pub fn set_percentage_completed(mut self, input: ::std::option::Option) -> Self { + self.percentage_completed = input; + self + } + ///

The percentage of the resource scan that has been completed.

+ pub fn get_percentage_completed(&self) -> &::std::option::Option { + &self.percentage_completed + } + /// Appends an item to `resource_types`. + /// + /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types). + /// + ///

The list of resource types for the specified scan. Resource types are only available for scans with a Status set to COMPLETE or FAILED .

+ pub fn resource_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.resource_types.unwrap_or_default(); + v.push(input.into()); + self.resource_types = ::std::option::Option::Some(v); + self + } + ///

The list of resource types for the specified scan. Resource types are only available for scans with a Status set to COMPLETE or FAILED .

+ pub fn set_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.resource_types = input; + self + } + ///

The list of resource types for the specified scan. Resource types are only available for scans with a Status set to COMPLETE or FAILED .

+ pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.resource_types + } + ///

The number of resources that were listed. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

+ pub fn resources_scanned(mut self, input: i32) -> Self { + self.resources_scanned = ::std::option::Option::Some(input); + self + } + ///

The number of resources that were listed. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

+ pub fn set_resources_scanned(mut self, input: ::std::option::Option) -> Self { + self.resources_scanned = input; + self + } + ///

The number of resources that were listed. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

+ pub fn get_resources_scanned(&self) -> &::std::option::Option { + &self.resources_scanned + } + ///

The number of resources that were read. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

+ ///

This field may be 0 if the resource scan failed with a ResourceScanLimitExceededException.

+ ///
+ pub fn resources_read(mut self, input: i32) -> Self { + self.resources_read = ::std::option::Option::Some(input); + self + } + ///

The number of resources that were read. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

+ ///

This field may be 0 if the resource scan failed with a ResourceScanLimitExceededException.

+ ///
+ pub fn set_resources_read(mut self, input: ::std::option::Option) -> Self { + self.resources_read = input; + self + } + ///

The number of resources that were read. This is only available for scans with a Status set to COMPLETE, EXPIRED, or FAILED .

+ ///

This field may be 0 if the resource scan failed with a ResourceScanLimitExceededException.

+ ///
+ pub fn get_resources_read(&self) -> &::std::option::Option { + &self.resources_read + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`DescribeResourceScanOutput`](crate::operation::describe_resource_scan::DescribeResourceScanOutput). + pub fn build(self) -> crate::operation::describe_resource_scan::DescribeResourceScanOutput { + crate::operation::describe_resource_scan::DescribeResourceScanOutput { + resource_scan_id: self.resource_scan_id, + status: self.status, + status_reason: self.status_reason, + start_time: self.start_time, + end_time: self.end_time, + percentage_completed: self.percentage_completed, + resource_types: self.resource_types, + resources_scanned: self.resources_scanned, + resources_read: self.resources_read, + _request_id: self._request_id, + } + } +} diff --git a/sdk/cloudformation/src/operation/describe_resource_scan/builders.rs b/sdk/cloudformation/src/operation/describe_resource_scan/builders.rs new file mode 100644 index 000000000000..33ce24884159 --- /dev/null +++ b/sdk/cloudformation/src/operation/describe_resource_scan/builders.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::describe_resource_scan::_describe_resource_scan_output::DescribeResourceScanOutputBuilder; + +pub use crate::operation::describe_resource_scan::_describe_resource_scan_input::DescribeResourceScanInputBuilder; + +impl DescribeResourceScanInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::describe_resource_scan::DescribeResourceScanOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_resource_scan::DescribeResourceScanError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.describe_resource_scan(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `DescribeResourceScan`. +/// +///

Describes details of a resource scan.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct DescribeResourceScanFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::describe_resource_scan::builders::DescribeResourceScanInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::describe_resource_scan::DescribeResourceScanOutput, + crate::operation::describe_resource_scan::DescribeResourceScanError, + > for DescribeResourceScanFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::describe_resource_scan::DescribeResourceScanOutput, + crate::operation::describe_resource_scan::DescribeResourceScanError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl DescribeResourceScanFluentBuilder { + /// Creates a new `DescribeResourceScan`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the DescribeResourceScan as a reference. + pub fn as_input(&self) -> &crate::operation::describe_resource_scan::builders::DescribeResourceScanInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::describe_resource_scan::DescribeResourceScanOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_resource_scan::DescribeResourceScanError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::describe_resource_scan::DescribeResourceScan::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::describe_resource_scan::DescribeResourceScan::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::describe_resource_scan::DescribeResourceScanOutput, + crate::operation::describe_resource_scan::DescribeResourceScanError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { + self.set_config_override(Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn resource_scan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.resource_scan_id(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn set_resource_scan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_resource_scan_id(input); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn get_resource_scan_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_resource_scan_id() + } +} diff --git a/sdk/cloudformation/src/operation/get_generated_template.rs b/sdk/cloudformation/src/operation/get_generated_template.rs new file mode 100644 index 000000000000..b83d24874d10 --- /dev/null +++ b/sdk/cloudformation/src/operation/get_generated_template.rs @@ -0,0 +1,363 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `GetGeneratedTemplate`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetGeneratedTemplate; +impl GetGeneratedTemplate { + /// Creates a new `GetGeneratedTemplate` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_generated_template::GetGeneratedTemplateInput, + ) -> ::std::result::Result< + crate::operation::get_generated_template::GetGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_generated_template::GetGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_generated_template::GetGeneratedTemplateInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "cloudformation", + "GetGeneratedTemplate", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetGeneratedTemplate { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetGeneratedTemplate"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + GetGeneratedTemplateRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + GetGeneratedTemplateResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "GetGeneratedTemplate", + "cloudformation", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetGeneratedTemplate") + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::new( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptorKind::ResponseBody, + ), + ) + .with_interceptor(GetGeneratedTemplateEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::get_generated_template::GetGeneratedTemplateError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::get_generated_template::GetGeneratedTemplateError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::get_generated_template::GetGeneratedTemplateError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct GetGeneratedTemplateResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetGeneratedTemplateResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_get_generated_template::de_get_generated_template_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_get_generated_template::de_get_generated_template_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct GetGeneratedTemplateRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetGeneratedTemplateRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::get_generated_template::GetGeneratedTemplateInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::get_generated_template::GetGeneratedTemplateInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_get_generated_template_input::ser_get_generated_template_input_input_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct GetGeneratedTemplateEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetGeneratedTemplateEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "GetGeneratedTemplateEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to GetGeneratedTemplateInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +/// Error type for the `GetGeneratedTemplateError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum GetGeneratedTemplateError { + ///

The generated template was not found.

+ GeneratedTemplateNotFoundException(crate::types::error::GeneratedTemplateNotFoundException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetGeneratedTemplateError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl GetGeneratedTemplateError { + /// Creates the `GetGeneratedTemplateError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `GetGeneratedTemplateError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::GeneratedTemplateNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `GetGeneratedTemplateError::GeneratedTemplateNotFoundException`. + pub fn is_generated_template_not_found_exception(&self) -> bool { + matches!(self, Self::GeneratedTemplateNotFoundException(_)) + } +} +impl ::std::error::Error for GetGeneratedTemplateError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::GeneratedTemplateNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for GetGeneratedTemplateError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::GeneratedTemplateNotFoundException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for GetGeneratedTemplateError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetGeneratedTemplateError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::GeneratedTemplateNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetGeneratedTemplateError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::get_generated_template::GetGeneratedTemplateError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::get_generated_template::_get_generated_template_output::GetGeneratedTemplateOutput; + +pub use crate::operation::get_generated_template::_get_generated_template_input::GetGeneratedTemplateInput; + +mod _get_generated_template_input; + +mod _get_generated_template_output; + +/// Builders +pub mod builders; diff --git a/sdk/cloudformation/src/operation/get_generated_template/_get_generated_template_input.rs b/sdk/cloudformation/src/operation/get_generated_template/_get_generated_template_input.rs new file mode 100644 index 000000000000..f6795c6b6baa --- /dev/null +++ b/sdk/cloudformation/src/operation/get_generated_template/_get_generated_template_input.rs @@ -0,0 +1,105 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GetGeneratedTemplateInput { + ///

The language to use to retrieve for the generated template. Supported values are:

+ ///
    + ///
  • + ///

    JSON

  • + ///
  • + ///

    YAML

  • + ///
+ pub format: ::std::option::Option, + ///

The name or Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub generated_template_name: ::std::option::Option<::std::string::String>, +} +impl GetGeneratedTemplateInput { + ///

The language to use to retrieve for the generated template. Supported values are:

+ ///
    + ///
  • + ///

    JSON

  • + ///
  • + ///

    YAML

  • + ///
+ pub fn format(&self) -> ::std::option::Option<&crate::types::TemplateFormat> { + self.format.as_ref() + } + ///

The name or Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn generated_template_name(&self) -> ::std::option::Option<&str> { + self.generated_template_name.as_deref() + } +} +impl GetGeneratedTemplateInput { + /// Creates a new builder-style object to manufacture [`GetGeneratedTemplateInput`](crate::operation::get_generated_template::GetGeneratedTemplateInput). + pub fn builder() -> crate::operation::get_generated_template::builders::GetGeneratedTemplateInputBuilder { + crate::operation::get_generated_template::builders::GetGeneratedTemplateInputBuilder::default() + } +} + +/// A builder for [`GetGeneratedTemplateInput`](crate::operation::get_generated_template::GetGeneratedTemplateInput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct GetGeneratedTemplateInputBuilder { + pub(crate) format: ::std::option::Option, + pub(crate) generated_template_name: ::std::option::Option<::std::string::String>, +} +impl GetGeneratedTemplateInputBuilder { + ///

The language to use to retrieve for the generated template. Supported values are:

+ ///
    + ///
  • + ///

    JSON

  • + ///
  • + ///

    YAML

  • + ///
+ pub fn format(mut self, input: crate::types::TemplateFormat) -> Self { + self.format = ::std::option::Option::Some(input); + self + } + ///

The language to use to retrieve for the generated template. Supported values are:

+ ///
    + ///
  • + ///

    JSON

  • + ///
  • + ///

    YAML

  • + ///
+ pub fn set_format(mut self, input: ::std::option::Option) -> Self { + self.format = input; + self + } + ///

The language to use to retrieve for the generated template. Supported values are:

+ ///
    + ///
  • + ///

    JSON

  • + ///
  • + ///

    YAML

  • + ///
+ pub fn get_format(&self) -> &::std::option::Option { + &self.format + } + ///

The name or Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ /// This field is required. + pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.generated_template_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name or Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.generated_template_name = input; + self + } + ///

The name or Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + &self.generated_template_name + } + /// Consumes the builder and constructs a [`GetGeneratedTemplateInput`](crate::operation::get_generated_template::GetGeneratedTemplateInput). + pub fn build( + self, + ) -> ::std::result::Result + { + ::std::result::Result::Ok(crate::operation::get_generated_template::GetGeneratedTemplateInput { + format: self.format, + generated_template_name: self.generated_template_name, + }) + } +} diff --git a/sdk/cloudformation/src/operation/get_generated_template/_get_generated_template_output.rs b/sdk/cloudformation/src/operation/get_generated_template/_get_generated_template_output.rs new file mode 100644 index 000000000000..e74364dc5444 --- /dev/null +++ b/sdk/cloudformation/src/operation/get_generated_template/_get_generated_template_output.rs @@ -0,0 +1,178 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GetGeneratedTemplateOutput { + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub status: ::std::option::Option, + ///

The template body of the generated template, in the language specified by the Language parameter.

+ pub template_body: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl GetGeneratedTemplateOutput { + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn status(&self) -> ::std::option::Option<&crate::types::GeneratedTemplateStatus> { + self.status.as_ref() + } + ///

The template body of the generated template, in the language specified by the Language parameter.

+ pub fn template_body(&self) -> ::std::option::Option<&str> { + self.template_body.as_deref() + } +} +impl ::aws_types::request_id::RequestId for GetGeneratedTemplateOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl GetGeneratedTemplateOutput { + /// Creates a new builder-style object to manufacture [`GetGeneratedTemplateOutput`](crate::operation::get_generated_template::GetGeneratedTemplateOutput). + pub fn builder() -> crate::operation::get_generated_template::builders::GetGeneratedTemplateOutputBuilder { + crate::operation::get_generated_template::builders::GetGeneratedTemplateOutputBuilder::default() + } +} + +/// A builder for [`GetGeneratedTemplateOutput`](crate::operation::get_generated_template::GetGeneratedTemplateOutput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct GetGeneratedTemplateOutputBuilder { + pub(crate) status: ::std::option::Option, + pub(crate) template_body: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl GetGeneratedTemplateOutputBuilder { + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn status(mut self, input: crate::types::GeneratedTemplateStatus) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + ///

The template body of the generated template, in the language specified by the Language parameter.

+ pub fn template_body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.template_body = ::std::option::Option::Some(input.into()); + self + } + ///

The template body of the generated template, in the language specified by the Language parameter.

+ pub fn set_template_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.template_body = input; + self + } + ///

The template body of the generated template, in the language specified by the Language parameter.

+ pub fn get_template_body(&self) -> &::std::option::Option<::std::string::String> { + &self.template_body + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`GetGeneratedTemplateOutput`](crate::operation::get_generated_template::GetGeneratedTemplateOutput). + pub fn build(self) -> crate::operation::get_generated_template::GetGeneratedTemplateOutput { + crate::operation::get_generated_template::GetGeneratedTemplateOutput { + status: self.status, + template_body: self.template_body, + _request_id: self._request_id, + } + } +} diff --git a/sdk/cloudformation/src/operation/get_generated_template/builders.rs b/sdk/cloudformation/src/operation/get_generated_template/builders.rs new file mode 100644 index 000000000000..573de17cc6db --- /dev/null +++ b/sdk/cloudformation/src/operation/get_generated_template/builders.rs @@ -0,0 +1,157 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::get_generated_template::_get_generated_template_output::GetGeneratedTemplateOutputBuilder; + +pub use crate::operation::get_generated_template::_get_generated_template_input::GetGeneratedTemplateInputBuilder; + +impl GetGeneratedTemplateInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::get_generated_template::GetGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_generated_template::GetGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.get_generated_template(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `GetGeneratedTemplate`. +/// +///

Retrieves a generated template. If the template is in an InProgress or Pending status then the template returned will be the template when the template was last in a Complete status. If the template has not yet been in a Complete status then an empty template will be returned.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct GetGeneratedTemplateFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::get_generated_template::builders::GetGeneratedTemplateInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::get_generated_template::GetGeneratedTemplateOutput, + crate::operation::get_generated_template::GetGeneratedTemplateError, + > for GetGeneratedTemplateFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::get_generated_template::GetGeneratedTemplateOutput, + crate::operation::get_generated_template::GetGeneratedTemplateError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl GetGeneratedTemplateFluentBuilder { + /// Creates a new `GetGeneratedTemplate`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the GetGeneratedTemplate as a reference. + pub fn as_input(&self) -> &crate::operation::get_generated_template::builders::GetGeneratedTemplateInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::get_generated_template::GetGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_generated_template::GetGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::get_generated_template::GetGeneratedTemplate::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::get_generated_template::GetGeneratedTemplate::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::get_generated_template::GetGeneratedTemplateOutput, + crate::operation::get_generated_template::GetGeneratedTemplateError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { + self.set_config_override(Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The language to use to retrieve for the generated template. Supported values are:

+ ///
    + ///
  • + ///

    JSON

  • + ///
  • + ///

    YAML

  • + ///
+ pub fn format(mut self, input: crate::types::TemplateFormat) -> Self { + self.inner = self.inner.format(input); + self + } + ///

The language to use to retrieve for the generated template. Supported values are:

+ ///
    + ///
  • + ///

    JSON

  • + ///
  • + ///

    YAML

  • + ///
+ pub fn set_format(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_format(input); + self + } + ///

The language to use to retrieve for the generated template. Supported values are:

+ ///
    + ///
  • + ///

    JSON

  • + ///
  • + ///

    YAML

  • + ///
+ pub fn get_format(&self) -> &::std::option::Option { + self.inner.get_format() + } + ///

The name or Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.generated_template_name(input.into()); + self + } + ///

The name or Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_generated_template_name(input); + self + } + ///

The name or Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_generated_template_name() + } +} diff --git a/sdk/cloudformation/src/operation/list_generated_templates.rs b/sdk/cloudformation/src/operation/list_generated_templates.rs new file mode 100644 index 000000000000..44c0c60daed6 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_generated_templates.rs @@ -0,0 +1,356 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListGeneratedTemplates`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListGeneratedTemplates; +impl ListGeneratedTemplates { + /// Creates a new `ListGeneratedTemplates` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_generated_templates::ListGeneratedTemplatesInput, + ) -> ::std::result::Result< + crate::operation::list_generated_templates::ListGeneratedTemplatesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_generated_templates::ListGeneratedTemplatesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_generated_templates::ListGeneratedTemplatesInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "cloudformation", + "ListGeneratedTemplates", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListGeneratedTemplates { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListGeneratedTemplates"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListGeneratedTemplatesRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListGeneratedTemplatesResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListGeneratedTemplates", + "cloudformation", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListGeneratedTemplates") + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::new( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptorKind::ResponseBody, + ), + ) + .with_interceptor(ListGeneratedTemplatesEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_generated_templates::ListGeneratedTemplatesError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_generated_templates::ListGeneratedTemplatesError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_generated_templates::ListGeneratedTemplatesError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListGeneratedTemplatesResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListGeneratedTemplatesResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_generated_templates::de_list_generated_templates_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_generated_templates::de_list_generated_templates_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListGeneratedTemplatesRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListGeneratedTemplatesRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_generated_templates::ListGeneratedTemplatesInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_generated_templates::ListGeneratedTemplatesInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_list_generated_templates_input::ser_list_generated_templates_input_input_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListGeneratedTemplatesEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListGeneratedTemplatesEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListGeneratedTemplatesEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListGeneratedTemplatesInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +/// Error type for the `ListGeneratedTemplatesError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListGeneratedTemplatesError { + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListGeneratedTemplatesError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListGeneratedTemplatesError { + /// Creates the `ListGeneratedTemplatesError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListGeneratedTemplatesError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::Unhandled(e) => &e.meta, + } + } +} +impl ::std::error::Error for ListGeneratedTemplatesError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListGeneratedTemplatesError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListGeneratedTemplatesError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListGeneratedTemplatesError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListGeneratedTemplatesError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_generated_templates::ListGeneratedTemplatesError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_generated_templates::_list_generated_templates_output::ListGeneratedTemplatesOutput; + +pub use crate::operation::list_generated_templates::_list_generated_templates_input::ListGeneratedTemplatesInput; + +mod _list_generated_templates_input; + +mod _list_generated_templates_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/cloudformation/src/operation/list_generated_templates/_list_generated_templates_input.rs b/sdk/cloudformation/src/operation/list_generated_templates/_list_generated_templates_input.rs new file mode 100644 index 000000000000..d5bfd6a6c837 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_generated_templates/_list_generated_templates_input.rs @@ -0,0 +1,76 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListGeneratedTemplatesInput { + ///

A string that identifies the next page of resource scan results.

+ pub next_token: ::std::option::Option<::std::string::String>, + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListGeneratedTemplates API action will return at most 50 results in each response. The maximum value is 100.

+ pub max_results: ::std::option::Option, +} +impl ListGeneratedTemplatesInput { + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListGeneratedTemplates API action will return at most 50 results in each response. The maximum value is 100.

+ pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ListGeneratedTemplatesInput { + /// Creates a new builder-style object to manufacture [`ListGeneratedTemplatesInput`](crate::operation::list_generated_templates::ListGeneratedTemplatesInput). + pub fn builder() -> crate::operation::list_generated_templates::builders::ListGeneratedTemplatesInputBuilder { + crate::operation::list_generated_templates::builders::ListGeneratedTemplatesInputBuilder::default() + } +} + +/// A builder for [`ListGeneratedTemplatesInput`](crate::operation::list_generated_templates::ListGeneratedTemplatesInput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ListGeneratedTemplatesInputBuilder { + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListGeneratedTemplatesInputBuilder { + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListGeneratedTemplates API action will return at most 50 results in each response. The maximum value is 100.

+ pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListGeneratedTemplates API action will return at most 50 results in each response. The maximum value is 100.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListGeneratedTemplates API action will return at most 50 results in each response. The maximum value is 100.

+ pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListGeneratedTemplatesInput`](crate::operation::list_generated_templates::ListGeneratedTemplatesInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::list_generated_templates::ListGeneratedTemplatesInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::list_generated_templates::ListGeneratedTemplatesInput { + next_token: self.next_token, + max_results: self.max_results, + }) + } +} diff --git a/sdk/cloudformation/src/operation/list_generated_templates/_list_generated_templates_output.rs b/sdk/cloudformation/src/operation/list_generated_templates/_list_generated_templates_output.rs new file mode 100644 index 000000000000..35aac9b96b57 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_generated_templates/_list_generated_templates_output.rs @@ -0,0 +1,96 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListGeneratedTemplatesOutput { + ///

A list of summaries of the generated templates.

+ pub summaries: ::std::option::Option<::std::vec::Vec>, + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListGeneratedTemplates again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListGeneratedTemplatesOutput { + ///

A list of summaries of the generated templates.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.summaries.is_none()`. + pub fn summaries(&self) -> &[crate::types::TemplateSummary] { + self.summaries.as_deref().unwrap_or_default() + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListGeneratedTemplates again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::aws_types::request_id::RequestId for ListGeneratedTemplatesOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListGeneratedTemplatesOutput { + /// Creates a new builder-style object to manufacture [`ListGeneratedTemplatesOutput`](crate::operation::list_generated_templates::ListGeneratedTemplatesOutput). + pub fn builder() -> crate::operation::list_generated_templates::builders::ListGeneratedTemplatesOutputBuilder { + crate::operation::list_generated_templates::builders::ListGeneratedTemplatesOutputBuilder::default() + } +} + +/// A builder for [`ListGeneratedTemplatesOutput`](crate::operation::list_generated_templates::ListGeneratedTemplatesOutput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ListGeneratedTemplatesOutputBuilder { + pub(crate) summaries: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListGeneratedTemplatesOutputBuilder { + /// Appends an item to `summaries`. + /// + /// To override the contents of this collection use [`set_summaries`](Self::set_summaries). + /// + ///

A list of summaries of the generated templates.

+ pub fn summaries(mut self, input: crate::types::TemplateSummary) -> Self { + let mut v = self.summaries.unwrap_or_default(); + v.push(input); + self.summaries = ::std::option::Option::Some(v); + self + } + ///

A list of summaries of the generated templates.

+ pub fn set_summaries(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.summaries = input; + self + } + ///

A list of summaries of the generated templates.

+ pub fn get_summaries(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.summaries + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListGeneratedTemplates again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListGeneratedTemplates again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListGeneratedTemplates again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListGeneratedTemplatesOutput`](crate::operation::list_generated_templates::ListGeneratedTemplatesOutput). + pub fn build(self) -> crate::operation::list_generated_templates::ListGeneratedTemplatesOutput { + crate::operation::list_generated_templates::ListGeneratedTemplatesOutput { + summaries: self.summaries, + next_token: self.next_token, + _request_id: self._request_id, + } + } +} diff --git a/sdk/cloudformation/src/operation/list_generated_templates/builders.rs b/sdk/cloudformation/src/operation/list_generated_templates/builders.rs new file mode 100644 index 000000000000..080f8f2354de --- /dev/null +++ b/sdk/cloudformation/src/operation/list_generated_templates/builders.rs @@ -0,0 +1,145 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_generated_templates::_list_generated_templates_output::ListGeneratedTemplatesOutputBuilder; + +pub use crate::operation::list_generated_templates::_list_generated_templates_input::ListGeneratedTemplatesInputBuilder; + +impl ListGeneratedTemplatesInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_generated_templates::ListGeneratedTemplatesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_generated_templates::ListGeneratedTemplatesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_generated_templates(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListGeneratedTemplates`. +/// +///

Lists your generated templates in this Region.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListGeneratedTemplatesFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_generated_templates::builders::ListGeneratedTemplatesInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_generated_templates::ListGeneratedTemplatesOutput, + crate::operation::list_generated_templates::ListGeneratedTemplatesError, + > for ListGeneratedTemplatesFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_generated_templates::ListGeneratedTemplatesOutput, + crate::operation::list_generated_templates::ListGeneratedTemplatesError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListGeneratedTemplatesFluentBuilder { + /// Creates a new `ListGeneratedTemplates`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListGeneratedTemplates as a reference. + pub fn as_input(&self) -> &crate::operation::list_generated_templates::builders::ListGeneratedTemplatesInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_generated_templates::ListGeneratedTemplatesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_generated_templates::ListGeneratedTemplatesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_generated_templates::ListGeneratedTemplates::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_generated_templates::ListGeneratedTemplates::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_generated_templates::ListGeneratedTemplatesOutput, + crate::operation::list_generated_templates::ListGeneratedTemplatesError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { + self.set_config_override(Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_generated_templates::paginator::ListGeneratedTemplatesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_generated_templates::paginator::ListGeneratedTemplatesPaginator { + crate::operation::list_generated_templates::paginator::ListGeneratedTemplatesPaginator::new(self.handle, self.inner) + } + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListGeneratedTemplates API action will return at most 50 results in each response. The maximum value is 100.

+ pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListGeneratedTemplates API action will return at most 50 results in each response. The maximum value is 100.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListGeneratedTemplates API action will return at most 50 results in each response. The maximum value is 100.

+ pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/cloudformation/src/operation/list_generated_templates/paginator.rs b/sdk/cloudformation/src/operation/list_generated_templates/paginator.rs new file mode 100644 index 000000000000..34b50d79084f --- /dev/null +++ b/sdk/cloudformation/src/operation/list_generated_templates/paginator.rs @@ -0,0 +1,147 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListGeneratedTemplates`](crate::operation::list_generated_templates::ListGeneratedTemplates) +pub struct ListGeneratedTemplatesPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_generated_templates::builders::ListGeneratedTemplatesInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListGeneratedTemplatesPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_generated_templates::builders::ListGeneratedTemplatesInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `summaries`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_generated_templates::paginator::ListGeneratedTemplatesPaginatorItems { + crate::operation::list_generated_templates::paginator::ListGeneratedTemplatesPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_generated_templates::ListGeneratedTemplatesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_generated_templates::ListGeneratedTemplatesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_generated_templates::ListGeneratedTemplates::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = + crate::operation::list_generated_templates::ListGeneratedTemplates::orchestrate(&runtime_plugins, input.clone()).await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_generated_templates_output_output_next_token(resp); + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListGeneratedTemplatesPaginator` +/// +/// This is created with [`.items()`](ListGeneratedTemplatesPaginator::items) +pub struct ListGeneratedTemplatesPaginatorItems(ListGeneratedTemplatesPaginator); + +impl ListGeneratedTemplatesPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::TemplateSummary, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_generated_templates::ListGeneratedTemplatesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { + crate::lens::lens_list_generated_templates_output_output_summaries(page) + .unwrap_or_default() + .into_iter() + }) + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scan_related_resources.rs b/sdk/cloudformation/src/operation/list_resource_scan_related_resources.rs new file mode 100644 index 000000000000..062c2f2189ca --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scan_related_resources.rs @@ -0,0 +1,382 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListResourceScanRelatedResources`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListResourceScanRelatedResources; +impl ListResourceScanRelatedResources { + /// Creates a new `ListResourceScanRelatedResources` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesInput, + ) -> ::std::result::Result< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "cloudformation", + "ListResourceScanRelatedResources", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListResourceScanRelatedResources { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListResourceScanRelatedResources"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListResourceScanRelatedResourcesRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListResourceScanRelatedResourcesResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListResourceScanRelatedResources", + "cloudformation", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListResourceScanRelatedResources") + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::new( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptorKind::ResponseBody, + ), + ) + .with_interceptor(ListResourceScanRelatedResourcesEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListResourceScanRelatedResourcesResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListResourceScanRelatedResourcesResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_resource_scan_related_resources::de_list_resource_scan_related_resources_http_error( + status, headers, body, + ) + } else { + crate::protocol_serde::shape_list_resource_scan_related_resources::de_list_resource_scan_related_resources_http_response( + status, headers, body, + ) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListResourceScanRelatedResourcesRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListResourceScanRelatedResourcesRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_list_resource_scan_related_resources_input::ser_list_resource_scan_related_resources_input_input_input( + &input, + )?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListResourceScanRelatedResourcesEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListResourceScanRelatedResourcesEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListResourceScanRelatedResourcesEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListResourceScanRelatedResourcesInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +/// Error type for the `ListResourceScanRelatedResourcesError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListResourceScanRelatedResourcesError { + ///

A resource scan is currently in progress. Only one can be run at a time for an account in a Region.

+ ResourceScanInProgressException(crate::types::error::ResourceScanInProgressException), + ///

The resource scan was not found.

+ ResourceScanNotFoundException(crate::types::error::ResourceScanNotFoundException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListResourceScanRelatedResourcesError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListResourceScanRelatedResourcesError { + /// Creates the `ListResourceScanRelatedResourcesError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListResourceScanRelatedResourcesError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceScanInProgressException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceScanNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListResourceScanRelatedResourcesError::ResourceScanInProgressException`. + pub fn is_resource_scan_in_progress_exception(&self) -> bool { + matches!(self, Self::ResourceScanInProgressException(_)) + } + /// Returns `true` if the error kind is `ListResourceScanRelatedResourcesError::ResourceScanNotFoundException`. + pub fn is_resource_scan_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceScanNotFoundException(_)) + } +} +impl ::std::error::Error for ListResourceScanRelatedResourcesError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceScanInProgressException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceScanNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListResourceScanRelatedResourcesError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceScanInProgressException(_inner) => _inner.fmt(f), + Self::ResourceScanNotFoundException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListResourceScanRelatedResourcesError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListResourceScanRelatedResourcesError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceScanInProgressException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceScanNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListResourceScanRelatedResourcesError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_resource_scan_related_resources::_list_resource_scan_related_resources_output::ListResourceScanRelatedResourcesOutput; + +pub use crate::operation::list_resource_scan_related_resources::_list_resource_scan_related_resources_input::ListResourceScanRelatedResourcesInput; + +mod _list_resource_scan_related_resources_input; + +mod _list_resource_scan_related_resources_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/cloudformation/src/operation/list_resource_scan_related_resources/_list_resource_scan_related_resources_input.rs b/sdk/cloudformation/src/operation/list_resource_scan_related_resources/_list_resource_scan_related_resources_input.rs new file mode 100644 index 000000000000..50d7c40ad2e4 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scan_related_resources/_list_resource_scan_related_resources_input.rs @@ -0,0 +1,131 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListResourceScanRelatedResourcesInput { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub resource_scan_id: ::std::option::Option<::std::string::String>, + ///

The list of resources for which you want to get the related resources. Up to 100 resources can be provided.

+ pub resources: ::std::option::Option<::std::vec::Vec>, + ///

A string that identifies the next page of resource scan results.

+ pub next_token: ::std::option::Option<::std::string::String>, + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanRelatedResources API action will return up to 100 results in each response. The maximum value is 100.

+ pub max_results: ::std::option::Option, +} +impl ListResourceScanRelatedResourcesInput { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn resource_scan_id(&self) -> ::std::option::Option<&str> { + self.resource_scan_id.as_deref() + } + ///

The list of resources for which you want to get the related resources. Up to 100 resources can be provided.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resources.is_none()`. + pub fn resources(&self) -> &[crate::types::ScannedResourceIdentifier] { + self.resources.as_deref().unwrap_or_default() + } + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanRelatedResources API action will return up to 100 results in each response. The maximum value is 100.

+ pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ListResourceScanRelatedResourcesInput { + /// Creates a new builder-style object to manufacture [`ListResourceScanRelatedResourcesInput`](crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesInput). + pub fn builder() -> crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesInputBuilder { + crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesInputBuilder::default() + } +} + +/// A builder for [`ListResourceScanRelatedResourcesInput`](crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesInput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ListResourceScanRelatedResourcesInputBuilder { + pub(crate) resource_scan_id: ::std::option::Option<::std::string::String>, + pub(crate) resources: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListResourceScanRelatedResourcesInputBuilder { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ /// This field is required. + pub fn resource_scan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_scan_id = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn set_resource_scan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_scan_id = input; + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn get_resource_scan_id(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_scan_id + } + /// Appends an item to `resources`. + /// + /// To override the contents of this collection use [`set_resources`](Self::set_resources). + /// + ///

The list of resources for which you want to get the related resources. Up to 100 resources can be provided.

+ pub fn resources(mut self, input: crate::types::ScannedResourceIdentifier) -> Self { + let mut v = self.resources.unwrap_or_default(); + v.push(input); + self.resources = ::std::option::Option::Some(v); + self + } + ///

The list of resources for which you want to get the related resources. Up to 100 resources can be provided.

+ pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.resources = input; + self + } + ///

The list of resources for which you want to get the related resources. Up to 100 resources can be provided.

+ pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.resources + } + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanRelatedResources API action will return up to 100 results in each response. The maximum value is 100.

+ pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanRelatedResources API action will return up to 100 results in each response. The maximum value is 100.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanRelatedResources API action will return up to 100 results in each response. The maximum value is 100.

+ pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListResourceScanRelatedResourcesInput`](crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok( + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesInput { + resource_scan_id: self.resource_scan_id, + resources: self.resources, + next_token: self.next_token, + max_results: self.max_results, + }, + ) + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scan_related_resources/_list_resource_scan_related_resources_output.rs b/sdk/cloudformation/src/operation/list_resource_scan_related_resources/_list_resource_scan_related_resources_output.rs new file mode 100644 index 000000000000..8938b432562e --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scan_related_resources/_list_resource_scan_related_resources_output.rs @@ -0,0 +1,96 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListResourceScanRelatedResourcesOutput { + ///

List of up to MaxResults resources in the specified resource scan related to the specified resources.

+ pub related_resources: ::std::option::Option<::std::vec::Vec>, + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanRelatedResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListResourceScanRelatedResourcesOutput { + ///

List of up to MaxResults resources in the specified resource scan related to the specified resources.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.related_resources.is_none()`. + pub fn related_resources(&self) -> &[crate::types::ScannedResource] { + self.related_resources.as_deref().unwrap_or_default() + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanRelatedResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::aws_types::request_id::RequestId for ListResourceScanRelatedResourcesOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListResourceScanRelatedResourcesOutput { + /// Creates a new builder-style object to manufacture [`ListResourceScanRelatedResourcesOutput`](crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput). + pub fn builder() -> crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesOutputBuilder { + crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesOutputBuilder::default() + } +} + +/// A builder for [`ListResourceScanRelatedResourcesOutput`](crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ListResourceScanRelatedResourcesOutputBuilder { + pub(crate) related_resources: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListResourceScanRelatedResourcesOutputBuilder { + /// Appends an item to `related_resources`. + /// + /// To override the contents of this collection use [`set_related_resources`](Self::set_related_resources). + /// + ///

List of up to MaxResults resources in the specified resource scan related to the specified resources.

+ pub fn related_resources(mut self, input: crate::types::ScannedResource) -> Self { + let mut v = self.related_resources.unwrap_or_default(); + v.push(input); + self.related_resources = ::std::option::Option::Some(v); + self + } + ///

List of up to MaxResults resources in the specified resource scan related to the specified resources.

+ pub fn set_related_resources(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.related_resources = input; + self + } + ///

List of up to MaxResults resources in the specified resource scan related to the specified resources.

+ pub fn get_related_resources(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.related_resources + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanRelatedResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanRelatedResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanRelatedResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListResourceScanRelatedResourcesOutput`](crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput). + pub fn build(self) -> crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput { + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput { + related_resources: self.related_resources, + next_token: self.next_token, + _request_id: self._request_id, + } + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scan_related_resources/builders.rs b/sdk/cloudformation/src/operation/list_resource_scan_related_resources/builders.rs new file mode 100644 index 000000000000..e18c00f7577a --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scan_related_resources/builders.rs @@ -0,0 +1,177 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_resource_scan_related_resources::_list_resource_scan_related_resources_output::ListResourceScanRelatedResourcesOutputBuilder; + +pub use crate::operation::list_resource_scan_related_resources::_list_resource_scan_related_resources_input::ListResourceScanRelatedResourcesInputBuilder; + +impl ListResourceScanRelatedResourcesInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_resource_scan_related_resources(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListResourceScanRelatedResources`. +/// +///

Lists the related resources for a list of resources from a resource scan. The response indicates whether each returned resource is already managed by CloudFormation.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListResourceScanRelatedResourcesFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput, + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + > for ListResourceScanRelatedResourcesFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput, + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListResourceScanRelatedResourcesFluentBuilder { + /// Creates a new `ListResourceScanRelatedResources`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListResourceScanRelatedResources as a reference. + pub fn as_input(&self) -> &crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResources::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResources::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput, + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { + self.set_config_override(Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_resource_scan_related_resources::paginator::ListResourceScanRelatedResourcesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_resource_scan_related_resources::paginator::ListResourceScanRelatedResourcesPaginator { + crate::operation::list_resource_scan_related_resources::paginator::ListResourceScanRelatedResourcesPaginator::new(self.handle, self.inner) + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn resource_scan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.resource_scan_id(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn set_resource_scan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_resource_scan_id(input); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn get_resource_scan_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_resource_scan_id() + } + /// Appends an item to `Resources`. + /// + /// To override the contents of this collection use [`set_resources`](Self::set_resources). + /// + ///

The list of resources for which you want to get the related resources. Up to 100 resources can be provided.

+ pub fn resources(mut self, input: crate::types::ScannedResourceIdentifier) -> Self { + self.inner = self.inner.resources(input); + self + } + ///

The list of resources for which you want to get the related resources. Up to 100 resources can be provided.

+ pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.inner = self.inner.set_resources(input); + self + } + ///

The list of resources for which you want to get the related resources. Up to 100 resources can be provided.

+ pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec> { + self.inner.get_resources() + } + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanRelatedResources API action will return up to 100 results in each response. The maximum value is 100.

+ pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanRelatedResources API action will return up to 100 results in each response. The maximum value is 100.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanRelatedResources API action will return up to 100 results in each response. The maximum value is 100.

+ pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scan_related_resources/paginator.rs b/sdk/cloudformation/src/operation/list_resource_scan_related_resources/paginator.rs new file mode 100644 index 000000000000..80ca657acd21 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scan_related_resources/paginator.rs @@ -0,0 +1,150 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListResourceScanRelatedResources`](crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResources) +pub struct ListResourceScanRelatedResourcesPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListResourceScanRelatedResourcesPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `related_resources`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_resource_scan_related_resources::paginator::ListResourceScanRelatedResourcesPaginatorItems { + crate::operation::list_resource_scan_related_resources::paginator::ListResourceScanRelatedResourcesPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResources::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResources::orchestrate( + &runtime_plugins, + input.clone(), + ) + .await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_resource_scan_related_resources_output_output_next_token(resp); + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListResourceScanRelatedResourcesPaginator` +/// +/// This is created with [`.items()`](ListResourceScanRelatedResourcesPaginator::items) +pub struct ListResourceScanRelatedResourcesPaginatorItems(ListResourceScanRelatedResourcesPaginator); + +impl ListResourceScanRelatedResourcesPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::ScannedResource, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { + crate::lens::lens_list_resource_scan_related_resources_output_output_related_resources(page) + .unwrap_or_default() + .into_iter() + }) + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scan_resources.rs b/sdk/cloudformation/src/operation/list_resource_scan_resources.rs new file mode 100644 index 000000000000..f32a66e296ea --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scan_resources.rs @@ -0,0 +1,376 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListResourceScanResources`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListResourceScanResources; +impl ListResourceScanResources { + /// Creates a new `ListResourceScanResources` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_resource_scan_resources::ListResourceScanResourcesInput, + ) -> ::std::result::Result< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_resource_scan_resources::ListResourceScanResourcesInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "cloudformation", + "ListResourceScanResources", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListResourceScanResources { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListResourceScanResources"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListResourceScanResourcesRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListResourceScanResourcesResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListResourceScanResources", + "cloudformation", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListResourceScanResources") + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::new( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptorKind::ResponseBody, + ), + ) + .with_interceptor(ListResourceScanResourcesEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListResourceScanResourcesResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListResourceScanResourcesResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_resource_scan_resources::de_list_resource_scan_resources_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_resource_scan_resources::de_list_resource_scan_resources_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListResourceScanResourcesRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListResourceScanResourcesRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_resource_scan_resources::ListResourceScanResourcesInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_resource_scan_resources::ListResourceScanResourcesInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_list_resource_scan_resources_input::ser_list_resource_scan_resources_input_input_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListResourceScanResourcesEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListResourceScanResourcesEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListResourceScanResourcesEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListResourceScanResourcesInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +/// Error type for the `ListResourceScanResourcesError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListResourceScanResourcesError { + ///

A resource scan is currently in progress. Only one can be run at a time for an account in a Region.

+ ResourceScanInProgressException(crate::types::error::ResourceScanInProgressException), + ///

The resource scan was not found.

+ ResourceScanNotFoundException(crate::types::error::ResourceScanNotFoundException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListResourceScanResourcesError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListResourceScanResourcesError { + /// Creates the `ListResourceScanResourcesError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListResourceScanResourcesError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceScanInProgressException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceScanNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListResourceScanResourcesError::ResourceScanInProgressException`. + pub fn is_resource_scan_in_progress_exception(&self) -> bool { + matches!(self, Self::ResourceScanInProgressException(_)) + } + /// Returns `true` if the error kind is `ListResourceScanResourcesError::ResourceScanNotFoundException`. + pub fn is_resource_scan_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceScanNotFoundException(_)) + } +} +impl ::std::error::Error for ListResourceScanResourcesError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceScanInProgressException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceScanNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListResourceScanResourcesError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceScanInProgressException(_inner) => _inner.fmt(f), + Self::ResourceScanNotFoundException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListResourceScanResourcesError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListResourceScanResourcesError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceScanInProgressException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceScanNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListResourceScanResourcesError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_resource_scan_resources::ListResourceScanResourcesError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_resource_scan_resources::_list_resource_scan_resources_output::ListResourceScanResourcesOutput; + +pub use crate::operation::list_resource_scan_resources::_list_resource_scan_resources_input::ListResourceScanResourcesInput; + +mod _list_resource_scan_resources_input; + +mod _list_resource_scan_resources_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/cloudformation/src/operation/list_resource_scan_resources/_list_resource_scan_resources_input.rs b/sdk/cloudformation/src/operation/list_resource_scan_resources/_list_resource_scan_resources_input.rs new file mode 100644 index 000000000000..a1b8baa32738 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scan_resources/_list_resource_scan_resources_input.rs @@ -0,0 +1,187 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListResourceScanResourcesInput { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub resource_scan_id: ::std::option::Option<::std::string::String>, + ///

If specified, the returned resources will have the specified resource identifier (or one of them in the case where the resource has multiple identifiers).

+ pub resource_identifier: ::std::option::Option<::std::string::String>, + ///

If specified, the returned resources will be of any of the resource types with the specified prefix.

+ pub resource_type_prefix: ::std::option::Option<::std::string::String>, + ///

If specified, the returned resources will have a matching tag key.

+ pub tag_key: ::std::option::Option<::std::string::String>, + ///

If specified, the returned resources will have a matching tag value.

+ pub tag_value: ::std::option::Option<::std::string::String>, + ///

A string that identifies the next page of resource scan results.

+ pub next_token: ::std::option::Option<::std::string::String>, + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanResources API action will return at most 100 results in each response. The maximum value is 100.

+ pub max_results: ::std::option::Option, +} +impl ListResourceScanResourcesInput { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn resource_scan_id(&self) -> ::std::option::Option<&str> { + self.resource_scan_id.as_deref() + } + ///

If specified, the returned resources will have the specified resource identifier (or one of them in the case where the resource has multiple identifiers).

+ pub fn resource_identifier(&self) -> ::std::option::Option<&str> { + self.resource_identifier.as_deref() + } + ///

If specified, the returned resources will be of any of the resource types with the specified prefix.

+ pub fn resource_type_prefix(&self) -> ::std::option::Option<&str> { + self.resource_type_prefix.as_deref() + } + ///

If specified, the returned resources will have a matching tag key.

+ pub fn tag_key(&self) -> ::std::option::Option<&str> { + self.tag_key.as_deref() + } + ///

If specified, the returned resources will have a matching tag value.

+ pub fn tag_value(&self) -> ::std::option::Option<&str> { + self.tag_value.as_deref() + } + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanResources API action will return at most 100 results in each response. The maximum value is 100.

+ pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ListResourceScanResourcesInput { + /// Creates a new builder-style object to manufacture [`ListResourceScanResourcesInput`](crate::operation::list_resource_scan_resources::ListResourceScanResourcesInput). + pub fn builder() -> crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesInputBuilder { + crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesInputBuilder::default() + } +} + +/// A builder for [`ListResourceScanResourcesInput`](crate::operation::list_resource_scan_resources::ListResourceScanResourcesInput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ListResourceScanResourcesInputBuilder { + pub(crate) resource_scan_id: ::std::option::Option<::std::string::String>, + pub(crate) resource_identifier: ::std::option::Option<::std::string::String>, + pub(crate) resource_type_prefix: ::std::option::Option<::std::string::String>, + pub(crate) tag_key: ::std::option::Option<::std::string::String>, + pub(crate) tag_value: ::std::option::Option<::std::string::String>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListResourceScanResourcesInputBuilder { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ /// This field is required. + pub fn resource_scan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_scan_id = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn set_resource_scan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_scan_id = input; + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn get_resource_scan_id(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_scan_id + } + ///

If specified, the returned resources will have the specified resource identifier (or one of them in the case where the resource has multiple identifiers).

+ pub fn resource_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

If specified, the returned resources will have the specified resource identifier (or one of them in the case where the resource has multiple identifiers).

+ pub fn set_resource_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_identifier = input; + self + } + ///

If specified, the returned resources will have the specified resource identifier (or one of them in the case where the resource has multiple identifiers).

+ pub fn get_resource_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_identifier + } + ///

If specified, the returned resources will be of any of the resource types with the specified prefix.

+ pub fn resource_type_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_type_prefix = ::std::option::Option::Some(input.into()); + self + } + ///

If specified, the returned resources will be of any of the resource types with the specified prefix.

+ pub fn set_resource_type_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_type_prefix = input; + self + } + ///

If specified, the returned resources will be of any of the resource types with the specified prefix.

+ pub fn get_resource_type_prefix(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_type_prefix + } + ///

If specified, the returned resources will have a matching tag key.

+ pub fn tag_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.tag_key = ::std::option::Option::Some(input.into()); + self + } + ///

If specified, the returned resources will have a matching tag key.

+ pub fn set_tag_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.tag_key = input; + self + } + ///

If specified, the returned resources will have a matching tag key.

+ pub fn get_tag_key(&self) -> &::std::option::Option<::std::string::String> { + &self.tag_key + } + ///

If specified, the returned resources will have a matching tag value.

+ pub fn tag_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.tag_value = ::std::option::Option::Some(input.into()); + self + } + ///

If specified, the returned resources will have a matching tag value.

+ pub fn set_tag_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.tag_value = input; + self + } + ///

If specified, the returned resources will have a matching tag value.

+ pub fn get_tag_value(&self) -> &::std::option::Option<::std::string::String> { + &self.tag_value + } + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanResources API action will return at most 100 results in each response. The maximum value is 100.

+ pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanResources API action will return at most 100 results in each response. The maximum value is 100.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanResources API action will return at most 100 results in each response. The maximum value is 100.

+ pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListResourceScanResourcesInput`](crate::operation::list_resource_scan_resources::ListResourceScanResourcesInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::list_resource_scan_resources::ListResourceScanResourcesInput { + resource_scan_id: self.resource_scan_id, + resource_identifier: self.resource_identifier, + resource_type_prefix: self.resource_type_prefix, + tag_key: self.tag_key, + tag_value: self.tag_value, + next_token: self.next_token, + max_results: self.max_results, + }) + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scan_resources/_list_resource_scan_resources_output.rs b/sdk/cloudformation/src/operation/list_resource_scan_resources/_list_resource_scan_resources_output.rs new file mode 100644 index 000000000000..36a107b40867 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scan_resources/_list_resource_scan_resources_output.rs @@ -0,0 +1,96 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListResourceScanResourcesOutput { + ///

List of up to MaxResults resources in the specified resource scan that match all of the specified filters.

+ pub resources: ::std::option::Option<::std::vec::Vec>, + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListResourceScanResourcesOutput { + ///

List of up to MaxResults resources in the specified resource scan that match all of the specified filters.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resources.is_none()`. + pub fn resources(&self) -> &[crate::types::ScannedResource] { + self.resources.as_deref().unwrap_or_default() + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::aws_types::request_id::RequestId for ListResourceScanResourcesOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListResourceScanResourcesOutput { + /// Creates a new builder-style object to manufacture [`ListResourceScanResourcesOutput`](crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput). + pub fn builder() -> crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesOutputBuilder { + crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesOutputBuilder::default() + } +} + +/// A builder for [`ListResourceScanResourcesOutput`](crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ListResourceScanResourcesOutputBuilder { + pub(crate) resources: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListResourceScanResourcesOutputBuilder { + /// Appends an item to `resources`. + /// + /// To override the contents of this collection use [`set_resources`](Self::set_resources). + /// + ///

List of up to MaxResults resources in the specified resource scan that match all of the specified filters.

+ pub fn resources(mut self, input: crate::types::ScannedResource) -> Self { + let mut v = self.resources.unwrap_or_default(); + v.push(input); + self.resources = ::std::option::Option::Some(v); + self + } + ///

List of up to MaxResults resources in the specified resource scan that match all of the specified filters.

+ pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.resources = input; + self + } + ///

List of up to MaxResults resources in the specified resource scan that match all of the specified filters.

+ pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.resources + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScanResources again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListResourceScanResourcesOutput`](crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput). + pub fn build(self) -> crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput { + crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput { + resources: self.resources, + next_token: self.next_token, + _request_id: self._request_id, + } + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scan_resources/builders.rs b/sdk/cloudformation/src/operation/list_resource_scan_resources/builders.rs new file mode 100644 index 000000000000..010fffdb48cd --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scan_resources/builders.rs @@ -0,0 +1,215 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_resource_scan_resources::_list_resource_scan_resources_output::ListResourceScanResourcesOutputBuilder; + +pub use crate::operation::list_resource_scan_resources::_list_resource_scan_resources_input::ListResourceScanResourcesInputBuilder; + +impl ListResourceScanResourcesInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_resource_scan_resources(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListResourceScanResources`. +/// +///

Lists the resources from a resource scan. The results can be filtered by resource identifier, resource type prefix, tag key, and tag value. Only resources that match all specified filters are returned. The response indicates whether each returned resource is already managed by CloudFormation.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListResourceScanResourcesFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput, + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, + > for ListResourceScanResourcesFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput, + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListResourceScanResourcesFluentBuilder { + /// Creates a new `ListResourceScanResources`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListResourceScanResources as a reference. + pub fn as_input(&self) -> &crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_resource_scan_resources::ListResourceScanResources::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_resource_scan_resources::ListResourceScanResources::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput, + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { + self.set_config_override(Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_resource_scan_resources::paginator::ListResourceScanResourcesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_resource_scan_resources::paginator::ListResourceScanResourcesPaginator { + crate::operation::list_resource_scan_resources::paginator::ListResourceScanResourcesPaginator::new(self.handle, self.inner) + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn resource_scan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.resource_scan_id(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn set_resource_scan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_resource_scan_id(input); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn get_resource_scan_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_resource_scan_id() + } + ///

If specified, the returned resources will have the specified resource identifier (or one of them in the case where the resource has multiple identifiers).

+ pub fn resource_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.resource_identifier(input.into()); + self + } + ///

If specified, the returned resources will have the specified resource identifier (or one of them in the case where the resource has multiple identifiers).

+ pub fn set_resource_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_resource_identifier(input); + self + } + ///

If specified, the returned resources will have the specified resource identifier (or one of them in the case where the resource has multiple identifiers).

+ pub fn get_resource_identifier(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_resource_identifier() + } + ///

If specified, the returned resources will be of any of the resource types with the specified prefix.

+ pub fn resource_type_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.resource_type_prefix(input.into()); + self + } + ///

If specified, the returned resources will be of any of the resource types with the specified prefix.

+ pub fn set_resource_type_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_resource_type_prefix(input); + self + } + ///

If specified, the returned resources will be of any of the resource types with the specified prefix.

+ pub fn get_resource_type_prefix(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_resource_type_prefix() + } + ///

If specified, the returned resources will have a matching tag key.

+ pub fn tag_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.tag_key(input.into()); + self + } + ///

If specified, the returned resources will have a matching tag key.

+ pub fn set_tag_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_tag_key(input); + self + } + ///

If specified, the returned resources will have a matching tag key.

+ pub fn get_tag_key(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_tag_key() + } + ///

If specified, the returned resources will have a matching tag value.

+ pub fn tag_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.tag_value(input.into()); + self + } + ///

If specified, the returned resources will have a matching tag value.

+ pub fn set_tag_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_tag_value(input); + self + } + ///

If specified, the returned resources will have a matching tag value.

+ pub fn get_tag_value(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_tag_value() + } + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanResources API action will return at most 100 results in each response. The maximum value is 100.

+ pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanResources API action will return at most 100 results in each response. The maximum value is 100.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanResources API action will return at most 100 results in each response. The maximum value is 100.

+ pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scan_resources/paginator.rs b/sdk/cloudformation/src/operation/list_resource_scan_resources/paginator.rs new file mode 100644 index 000000000000..bb48f6c25ae9 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scan_resources/paginator.rs @@ -0,0 +1,148 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListResourceScanResources`](crate::operation::list_resource_scan_resources::ListResourceScanResources) +pub struct ListResourceScanResourcesPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListResourceScanResourcesPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `resources`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_resource_scan_resources::paginator::ListResourceScanResourcesPaginatorItems { + crate::operation::list_resource_scan_resources::paginator::ListResourceScanResourcesPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_resource_scan_resources::ListResourceScanResources::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = + crate::operation::list_resource_scan_resources::ListResourceScanResources::orchestrate(&runtime_plugins, input.clone()) + .await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_resource_scan_resources_output_output_next_token(resp); + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListResourceScanResourcesPaginator` +/// +/// This is created with [`.items()`](ListResourceScanResourcesPaginator::items) +pub struct ListResourceScanResourcesPaginatorItems(ListResourceScanResourcesPaginator); + +impl ListResourceScanResourcesPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::ScannedResource, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { + crate::lens::lens_list_resource_scan_resources_output_output_resources(page) + .unwrap_or_default() + .into_iter() + }) + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scans.rs b/sdk/cloudformation/src/operation/list_resource_scans.rs new file mode 100644 index 000000000000..f3d23e6d6f12 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scans.rs @@ -0,0 +1,350 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListResourceScans`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListResourceScans; +impl ListResourceScans { + /// Creates a new `ListResourceScans` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_resource_scans::ListResourceScansInput, + ) -> ::std::result::Result< + crate::operation::list_resource_scans::ListResourceScansOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scans::ListResourceScansError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_resource_scans::ListResourceScansInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("cloudformation", "ListResourceScans", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListResourceScans { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListResourceScans"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListResourceScansRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListResourceScansResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListResourceScans", + "cloudformation", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListResourceScans") + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::new( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptorKind::ResponseBody, + ), + ) + .with_interceptor(ListResourceScansEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_resource_scans::ListResourceScansError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_resource_scans::ListResourceScansError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_resource_scans::ListResourceScansError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListResourceScansResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListResourceScansResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_resource_scans::de_list_resource_scans_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_resource_scans::de_list_resource_scans_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListResourceScansRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListResourceScansRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_resource_scans::ListResourceScansInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_resource_scans::ListResourceScansInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_list_resource_scans_input::ser_list_resource_scans_input_input_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListResourceScansEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListResourceScansEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListResourceScansEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListResourceScansInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +/// Error type for the `ListResourceScansError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListResourceScansError { + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListResourceScansError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListResourceScansError { + /// Creates the `ListResourceScansError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListResourceScansError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::Unhandled(e) => &e.meta, + } + } +} +impl ::std::error::Error for ListResourceScansError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListResourceScansError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListResourceScansError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListResourceScansError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListResourceScansError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_resource_scans::ListResourceScansError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_resource_scans::_list_resource_scans_output::ListResourceScansOutput; + +pub use crate::operation::list_resource_scans::_list_resource_scans_input::ListResourceScansInput; + +mod _list_resource_scans_input; + +mod _list_resource_scans_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/cloudformation/src/operation/list_resource_scans/_list_resource_scans_input.rs b/sdk/cloudformation/src/operation/list_resource_scans/_list_resource_scans_input.rs new file mode 100644 index 000000000000..94e33d890a18 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scans/_list_resource_scans_input.rs @@ -0,0 +1,73 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListResourceScansInput { + ///

A string that identifies the next page of resource scan results.

+ pub next_token: ::std::option::Option<::std::string::String>, + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. The default value is 10. The maximum value is 100.

+ pub max_results: ::std::option::Option, +} +impl ListResourceScansInput { + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. The default value is 10. The maximum value is 100.

+ pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ListResourceScansInput { + /// Creates a new builder-style object to manufacture [`ListResourceScansInput`](crate::operation::list_resource_scans::ListResourceScansInput). + pub fn builder() -> crate::operation::list_resource_scans::builders::ListResourceScansInputBuilder { + crate::operation::list_resource_scans::builders::ListResourceScansInputBuilder::default() + } +} + +/// A builder for [`ListResourceScansInput`](crate::operation::list_resource_scans::ListResourceScansInput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ListResourceScansInputBuilder { + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListResourceScansInputBuilder { + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. The default value is 10. The maximum value is 100.

+ pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. The default value is 10. The maximum value is 100.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. The default value is 10. The maximum value is 100.

+ pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListResourceScansInput`](crate::operation::list_resource_scans::ListResourceScansInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::list_resource_scans::ListResourceScansInput { + next_token: self.next_token, + max_results: self.max_results, + }) + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scans/_list_resource_scans_output.rs b/sdk/cloudformation/src/operation/list_resource_scans/_list_resource_scans_output.rs new file mode 100644 index 000000000000..3ccdb46af66e --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scans/_list_resource_scans_output.rs @@ -0,0 +1,96 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListResourceScansOutput { + ///

The list of scans returned.

+ pub resource_scan_summaries: ::std::option::Option<::std::vec::Vec>, + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScans again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListResourceScansOutput { + ///

The list of scans returned.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_scan_summaries.is_none()`. + pub fn resource_scan_summaries(&self) -> &[crate::types::ResourceScanSummary] { + self.resource_scan_summaries.as_deref().unwrap_or_default() + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScans again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::aws_types::request_id::RequestId for ListResourceScansOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListResourceScansOutput { + /// Creates a new builder-style object to manufacture [`ListResourceScansOutput`](crate::operation::list_resource_scans::ListResourceScansOutput). + pub fn builder() -> crate::operation::list_resource_scans::builders::ListResourceScansOutputBuilder { + crate::operation::list_resource_scans::builders::ListResourceScansOutputBuilder::default() + } +} + +/// A builder for [`ListResourceScansOutput`](crate::operation::list_resource_scans::ListResourceScansOutput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ListResourceScansOutputBuilder { + pub(crate) resource_scan_summaries: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListResourceScansOutputBuilder { + /// Appends an item to `resource_scan_summaries`. + /// + /// To override the contents of this collection use [`set_resource_scan_summaries`](Self::set_resource_scan_summaries). + /// + ///

The list of scans returned.

+ pub fn resource_scan_summaries(mut self, input: crate::types::ResourceScanSummary) -> Self { + let mut v = self.resource_scan_summaries.unwrap_or_default(); + v.push(input); + self.resource_scan_summaries = ::std::option::Option::Some(v); + self + } + ///

The list of scans returned.

+ pub fn set_resource_scan_summaries(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.resource_scan_summaries = input; + self + } + ///

The list of scans returned.

+ pub fn get_resource_scan_summaries(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.resource_scan_summaries + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScans again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScans again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call ListResourceScans again and use that value for the NextToken parameter. If the request returns all results, NextToken is set to an empty string.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListResourceScansOutput`](crate::operation::list_resource_scans::ListResourceScansOutput). + pub fn build(self) -> crate::operation::list_resource_scans::ListResourceScansOutput { + crate::operation::list_resource_scans::ListResourceScansOutput { + resource_scan_summaries: self.resource_scan_summaries, + next_token: self.next_token, + _request_id: self._request_id, + } + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scans/builders.rs b/sdk/cloudformation/src/operation/list_resource_scans/builders.rs new file mode 100644 index 000000000000..e45f73a24d28 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scans/builders.rs @@ -0,0 +1,145 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_resource_scans::_list_resource_scans_output::ListResourceScansOutputBuilder; + +pub use crate::operation::list_resource_scans::_list_resource_scans_input::ListResourceScansInputBuilder; + +impl ListResourceScansInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_resource_scans::ListResourceScansOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scans::ListResourceScansError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_resource_scans(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListResourceScans`. +/// +///

List the resource scans from newest to oldest. By default it will return up to 10 resource scans.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListResourceScansFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_resource_scans::builders::ListResourceScansInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_resource_scans::ListResourceScansOutput, + crate::operation::list_resource_scans::ListResourceScansError, + > for ListResourceScansFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_resource_scans::ListResourceScansOutput, + crate::operation::list_resource_scans::ListResourceScansError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListResourceScansFluentBuilder { + /// Creates a new `ListResourceScans`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListResourceScans as a reference. + pub fn as_input(&self) -> &crate::operation::list_resource_scans::builders::ListResourceScansInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_resource_scans::ListResourceScansOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scans::ListResourceScansError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_resource_scans::ListResourceScans::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_resource_scans::ListResourceScans::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_resource_scans::ListResourceScansOutput, + crate::operation::list_resource_scans::ListResourceScansError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { + self.set_config_override(Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_resource_scans::paginator::ListResourceScansPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_resource_scans::paginator::ListResourceScansPaginator { + crate::operation::list_resource_scans::paginator::ListResourceScansPaginator::new(self.handle, self.inner) + } + ///

A string that identifies the next page of resource scan results.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

A string that identifies the next page of resource scan results.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. The default value is 10. The maximum value is 100.

+ pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. The default value is 10. The maximum value is 100.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. The default value is 10. The maximum value is 100.

+ pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/cloudformation/src/operation/list_resource_scans/paginator.rs b/sdk/cloudformation/src/operation/list_resource_scans/paginator.rs new file mode 100644 index 000000000000..c983c9dc5341 --- /dev/null +++ b/sdk/cloudformation/src/operation/list_resource_scans/paginator.rs @@ -0,0 +1,146 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListResourceScans`](crate::operation::list_resource_scans::ListResourceScans) +pub struct ListResourceScansPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_resource_scans::builders::ListResourceScansInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListResourceScansPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_resource_scans::builders::ListResourceScansInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `resource_scan_summaries`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_resource_scans::paginator::ListResourceScansPaginatorItems { + crate::operation::list_resource_scans::paginator::ListResourceScansPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_resource_scans::ListResourceScansOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scans::ListResourceScansError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_resource_scans::ListResourceScans::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = crate::operation::list_resource_scans::ListResourceScans::orchestrate(&runtime_plugins, input.clone()).await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_resource_scans_output_output_next_token(resp); + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListResourceScansPaginator` +/// +/// This is created with [`.items()`](ListResourceScansPaginator::items) +pub struct ListResourceScansPaginatorItems(ListResourceScansPaginator); + +impl ListResourceScansPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::ResourceScanSummary, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_resource_scans::ListResourceScansError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { + crate::lens::lens_list_resource_scans_output_output_resource_scan_summaries(page) + .unwrap_or_default() + .into_iter() + }) + } +} diff --git a/sdk/cloudformation/src/operation/start_resource_scan.rs b/sdk/cloudformation/src/operation/start_resource_scan.rs new file mode 100644 index 000000000000..b6f3023287b1 --- /dev/null +++ b/sdk/cloudformation/src/operation/start_resource_scan.rs @@ -0,0 +1,375 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `StartResourceScan`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct StartResourceScan; +impl StartResourceScan { + /// Creates a new `StartResourceScan` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::start_resource_scan::StartResourceScanInput, + ) -> ::std::result::Result< + crate::operation::start_resource_scan::StartResourceScanOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::start_resource_scan::StartResourceScanError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::start_resource_scan::StartResourceScanInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("cloudformation", "StartResourceScan", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StartResourceScan { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StartResourceScan"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + StartResourceScanRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + StartResourceScanResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "StartResourceScan", + "cloudformation", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StartResourceScan") + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::new( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptorKind::ResponseBody, + ), + ) + .with_interceptor(StartResourceScanEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::start_resource_scan::StartResourceScanError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::start_resource_scan::StartResourceScanError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::start_resource_scan::StartResourceScanError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct StartResourceScanResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StartResourceScanResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_start_resource_scan::de_start_resource_scan_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_start_resource_scan::de_start_resource_scan_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct StartResourceScanRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StartResourceScanRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::start_resource_scan::StartResourceScanInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::start_resource_scan::StartResourceScanInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_start_resource_scan_input::ser_start_resource_scan_input_input_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct StartResourceScanEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartResourceScanEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "StartResourceScanEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to StartResourceScanInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +/// Error type for the `StartResourceScanError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum StartResourceScanError { + ///

A resource scan is currently in progress. Only one can be run at a time for an account in a Region.

+ ResourceScanInProgressException(crate::types::error::ResourceScanInProgressException), + ///

The limit on resource scans has been exceeded. Reasons include:

+ ///
    + ///
  • + ///

    Exceeded the daily quota for resource scans.

  • + ///
  • + ///

    A resource scan recently failed. You must wait 10 minutes before starting a new resource scan.

  • + ///
  • + ///

    The last resource scan failed after exceeding 100,000 resources. When this happens, you must wait 24 hours before starting a new resource scan.

  • + ///
+ ResourceScanLimitExceededException(crate::types::error::ResourceScanLimitExceededException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartResourceScanError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl StartResourceScanError { + /// Creates the `StartResourceScanError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `StartResourceScanError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceScanInProgressException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceScanLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `StartResourceScanError::ResourceScanInProgressException`. + pub fn is_resource_scan_in_progress_exception(&self) -> bool { + matches!(self, Self::ResourceScanInProgressException(_)) + } + /// Returns `true` if the error kind is `StartResourceScanError::ResourceScanLimitExceededException`. + pub fn is_resource_scan_limit_exceeded_exception(&self) -> bool { + matches!(self, Self::ResourceScanLimitExceededException(_)) + } +} +impl ::std::error::Error for StartResourceScanError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceScanInProgressException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceScanLimitExceededException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for StartResourceScanError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceScanInProgressException(_inner) => _inner.fmt(f), + Self::ResourceScanLimitExceededException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for StartResourceScanError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StartResourceScanError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceScanInProgressException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceScanLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StartResourceScanError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::start_resource_scan::StartResourceScanError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::start_resource_scan::_start_resource_scan_output::StartResourceScanOutput; + +pub use crate::operation::start_resource_scan::_start_resource_scan_input::StartResourceScanInput; + +mod _start_resource_scan_input; + +mod _start_resource_scan_output; + +/// Builders +pub mod builders; diff --git a/sdk/cloudformation/src/operation/start_resource_scan/_start_resource_scan_input.rs b/sdk/cloudformation/src/operation/start_resource_scan/_start_resource_scan_input.rs new file mode 100644 index 000000000000..02ec9b4a5c2d --- /dev/null +++ b/sdk/cloudformation/src/operation/start_resource_scan/_start_resource_scan_input.rs @@ -0,0 +1,51 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct StartResourceScanInput { + ///

A unique identifier for this StartResourceScan request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to start a new resource scan.

+ pub client_request_token: ::std::option::Option<::std::string::String>, +} +impl StartResourceScanInput { + ///

A unique identifier for this StartResourceScan request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to start a new resource scan.

+ pub fn client_request_token(&self) -> ::std::option::Option<&str> { + self.client_request_token.as_deref() + } +} +impl StartResourceScanInput { + /// Creates a new builder-style object to manufacture [`StartResourceScanInput`](crate::operation::start_resource_scan::StartResourceScanInput). + pub fn builder() -> crate::operation::start_resource_scan::builders::StartResourceScanInputBuilder { + crate::operation::start_resource_scan::builders::StartResourceScanInputBuilder::default() + } +} + +/// A builder for [`StartResourceScanInput`](crate::operation::start_resource_scan::StartResourceScanInput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct StartResourceScanInputBuilder { + pub(crate) client_request_token: ::std::option::Option<::std::string::String>, +} +impl StartResourceScanInputBuilder { + ///

A unique identifier for this StartResourceScan request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to start a new resource scan.

+ pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_request_token = ::std::option::Option::Some(input.into()); + self + } + ///

A unique identifier for this StartResourceScan request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to start a new resource scan.

+ pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_request_token = input; + self + } + ///

A unique identifier for this StartResourceScan request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to start a new resource scan.

+ pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_request_token + } + /// Consumes the builder and constructs a [`StartResourceScanInput`](crate::operation::start_resource_scan::StartResourceScanInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::start_resource_scan::StartResourceScanInput { + client_request_token: self.client_request_token, + }) + } +} diff --git a/sdk/cloudformation/src/operation/start_resource_scan/_start_resource_scan_output.rs b/sdk/cloudformation/src/operation/start_resource_scan/_start_resource_scan_output.rs new file mode 100644 index 000000000000..19ff69da8095 --- /dev/null +++ b/sdk/cloudformation/src/operation/start_resource_scan/_start_resource_scan_output.rs @@ -0,0 +1,66 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct StartResourceScanOutput { + ///

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ pub resource_scan_id: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl StartResourceScanOutput { + ///

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ pub fn resource_scan_id(&self) -> ::std::option::Option<&str> { + self.resource_scan_id.as_deref() + } +} +impl ::aws_types::request_id::RequestId for StartResourceScanOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl StartResourceScanOutput { + /// Creates a new builder-style object to manufacture [`StartResourceScanOutput`](crate::operation::start_resource_scan::StartResourceScanOutput). + pub fn builder() -> crate::operation::start_resource_scan::builders::StartResourceScanOutputBuilder { + crate::operation::start_resource_scan::builders::StartResourceScanOutputBuilder::default() + } +} + +/// A builder for [`StartResourceScanOutput`](crate::operation::start_resource_scan::StartResourceScanOutput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct StartResourceScanOutputBuilder { + pub(crate) resource_scan_id: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl StartResourceScanOutputBuilder { + ///

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ pub fn resource_scan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_scan_id = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ pub fn set_resource_scan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_scan_id = input; + self + } + ///

The Amazon Resource Name (ARN) of the resource scan. The format is arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. An example is arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 .

+ pub fn get_resource_scan_id(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_scan_id + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`StartResourceScanOutput`](crate::operation::start_resource_scan::StartResourceScanOutput). + pub fn build(self) -> crate::operation::start_resource_scan::StartResourceScanOutput { + crate::operation::start_resource_scan::StartResourceScanOutput { + resource_scan_id: self.resource_scan_id, + _request_id: self._request_id, + } + } +} diff --git a/sdk/cloudformation/src/operation/start_resource_scan/builders.rs b/sdk/cloudformation/src/operation/start_resource_scan/builders.rs new file mode 100644 index 000000000000..d5de0beaa8cd --- /dev/null +++ b/sdk/cloudformation/src/operation/start_resource_scan/builders.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::start_resource_scan::_start_resource_scan_output::StartResourceScanOutputBuilder; + +pub use crate::operation::start_resource_scan::_start_resource_scan_input::StartResourceScanInputBuilder; + +impl StartResourceScanInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::start_resource_scan::StartResourceScanOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::start_resource_scan::StartResourceScanError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.start_resource_scan(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `StartResourceScan`. +/// +///

Starts a scan of the resources in this account in this Region. You can the status of a scan using the ListResourceScans API action.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct StartResourceScanFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::start_resource_scan::builders::StartResourceScanInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::start_resource_scan::StartResourceScanOutput, + crate::operation::start_resource_scan::StartResourceScanError, + > for StartResourceScanFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::start_resource_scan::StartResourceScanOutput, + crate::operation::start_resource_scan::StartResourceScanError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl StartResourceScanFluentBuilder { + /// Creates a new `StartResourceScan`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the StartResourceScan as a reference. + pub fn as_input(&self) -> &crate::operation::start_resource_scan::builders::StartResourceScanInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::start_resource_scan::StartResourceScanOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::start_resource_scan::StartResourceScanError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::start_resource_scan::StartResourceScan::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::start_resource_scan::StartResourceScan::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::start_resource_scan::StartResourceScanOutput, + crate::operation::start_resource_scan::StartResourceScanError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { + self.set_config_override(Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

A unique identifier for this StartResourceScan request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to start a new resource scan.

+ pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_request_token(input.into()); + self + } + ///

A unique identifier for this StartResourceScan request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to start a new resource scan.

+ pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_request_token(input); + self + } + ///

A unique identifier for this StartResourceScan request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to start a new resource scan.

+ pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_request_token() + } +} diff --git a/sdk/cloudformation/src/operation/update_generated_template.rs b/sdk/cloudformation/src/operation/update_generated_template.rs new file mode 100644 index 000000000000..b2630b96fa09 --- /dev/null +++ b/sdk/cloudformation/src/operation/update_generated_template.rs @@ -0,0 +1,384 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `UpdateGeneratedTemplate`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateGeneratedTemplate; +impl UpdateGeneratedTemplate { + /// Creates a new `UpdateGeneratedTemplate` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_generated_template::UpdateGeneratedTemplateInput, + ) -> ::std::result::Result< + crate::operation::update_generated_template::UpdateGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_generated_template::UpdateGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_generated_template::UpdateGeneratedTemplateInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "cloudformation", + "UpdateGeneratedTemplate", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateGeneratedTemplate { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateGeneratedTemplate"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + UpdateGeneratedTemplateRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + UpdateGeneratedTemplateResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "UpdateGeneratedTemplate", + "cloudformation", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateGeneratedTemplate") + .with_interceptor( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::new( + ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptorKind::ResponseBody, + ), + ) + .with_interceptor(UpdateGeneratedTemplateEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::update_generated_template::UpdateGeneratedTemplateError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::update_generated_template::UpdateGeneratedTemplateError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::update_generated_template::UpdateGeneratedTemplateError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct UpdateGeneratedTemplateResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateGeneratedTemplateResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_update_generated_template::de_update_generated_template_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_update_generated_template::de_update_generated_template_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct UpdateGeneratedTemplateRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateGeneratedTemplateRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::update_generated_template::UpdateGeneratedTemplateInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::update_generated_template::UpdateGeneratedTemplateInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_update_generated_template_input::ser_update_generated_template_input_input_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct UpdateGeneratedTemplateEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateGeneratedTemplateEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "UpdateGeneratedTemplateEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to UpdateGeneratedTemplateInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +/// Error type for the `UpdateGeneratedTemplateError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum UpdateGeneratedTemplateError { + ///

The resource with the name requested already exists.

+ AlreadyExistsException(crate::types::error::AlreadyExistsException), + ///

The generated template was not found.

+ GeneratedTemplateNotFoundException(crate::types::error::GeneratedTemplateNotFoundException), + ///

The quota for the resource has already been reached.

+ ///

For information about resource and stack limitations, see CloudFormation quotas in the CloudFormation User Guide.

+ LimitExceededException(crate::types::error::LimitExceededException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateGeneratedTemplateError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl UpdateGeneratedTemplateError { + /// Creates the `UpdateGeneratedTemplateError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `UpdateGeneratedTemplateError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::GeneratedTemplateNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::LimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `UpdateGeneratedTemplateError::AlreadyExistsException`. + pub fn is_already_exists_exception(&self) -> bool { + matches!(self, Self::AlreadyExistsException(_)) + } + /// Returns `true` if the error kind is `UpdateGeneratedTemplateError::GeneratedTemplateNotFoundException`. + pub fn is_generated_template_not_found_exception(&self) -> bool { + matches!(self, Self::GeneratedTemplateNotFoundException(_)) + } + /// Returns `true` if the error kind is `UpdateGeneratedTemplateError::LimitExceededException`. + pub fn is_limit_exceeded_exception(&self) -> bool { + matches!(self, Self::LimitExceededException(_)) + } +} +impl ::std::error::Error for UpdateGeneratedTemplateError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AlreadyExistsException(_inner) => ::std::option::Option::Some(_inner), + Self::GeneratedTemplateNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::LimitExceededException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for UpdateGeneratedTemplateError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AlreadyExistsException(_inner) => _inner.fmt(f), + Self::GeneratedTemplateNotFoundException(_inner) => _inner.fmt(f), + Self::LimitExceededException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateGeneratedTemplateError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateGeneratedTemplateError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::GeneratedTemplateNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::LimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateGeneratedTemplateError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::update_generated_template::UpdateGeneratedTemplateError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::update_generated_template::_update_generated_template_output::UpdateGeneratedTemplateOutput; + +pub use crate::operation::update_generated_template::_update_generated_template_input::UpdateGeneratedTemplateInput; + +mod _update_generated_template_input; + +mod _update_generated_template_output; + +/// Builders +pub mod builders; diff --git a/sdk/cloudformation/src/operation/update_generated_template/_update_generated_template_input.rs b/sdk/cloudformation/src/operation/update_generated_template/_update_generated_template_input.rs new file mode 100644 index 000000000000..ced8c8cc873c --- /dev/null +++ b/sdk/cloudformation/src/operation/update_generated_template/_update_generated_template_input.rs @@ -0,0 +1,181 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UpdateGeneratedTemplateInput { + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub generated_template_name: ::std::option::Option<::std::string::String>, + ///

An optional new name to assign to the generated template.

+ pub new_generated_template_name: ::std::option::Option<::std::string::String>, + ///

An optional list of resources to be added to the generated template.

+ pub add_resources: ::std::option::Option<::std::vec::Vec>, + ///

A list of logical ids for resources to remove from the generated template.

+ pub remove_resources: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + ///

If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template.

+ pub refresh_all_resources: ::std::option::Option, + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub template_configuration: ::std::option::Option, +} +impl UpdateGeneratedTemplateInput { + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn generated_template_name(&self) -> ::std::option::Option<&str> { + self.generated_template_name.as_deref() + } + ///

An optional new name to assign to the generated template.

+ pub fn new_generated_template_name(&self) -> ::std::option::Option<&str> { + self.new_generated_template_name.as_deref() + } + ///

An optional list of resources to be added to the generated template.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.add_resources.is_none()`. + pub fn add_resources(&self) -> &[crate::types::ResourceDefinition] { + self.add_resources.as_deref().unwrap_or_default() + } + ///

A list of logical ids for resources to remove from the generated template.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.remove_resources.is_none()`. + pub fn remove_resources(&self) -> &[::std::string::String] { + self.remove_resources.as_deref().unwrap_or_default() + } + ///

If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template.

+ pub fn refresh_all_resources(&self) -> ::std::option::Option { + self.refresh_all_resources + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn template_configuration(&self) -> ::std::option::Option<&crate::types::TemplateConfiguration> { + self.template_configuration.as_ref() + } +} +impl UpdateGeneratedTemplateInput { + /// Creates a new builder-style object to manufacture [`UpdateGeneratedTemplateInput`](crate::operation::update_generated_template::UpdateGeneratedTemplateInput). + pub fn builder() -> crate::operation::update_generated_template::builders::UpdateGeneratedTemplateInputBuilder { + crate::operation::update_generated_template::builders::UpdateGeneratedTemplateInputBuilder::default() + } +} + +/// A builder for [`UpdateGeneratedTemplateInput`](crate::operation::update_generated_template::UpdateGeneratedTemplateInput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct UpdateGeneratedTemplateInputBuilder { + pub(crate) generated_template_name: ::std::option::Option<::std::string::String>, + pub(crate) new_generated_template_name: ::std::option::Option<::std::string::String>, + pub(crate) add_resources: ::std::option::Option<::std::vec::Vec>, + pub(crate) remove_resources: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + pub(crate) refresh_all_resources: ::std::option::Option, + pub(crate) template_configuration: ::std::option::Option, +} +impl UpdateGeneratedTemplateInputBuilder { + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ /// This field is required. + pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.generated_template_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.generated_template_name = input; + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + &self.generated_template_name + } + ///

An optional new name to assign to the generated template.

+ pub fn new_generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.new_generated_template_name = ::std::option::Option::Some(input.into()); + self + } + ///

An optional new name to assign to the generated template.

+ pub fn set_new_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.new_generated_template_name = input; + self + } + ///

An optional new name to assign to the generated template.

+ pub fn get_new_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + &self.new_generated_template_name + } + /// Appends an item to `add_resources`. + /// + /// To override the contents of this collection use [`set_add_resources`](Self::set_add_resources). + /// + ///

An optional list of resources to be added to the generated template.

+ pub fn add_resources(mut self, input: crate::types::ResourceDefinition) -> Self { + let mut v = self.add_resources.unwrap_or_default(); + v.push(input); + self.add_resources = ::std::option::Option::Some(v); + self + } + ///

An optional list of resources to be added to the generated template.

+ pub fn set_add_resources(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.add_resources = input; + self + } + ///

An optional list of resources to be added to the generated template.

+ pub fn get_add_resources(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.add_resources + } + /// Appends an item to `remove_resources`. + /// + /// To override the contents of this collection use [`set_remove_resources`](Self::set_remove_resources). + /// + ///

A list of logical ids for resources to remove from the generated template.

+ pub fn remove_resources(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.remove_resources.unwrap_or_default(); + v.push(input.into()); + self.remove_resources = ::std::option::Option::Some(v); + self + } + ///

A list of logical ids for resources to remove from the generated template.

+ pub fn set_remove_resources(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.remove_resources = input; + self + } + ///

A list of logical ids for resources to remove from the generated template.

+ pub fn get_remove_resources(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.remove_resources + } + ///

If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template.

+ pub fn refresh_all_resources(mut self, input: bool) -> Self { + self.refresh_all_resources = ::std::option::Option::Some(input); + self + } + ///

If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template.

+ pub fn set_refresh_all_resources(mut self, input: ::std::option::Option) -> Self { + self.refresh_all_resources = input; + self + } + ///

If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template.

+ pub fn get_refresh_all_resources(&self) -> &::std::option::Option { + &self.refresh_all_resources + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn template_configuration(mut self, input: crate::types::TemplateConfiguration) -> Self { + self.template_configuration = ::std::option::Option::Some(input); + self + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn set_template_configuration(mut self, input: ::std::option::Option) -> Self { + self.template_configuration = input; + self + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn get_template_configuration(&self) -> &::std::option::Option { + &self.template_configuration + } + /// Consumes the builder and constructs a [`UpdateGeneratedTemplateInput`](crate::operation::update_generated_template::UpdateGeneratedTemplateInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::update_generated_template::UpdateGeneratedTemplateInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::update_generated_template::UpdateGeneratedTemplateInput { + generated_template_name: self.generated_template_name, + new_generated_template_name: self.new_generated_template_name, + add_resources: self.add_resources, + remove_resources: self.remove_resources, + refresh_all_resources: self.refresh_all_resources, + template_configuration: self.template_configuration, + }) + } +} diff --git a/sdk/cloudformation/src/operation/update_generated_template/_update_generated_template_output.rs b/sdk/cloudformation/src/operation/update_generated_template/_update_generated_template_output.rs new file mode 100644 index 000000000000..37a3fe8435f0 --- /dev/null +++ b/sdk/cloudformation/src/operation/update_generated_template/_update_generated_template_output.rs @@ -0,0 +1,66 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UpdateGeneratedTemplateOutput { + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub generated_template_id: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl UpdateGeneratedTemplateOutput { + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn generated_template_id(&self) -> ::std::option::Option<&str> { + self.generated_template_id.as_deref() + } +} +impl ::aws_types::request_id::RequestId for UpdateGeneratedTemplateOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl UpdateGeneratedTemplateOutput { + /// Creates a new builder-style object to manufacture [`UpdateGeneratedTemplateOutput`](crate::operation::update_generated_template::UpdateGeneratedTemplateOutput). + pub fn builder() -> crate::operation::update_generated_template::builders::UpdateGeneratedTemplateOutputBuilder { + crate::operation::update_generated_template::builders::UpdateGeneratedTemplateOutputBuilder::default() + } +} + +/// A builder for [`UpdateGeneratedTemplateOutput`](crate::operation::update_generated_template::UpdateGeneratedTemplateOutput). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct UpdateGeneratedTemplateOutputBuilder { + pub(crate) generated_template_id: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl UpdateGeneratedTemplateOutputBuilder { + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn generated_template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.generated_template_id = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn set_generated_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.generated_template_id = input; + self + } + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn get_generated_template_id(&self) -> &::std::option::Option<::std::string::String> { + &self.generated_template_id + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`UpdateGeneratedTemplateOutput`](crate::operation::update_generated_template::UpdateGeneratedTemplateOutput). + pub fn build(self) -> crate::operation::update_generated_template::UpdateGeneratedTemplateOutput { + crate::operation::update_generated_template::UpdateGeneratedTemplateOutput { + generated_template_id: self.generated_template_id, + _request_id: self._request_id, + } + } +} diff --git a/sdk/cloudformation/src/operation/update_generated_template/builders.rs b/sdk/cloudformation/src/operation/update_generated_template/builders.rs new file mode 100644 index 000000000000..ccf6473fb026 --- /dev/null +++ b/sdk/cloudformation/src/operation/update_generated_template/builders.rs @@ -0,0 +1,203 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::update_generated_template::_update_generated_template_output::UpdateGeneratedTemplateOutputBuilder; + +pub use crate::operation::update_generated_template::_update_generated_template_input::UpdateGeneratedTemplateInputBuilder; + +impl UpdateGeneratedTemplateInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::update_generated_template::UpdateGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_generated_template::UpdateGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.update_generated_template(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `UpdateGeneratedTemplate`. +/// +///

Updates a generated template. This can be used to change the name, add and remove resources, refresh resources, and change the DeletionPolicy and UpdateReplacePolicy settings. You can check the status of the update to the generated template using the DescribeGeneratedTemplate API action.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct UpdateGeneratedTemplateFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::update_generated_template::builders::UpdateGeneratedTemplateInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::update_generated_template::UpdateGeneratedTemplateOutput, + crate::operation::update_generated_template::UpdateGeneratedTemplateError, + > for UpdateGeneratedTemplateFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::update_generated_template::UpdateGeneratedTemplateOutput, + crate::operation::update_generated_template::UpdateGeneratedTemplateError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl UpdateGeneratedTemplateFluentBuilder { + /// Creates a new `UpdateGeneratedTemplate`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the UpdateGeneratedTemplate as a reference. + pub fn as_input(&self) -> &crate::operation::update_generated_template::builders::UpdateGeneratedTemplateInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::update_generated_template::UpdateGeneratedTemplateOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_generated_template::UpdateGeneratedTemplateError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::update_generated_template::UpdateGeneratedTemplate::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::update_generated_template::UpdateGeneratedTemplate::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::update_generated_template::UpdateGeneratedTemplateOutput, + crate::operation::update_generated_template::UpdateGeneratedTemplateError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl Into) -> Self { + self.set_config_override(Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.generated_template_name(input.into()); + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_generated_template_name(input); + self + } + ///

The name or Amazon Resource Name (ARN) of a generated template.

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_generated_template_name() + } + ///

An optional new name to assign to the generated template.

+ pub fn new_generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.new_generated_template_name(input.into()); + self + } + ///

An optional new name to assign to the generated template.

+ pub fn set_new_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_new_generated_template_name(input); + self + } + ///

An optional new name to assign to the generated template.

+ pub fn get_new_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_new_generated_template_name() + } + /// Appends an item to `AddResources`. + /// + /// To override the contents of this collection use [`set_add_resources`](Self::set_add_resources). + /// + ///

An optional list of resources to be added to the generated template.

+ pub fn add_resources(mut self, input: crate::types::ResourceDefinition) -> Self { + self.inner = self.inner.add_resources(input); + self + } + ///

An optional list of resources to be added to the generated template.

+ pub fn set_add_resources(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.inner = self.inner.set_add_resources(input); + self + } + ///

An optional list of resources to be added to the generated template.

+ pub fn get_add_resources(&self) -> &::std::option::Option<::std::vec::Vec> { + self.inner.get_add_resources() + } + /// Appends an item to `RemoveResources`. + /// + /// To override the contents of this collection use [`set_remove_resources`](Self::set_remove_resources). + /// + ///

A list of logical ids for resources to remove from the generated template.

+ pub fn remove_resources(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.remove_resources(input.into()); + self + } + ///

A list of logical ids for resources to remove from the generated template.

+ pub fn set_remove_resources(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.inner = self.inner.set_remove_resources(input); + self + } + ///

A list of logical ids for resources to remove from the generated template.

+ pub fn get_remove_resources(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + self.inner.get_remove_resources() + } + ///

If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template.

+ pub fn refresh_all_resources(mut self, input: bool) -> Self { + self.inner = self.inner.refresh_all_resources(input); + self + } + ///

If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template.

+ pub fn set_refresh_all_resources(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_refresh_all_resources(input); + self + } + ///

If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template.

+ pub fn get_refresh_all_resources(&self) -> &::std::option::Option { + self.inner.get_refresh_all_resources() + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn template_configuration(mut self, input: crate::types::TemplateConfiguration) -> Self { + self.inner = self.inner.template_configuration(input); + self + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn set_template_configuration(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_template_configuration(input); + self + } + ///

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

+ pub fn get_template_configuration(&self) -> &::std::option::Option { + self.inner.get_template_configuration() + } +} diff --git a/sdk/cloudformation/src/protocol_serde.rs b/sdk/cloudformation/src/protocol_serde.rs index 1a5249357ed8..7383299c814e 100644 --- a/sdk/cloudformation/src/protocol_serde.rs +++ b/sdk/cloudformation/src/protocol_serde.rs @@ -47,6 +47,10 @@ pub(crate) mod shape_create_change_set; pub(crate) mod shape_create_change_set_input; +pub(crate) mod shape_create_generated_template; + +pub(crate) mod shape_create_generated_template_input; + pub(crate) mod shape_create_stack; pub(crate) mod shape_create_stack_input; @@ -71,6 +75,10 @@ pub(crate) mod shape_delete_change_set; pub(crate) mod shape_delete_change_set_input; +pub(crate) mod shape_delete_generated_template; + +pub(crate) mod shape_delete_generated_template_input; + pub(crate) mod shape_delete_stack; pub(crate) mod shape_delete_stack_input; @@ -99,6 +107,10 @@ pub(crate) mod shape_describe_change_set_hooks_input; pub(crate) mod shape_describe_change_set_input; +pub(crate) mod shape_describe_generated_template; + +pub(crate) mod shape_describe_generated_template_input; + pub(crate) mod shape_describe_organizations_access; pub(crate) mod shape_describe_organizations_access_input; @@ -107,6 +119,10 @@ pub(crate) mod shape_describe_publisher; pub(crate) mod shape_describe_publisher_input; +pub(crate) mod shape_describe_resource_scan; + +pub(crate) mod shape_describe_resource_scan_input; + pub(crate) mod shape_describe_stack_drift_detection_status; pub(crate) mod shape_describe_stack_drift_detection_status_input; @@ -171,6 +187,10 @@ pub(crate) mod shape_execute_change_set; pub(crate) mod shape_execute_change_set_input; +pub(crate) mod shape_get_generated_template; + +pub(crate) mod shape_get_generated_template_input; + pub(crate) mod shape_get_stack_policy; pub(crate) mod shape_get_stack_policy_input; @@ -195,10 +215,26 @@ pub(crate) mod shape_list_exports; pub(crate) mod shape_list_exports_input; +pub(crate) mod shape_list_generated_templates; + +pub(crate) mod shape_list_generated_templates_input; + pub(crate) mod shape_list_imports; pub(crate) mod shape_list_imports_input; +pub(crate) mod shape_list_resource_scan_related_resources; + +pub(crate) mod shape_list_resource_scan_related_resources_input; + +pub(crate) mod shape_list_resource_scan_resources; + +pub(crate) mod shape_list_resource_scan_resources_input; + +pub(crate) mod shape_list_resource_scans; + +pub(crate) mod shape_list_resource_scans_input; + pub(crate) mod shape_list_stack_instance_resource_drifts; pub(crate) mod shape_list_stack_instance_resource_drifts_input; @@ -275,6 +311,10 @@ pub(crate) mod shape_signal_resource; pub(crate) mod shape_signal_resource_input; +pub(crate) mod shape_start_resource_scan; + +pub(crate) mod shape_start_resource_scan_input; + pub(crate) mod shape_stop_stack_set_operation; pub(crate) mod shape_stop_stack_set_operation_input; @@ -283,6 +323,10 @@ pub(crate) mod shape_test_type; pub(crate) mod shape_test_type_input; +pub(crate) mod shape_update_generated_template; + +pub(crate) mod shape_update_generated_template_input; + pub(crate) mod shape_update_stack; pub(crate) mod shape_update_stack_input; @@ -311,10 +355,14 @@ pub(crate) mod shape_cfn_registry_exception; pub(crate) mod shape_change_set_not_found_exception; +pub(crate) mod shape_concurrent_resources_limit_exceeded_exception; + pub(crate) mod shape_created_but_modified_exception; pub(crate) mod shape_deployment_targets; +pub(crate) mod shape_generated_template_not_found_exception; + pub(crate) mod shape_insufficient_capabilities_exception; pub(crate) mod shape_invalid_change_set_status_exception; @@ -343,10 +391,20 @@ pub(crate) mod shape_operation_status_check_failed_exception; pub(crate) mod shape_parameter; +pub(crate) mod shape_resource_definition; + +pub(crate) mod shape_resource_scan_in_progress_exception; + +pub(crate) mod shape_resource_scan_limit_exceeded_exception; + +pub(crate) mod shape_resource_scan_not_found_exception; + pub(crate) mod shape_resource_to_import; pub(crate) mod shape_rollback_configuration; +pub(crate) mod shape_scanned_resource_identifier; + pub(crate) mod shape_stack_instance_filter; pub(crate) mod shape_stack_instance_not_found_exception; @@ -363,6 +421,8 @@ pub(crate) mod shape_stale_request_exception; pub(crate) mod shape_tag; +pub(crate) mod shape_template_configuration; + pub(crate) mod shape_template_summary_config; pub(crate) mod shape_token_already_exists_exception; @@ -399,14 +459,22 @@ pub(crate) mod shape_parameters; pub(crate) mod shape_registration_token_list; +pub(crate) mod shape_related_resources; + pub(crate) mod shape_required_activated_types; +pub(crate) mod shape_resource_details; + pub(crate) mod shape_resource_identifier_summaries; +pub(crate) mod shape_resource_scan_summaries; + pub(crate) mod shape_resource_types; pub(crate) mod shape_rollback_trigger; +pub(crate) mod shape_scanned_resources; + pub(crate) mod shape_stack_events; pub(crate) mod shape_stack_instance; @@ -445,6 +513,10 @@ pub(crate) mod shape_tags; pub(crate) mod shape_template_parameters; +pub(crate) mod shape_template_progress; + +pub(crate) mod shape_template_summaries; + pub(crate) mod shape_transforms_list; pub(crate) mod shape_type_configuration_details_list; @@ -483,10 +555,16 @@ pub(crate) mod shape_region_list; pub(crate) mod shape_required_activated_type; +pub(crate) mod shape_resource_detail; + pub(crate) mod shape_resource_identifier_summary; +pub(crate) mod shape_resource_scan_summary; + pub(crate) mod shape_rollback_triggers; +pub(crate) mod shape_scanned_resource; + pub(crate) mod shape_stack; pub(crate) mod shape_stack_event; @@ -517,6 +595,8 @@ pub(crate) mod shape_stack_summary; pub(crate) mod shape_template_parameter; +pub(crate) mod shape_template_summary; + pub(crate) mod shape_type_configuration_details; pub(crate) mod shape_type_summary; @@ -529,6 +609,8 @@ pub(crate) mod shape_account_list; pub(crate) mod shape_change_set_hook_target_details; +pub(crate) mod shape_jazz_resource_identifier_properties; + pub(crate) mod shape_logical_resource_ids; pub(crate) mod shape_outputs; @@ -541,6 +623,8 @@ pub(crate) mod shape_property_difference; pub(crate) mod shape_resource_change; +pub(crate) mod shape_resource_identifier_properties; + pub(crate) mod shape_resource_identifiers; pub(crate) mod shape_stack_drift_information; @@ -551,6 +635,8 @@ pub(crate) mod shape_stack_resource_drift_information_summary; pub(crate) mod shape_supported_major_versions; +pub(crate) mod shape_warning_details; + pub(crate) mod shape_allowed_values; pub(crate) mod shape_change_set_hook_resource_target_details; @@ -561,6 +647,12 @@ pub(crate) mod shape_resource_change_details; pub(crate) mod shape_scope; +pub(crate) mod shape_warning_detail; + pub(crate) mod shape_resource_change_detail; +pub(crate) mod shape_warning_properties; + pub(crate) mod shape_resource_target_definition; + +pub(crate) mod shape_warning_property; diff --git a/sdk/cloudformation/src/protocol_serde/shape_concurrent_resources_limit_exceeded_exception.rs b/sdk/cloudformation/src/protocol_serde/shape_concurrent_resources_limit_exceeded_exception.rs new file mode 100644 index 000000000000..4913803c93c1 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_concurrent_resources_limit_exceeded_exception.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(unused_mut)] +pub fn de_concurrent_resources_limit_exceeded_exception_xml_err( + inp: &[u8], + mut builder: crate::types::error::builders::ConcurrentResourcesLimitExceededExceptionBuilder, +) -> Result { + if inp.is_empty() { + return Ok(builder); + } + let mut document = ::aws_smithy_xml::decode::Document::try_from(inp)?; + #[allow(unused_mut)] + let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?; + while let Some(mut tag) = error_decoder.next_tag() { + match tag.start_el() { + s if s.matches("Message") /* Message com.amazonaws.cloudformation#ConcurrentResourcesLimitExceededException$Message */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_message(var_1); + } + , + _ => {} + } + } + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_create_generated_template.rs b/sdk/cloudformation/src/protocol_serde/shape_create_generated_template.rs new file mode 100644 index 000000000000..52bd236b44f8 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_create_generated_template.rs @@ -0,0 +1,145 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_create_generated_template_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::create_generated_template::CreateGeneratedTemplateOutput, + crate::operation::create_generated_template::CreateGeneratedTemplateError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::create_generated_template::CreateGeneratedTemplateError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::create_generated_template::CreateGeneratedTemplateError::unhandled( + generic, + )) + } + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AlreadyExistsException" => crate::operation::create_generated_template::CreateGeneratedTemplateError::AlreadyExistsException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AlreadyExistsExceptionBuilder::default(); + output = crate::protocol_serde::shape_already_exists_exception::de_already_exists_exception_xml_err(_response_body, output) + .map_err(crate::operation::create_generated_template::CreateGeneratedTemplateError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ConcurrentResourcesLimitExceeded" => { + crate::operation::create_generated_template::CreateGeneratedTemplateError::ConcurrentResourcesLimitExceededException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConcurrentResourcesLimitExceededExceptionBuilder::default(); + output = crate::protocol_serde::shape_concurrent_resources_limit_exceeded_exception::de_concurrent_resources_limit_exceeded_exception_xml_err(_response_body, output).map_err(crate::operation::create_generated_template::CreateGeneratedTemplateError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "LimitExceededException" => crate::operation::create_generated_template::CreateGeneratedTemplateError::LimitExceededException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default(); + output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_xml_err(_response_body, output) + .map_err(crate::operation::create_generated_template::CreateGeneratedTemplateError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::create_generated_template::CreateGeneratedTemplateError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_create_generated_template_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::create_generated_template::CreateGeneratedTemplateOutput, + crate::operation::create_generated_template::CreateGeneratedTemplateError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::create_generated_template::builders::CreateGeneratedTemplateOutputBuilder::default(); + output = crate::protocol_serde::shape_create_generated_template::de_create_generated_template(_response_body, output) + .map_err(crate::operation::create_generated_template::CreateGeneratedTemplateError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +#[allow(unused_mut)] +pub fn de_create_generated_template( + inp: &[u8], + mut builder: crate::operation::create_generated_template::builders::CreateGeneratedTemplateOutputBuilder, +) -> Result { + let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?; + + #[allow(unused_mut)] + let mut decoder = doc.root_element()?; + #[allow(unused_variables)] + let start_el = decoder.start_el(); + if !(start_el.matches("CreateGeneratedTemplateResponse")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid root, expected CreateGeneratedTemplateResponse got {:?}", + start_el + ))); + } + if let Some(mut result_tag) = decoder.next_tag() { + let start_el = result_tag.start_el(); + if !(start_el.matches("CreateGeneratedTemplateResult")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid result, expected CreateGeneratedTemplateResult got {:?}", + start_el + ))); + } + while let Some(mut tag) = result_tag.next_tag() { + match tag.start_el() { + s if s.matches("GeneratedTemplateId") /* GeneratedTemplateId com.amazonaws.cloudformation.synthetic#CreateGeneratedTemplateOutput$GeneratedTemplateId */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_generated_template_id(var_1); + } + , + _ => {} + } + } + } else { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom( + "expected CreateGeneratedTemplateResult tag", + )); + }; + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_create_generated_template_input.rs b/sdk/cloudformation/src/protocol_serde/shape_create_generated_template_input.rs new file mode 100644 index 000000000000..403810668a78 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_create_generated_template_input.rs @@ -0,0 +1,36 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_create_generated_template_input_input_input( + input: &crate::operation::create_generated_template::CreateGeneratedTemplateInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + #[allow(unused_mut)] + let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "CreateGeneratedTemplate", "2010-05-15"); + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("Resources"); + if let Some(var_2) = &input.resources { + let mut list_4 = scope_1.start_list(false, None); + for item_3 in var_2 { + #[allow(unused_mut)] + let mut entry_5 = list_4.entry(); + crate::protocol_serde::shape_resource_definition::ser_resource_definition(entry_5, item_3)?; + } + list_4.finish(); + } + #[allow(unused_mut)] + let mut scope_6 = writer.prefix("GeneratedTemplateName"); + if let Some(var_7) = &input.generated_template_name { + scope_6.string(var_7); + } + #[allow(unused_mut)] + let mut scope_8 = writer.prefix("StackName"); + if let Some(var_9) = &input.stack_name { + scope_8.string(var_9); + } + #[allow(unused_mut)] + let mut scope_10 = writer.prefix("TemplateConfiguration"); + if let Some(var_11) = &input.template_configuration { + crate::protocol_serde::shape_template_configuration::ser_template_configuration(scope_10, var_11)?; + } + writer.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_delete_generated_template.rs b/sdk/cloudformation/src/protocol_serde/shape_delete_generated_template.rs new file mode 100644 index 000000000000..42351883115e --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_delete_generated_template.rs @@ -0,0 +1,82 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_delete_generated_template_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput, + crate::operation::delete_generated_template::DeleteGeneratedTemplateError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::delete_generated_template::DeleteGeneratedTemplateError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::delete_generated_template::DeleteGeneratedTemplateError::unhandled( + generic, + )) + } + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ConcurrentResourcesLimitExceeded" => { + crate::operation::delete_generated_template::DeleteGeneratedTemplateError::ConcurrentResourcesLimitExceededException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConcurrentResourcesLimitExceededExceptionBuilder::default(); + output = crate::protocol_serde::shape_concurrent_resources_limit_exceeded_exception::de_concurrent_resources_limit_exceeded_exception_xml_err(_response_body, output).map_err(crate::operation::delete_generated_template::DeleteGeneratedTemplateError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "GeneratedTemplateNotFound" => { + crate::operation::delete_generated_template::DeleteGeneratedTemplateError::GeneratedTemplateNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::GeneratedTemplateNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_generated_template_not_found_exception::de_generated_template_not_found_exception_xml_err( + _response_body, + output, + ) + .map_err(crate::operation::delete_generated_template::DeleteGeneratedTemplateError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + _ => crate::operation::delete_generated_template::DeleteGeneratedTemplateError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_delete_generated_template_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::delete_generated_template::DeleteGeneratedTemplateOutput, + crate::operation::delete_generated_template::DeleteGeneratedTemplateError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::delete_generated_template::builders::DeleteGeneratedTemplateOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_delete_generated_template_input.rs b/sdk/cloudformation/src/protocol_serde/shape_delete_generated_template_input.rs new file mode 100644 index 000000000000..ba9fb5108478 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_delete_generated_template_input.rs @@ -0,0 +1,15 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_delete_generated_template_input_input_input( + input: &crate::operation::delete_generated_template::DeleteGeneratedTemplateInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + #[allow(unused_mut)] + let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "DeleteGeneratedTemplate", "2010-05-15"); + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("GeneratedTemplateName"); + if let Some(var_2) = &input.generated_template_name { + scope_1.string(var_2); + } + writer.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_describe_generated_template.rs b/sdk/cloudformation/src/protocol_serde/shape_describe_generated_template.rs new file mode 100644 index 000000000000..2e02f017c331 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_describe_generated_template.rs @@ -0,0 +1,246 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_describe_generated_template_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput, + crate::operation::describe_generated_template::DescribeGeneratedTemplateError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::describe_generated_template::DescribeGeneratedTemplateError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::describe_generated_template::DescribeGeneratedTemplateError::unhandled( + generic, + )) + } + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "GeneratedTemplateNotFound" => { + crate::operation::describe_generated_template::DescribeGeneratedTemplateError::GeneratedTemplateNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::GeneratedTemplateNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_generated_template_not_found_exception::de_generated_template_not_found_exception_xml_err( + _response_body, + output, + ) + .map_err(crate::operation::describe_generated_template::DescribeGeneratedTemplateError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + _ => crate::operation::describe_generated_template::DescribeGeneratedTemplateError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_describe_generated_template_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::describe_generated_template::DescribeGeneratedTemplateOutput, + crate::operation::describe_generated_template::DescribeGeneratedTemplateError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateOutputBuilder::default(); + output = crate::protocol_serde::shape_describe_generated_template::de_describe_generated_template(_response_body, output) + .map_err(crate::operation::describe_generated_template::DescribeGeneratedTemplateError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +#[allow(unused_mut)] +pub fn de_describe_generated_template( + inp: &[u8], + mut builder: crate::operation::describe_generated_template::builders::DescribeGeneratedTemplateOutputBuilder, +) -> Result +{ + let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?; + + #[allow(unused_mut)] + let mut decoder = doc.root_element()?; + #[allow(unused_variables)] + let start_el = decoder.start_el(); + if !(start_el.matches("DescribeGeneratedTemplateResponse")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid root, expected DescribeGeneratedTemplateResponse got {:?}", + start_el + ))); + } + if let Some(mut result_tag) = decoder.next_tag() { + let start_el = result_tag.start_el(); + if !(start_el.matches("DescribeGeneratedTemplateResult")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid result, expected DescribeGeneratedTemplateResult got {:?}", + start_el + ))); + } + while let Some(mut tag) = result_tag.next_tag() { + match tag.start_el() { + s if s.matches("GeneratedTemplateId") /* GeneratedTemplateId com.amazonaws.cloudformation.synthetic#DescribeGeneratedTemplateOutput$GeneratedTemplateId */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_generated_template_id(var_1); + } + , + s if s.matches("GeneratedTemplateName") /* GeneratedTemplateName com.amazonaws.cloudformation.synthetic#DescribeGeneratedTemplateOutput$GeneratedTemplateName */ => { + let var_2 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_generated_template_name(var_2); + } + , + s if s.matches("Resources") /* Resources com.amazonaws.cloudformation.synthetic#DescribeGeneratedTemplateOutput$Resources */ => { + let var_3 = + Some( + crate::protocol_serde::shape_resource_details::de_resource_details(&mut tag) + ? + ) + ; + builder = builder.set_resources(var_3); + } + , + s if s.matches("Status") /* Status com.amazonaws.cloudformation.synthetic#DescribeGeneratedTemplateOutput$Status */ => { + let var_4 = + Some( + Result::::Ok( + crate::types::GeneratedTemplateStatus::from( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + ) + ? + ) + ; + builder = builder.set_status(var_4); + } + , + s if s.matches("StatusReason") /* StatusReason com.amazonaws.cloudformation.synthetic#DescribeGeneratedTemplateOutput$StatusReason */ => { + let var_5 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_status_reason(var_5); + } + , + s if s.matches("CreationTime") /* CreationTime com.amazonaws.cloudformation.synthetic#DescribeGeneratedTemplateOutput$CreationTime */ => { + let var_6 = + Some( + ::aws_smithy_types::DateTime::from_str( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + , ::aws_smithy_types::date_time::Format::DateTimeWithOffset + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudformation#CreationTime`)")) + ? + ) + ; + builder = builder.set_creation_time(var_6); + } + , + s if s.matches("LastUpdatedTime") /* LastUpdatedTime com.amazonaws.cloudformation.synthetic#DescribeGeneratedTemplateOutput$LastUpdatedTime */ => { + let var_7 = + Some( + ::aws_smithy_types::DateTime::from_str( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + , ::aws_smithy_types::date_time::Format::DateTimeWithOffset + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudformation#LastUpdatedTime`)")) + ? + ) + ; + builder = builder.set_last_updated_time(var_7); + } + , + s if s.matches("Progress") /* Progress com.amazonaws.cloudformation.synthetic#DescribeGeneratedTemplateOutput$Progress */ => { + let var_8 = + Some( + crate::protocol_serde::shape_template_progress::de_template_progress(&mut tag) + ? + ) + ; + builder = builder.set_progress(var_8); + } + , + s if s.matches("StackId") /* StackId com.amazonaws.cloudformation.synthetic#DescribeGeneratedTemplateOutput$StackId */ => { + let var_9 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_stack_id(var_9); + } + , + s if s.matches("TemplateConfiguration") /* TemplateConfiguration com.amazonaws.cloudformation.synthetic#DescribeGeneratedTemplateOutput$TemplateConfiguration */ => { + let var_10 = + Some( + crate::protocol_serde::shape_template_configuration::de_template_configuration(&mut tag) + ? + ) + ; + builder = builder.set_template_configuration(var_10); + } + , + s if s.matches("TotalWarnings") /* TotalWarnings com.amazonaws.cloudformation.synthetic#DescribeGeneratedTemplateOutput$TotalWarnings */ => { + let var_11 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudformation#TotalWarnings`)")) + } + ? + ) + ; + builder = builder.set_total_warnings(var_11); + } + , + _ => {} + } + } + } else { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom( + "expected DescribeGeneratedTemplateResult tag", + )); + }; + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_describe_generated_template_input.rs b/sdk/cloudformation/src/protocol_serde/shape_describe_generated_template_input.rs new file mode 100644 index 000000000000..f1699a2b7e46 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_describe_generated_template_input.rs @@ -0,0 +1,15 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_describe_generated_template_input_input_input( + input: &crate::operation::describe_generated_template::DescribeGeneratedTemplateInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + #[allow(unused_mut)] + let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "DescribeGeneratedTemplate", "2010-05-15"); + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("GeneratedTemplateName"); + if let Some(var_2) = &input.generated_template_name { + scope_1.string(var_2); + } + writer.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_describe_resource_scan.rs b/sdk/cloudformation/src/protocol_serde/shape_describe_resource_scan.rs new file mode 100644 index 000000000000..8cac64b384d5 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_describe_resource_scan.rs @@ -0,0 +1,223 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_describe_resource_scan_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::describe_resource_scan::DescribeResourceScanOutput, + crate::operation::describe_resource_scan::DescribeResourceScanError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::describe_resource_scan::DescribeResourceScanError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::describe_resource_scan::DescribeResourceScanError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceScanNotFound" => crate::operation::describe_resource_scan::DescribeResourceScanError::ResourceScanNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceScanNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_scan_not_found_exception::de_resource_scan_not_found_exception_xml_err( + _response_body, + output, + ) + .map_err(crate::operation::describe_resource_scan::DescribeResourceScanError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::describe_resource_scan::DescribeResourceScanError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_describe_resource_scan_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::describe_resource_scan::DescribeResourceScanOutput, + crate::operation::describe_resource_scan::DescribeResourceScanError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::describe_resource_scan::builders::DescribeResourceScanOutputBuilder::default(); + output = crate::protocol_serde::shape_describe_resource_scan::de_describe_resource_scan(_response_body, output) + .map_err(crate::operation::describe_resource_scan::DescribeResourceScanError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +#[allow(unused_mut)] +pub fn de_describe_resource_scan( + inp: &[u8], + mut builder: crate::operation::describe_resource_scan::builders::DescribeResourceScanOutputBuilder, +) -> Result { + let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?; + + #[allow(unused_mut)] + let mut decoder = doc.root_element()?; + #[allow(unused_variables)] + let start_el = decoder.start_el(); + if !(start_el.matches("DescribeResourceScanResponse")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid root, expected DescribeResourceScanResponse got {:?}", + start_el + ))); + } + if let Some(mut result_tag) = decoder.next_tag() { + let start_el = result_tag.start_el(); + if !(start_el.matches("DescribeResourceScanResult")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid result, expected DescribeResourceScanResult got {:?}", + start_el + ))); + } + while let Some(mut tag) = result_tag.next_tag() { + match tag.start_el() { + s if s.matches("ResourceScanId") /* ResourceScanId com.amazonaws.cloudformation.synthetic#DescribeResourceScanOutput$ResourceScanId */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_resource_scan_id(var_1); + } + , + s if s.matches("Status") /* Status com.amazonaws.cloudformation.synthetic#DescribeResourceScanOutput$Status */ => { + let var_2 = + Some( + Result::::Ok( + crate::types::ResourceScanStatus::from( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + ) + ? + ) + ; + builder = builder.set_status(var_2); + } + , + s if s.matches("StatusReason") /* StatusReason com.amazonaws.cloudformation.synthetic#DescribeResourceScanOutput$StatusReason */ => { + let var_3 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_status_reason(var_3); + } + , + s if s.matches("StartTime") /* StartTime com.amazonaws.cloudformation.synthetic#DescribeResourceScanOutput$StartTime */ => { + let var_4 = + Some( + ::aws_smithy_types::DateTime::from_str( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + , ::aws_smithy_types::date_time::Format::DateTimeWithOffset + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudformation#Timestamp`)")) + ? + ) + ; + builder = builder.set_start_time(var_4); + } + , + s if s.matches("EndTime") /* EndTime com.amazonaws.cloudformation.synthetic#DescribeResourceScanOutput$EndTime */ => { + let var_5 = + Some( + ::aws_smithy_types::DateTime::from_str( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + , ::aws_smithy_types::date_time::Format::DateTimeWithOffset + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudformation#Timestamp`)")) + ? + ) + ; + builder = builder.set_end_time(var_5); + } + , + s if s.matches("PercentageCompleted") /* PercentageCompleted com.amazonaws.cloudformation.synthetic#DescribeResourceScanOutput$PercentageCompleted */ => { + let var_6 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (double: `com.amazonaws.cloudformation#PercentageCompleted`)")) + } + ? + ) + ; + builder = builder.set_percentage_completed(var_6); + } + , + s if s.matches("ResourceTypes") /* ResourceTypes com.amazonaws.cloudformation.synthetic#DescribeResourceScanOutput$ResourceTypes */ => { + let var_7 = + Some( + crate::protocol_serde::shape_resource_types::de_resource_types(&mut tag) + ? + ) + ; + builder = builder.set_resource_types(var_7); + } + , + s if s.matches("ResourcesScanned") /* ResourcesScanned com.amazonaws.cloudformation.synthetic#DescribeResourceScanOutput$ResourcesScanned */ => { + let var_8 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudformation#ResourcesScanned`)")) + } + ? + ) + ; + builder = builder.set_resources_scanned(var_8); + } + , + s if s.matches("ResourcesRead") /* ResourcesRead com.amazonaws.cloudformation.synthetic#DescribeResourceScanOutput$ResourcesRead */ => { + let var_9 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudformation#ResourcesRead`)")) + } + ? + ) + ; + builder = builder.set_resources_read(var_9); + } + , + _ => {} + } + } + } else { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom( + "expected DescribeResourceScanResult tag", + )); + }; + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_describe_resource_scan_input.rs b/sdk/cloudformation/src/protocol_serde/shape_describe_resource_scan_input.rs new file mode 100644 index 000000000000..02391cf897ad --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_describe_resource_scan_input.rs @@ -0,0 +1,15 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_describe_resource_scan_input_input_input( + input: &crate::operation::describe_resource_scan::DescribeResourceScanInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + #[allow(unused_mut)] + let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "DescribeResourceScan", "2010-05-15"); + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("ResourceScanId"); + if let Some(var_2) = &input.resource_scan_id { + scope_1.string(var_2); + } + writer.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_generated_template_not_found_exception.rs b/sdk/cloudformation/src/protocol_serde/shape_generated_template_not_found_exception.rs new file mode 100644 index 000000000000..8b1c89d20835 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_generated_template_not_found_exception.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(unused_mut)] +pub fn de_generated_template_not_found_exception_xml_err( + inp: &[u8], + mut builder: crate::types::error::builders::GeneratedTemplateNotFoundExceptionBuilder, +) -> Result { + if inp.is_empty() { + return Ok(builder); + } + let mut document = ::aws_smithy_xml::decode::Document::try_from(inp)?; + #[allow(unused_mut)] + let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?; + while let Some(mut tag) = error_decoder.next_tag() { + match tag.start_el() { + s if s.matches("Message") /* Message com.amazonaws.cloudformation#GeneratedTemplateNotFoundException$Message */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_message(var_1); + } + , + _ => {} + } + } + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_get_generated_template.rs b/sdk/cloudformation/src/protocol_serde/shape_get_generated_template.rs new file mode 100644 index 000000000000..bb190438ed25 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_get_generated_template.rs @@ -0,0 +1,127 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_generated_template_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::get_generated_template::GetGeneratedTemplateOutput, + crate::operation::get_generated_template::GetGeneratedTemplateError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::get_generated_template::GetGeneratedTemplateError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::get_generated_template::GetGeneratedTemplateError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "GeneratedTemplateNotFound" => crate::operation::get_generated_template::GetGeneratedTemplateError::GeneratedTemplateNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::GeneratedTemplateNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_generated_template_not_found_exception::de_generated_template_not_found_exception_xml_err( + _response_body, + output, + ) + .map_err(crate::operation::get_generated_template::GetGeneratedTemplateError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::get_generated_template::GetGeneratedTemplateError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_generated_template_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::get_generated_template::GetGeneratedTemplateOutput, + crate::operation::get_generated_template::GetGeneratedTemplateError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::get_generated_template::builders::GetGeneratedTemplateOutputBuilder::default(); + output = crate::protocol_serde::shape_get_generated_template::de_get_generated_template(_response_body, output) + .map_err(crate::operation::get_generated_template::GetGeneratedTemplateError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +#[allow(unused_mut)] +pub fn de_get_generated_template( + inp: &[u8], + mut builder: crate::operation::get_generated_template::builders::GetGeneratedTemplateOutputBuilder, +) -> Result { + let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?; + + #[allow(unused_mut)] + let mut decoder = doc.root_element()?; + #[allow(unused_variables)] + let start_el = decoder.start_el(); + if !(start_el.matches("GetGeneratedTemplateResponse")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid root, expected GetGeneratedTemplateResponse got {:?}", + start_el + ))); + } + if let Some(mut result_tag) = decoder.next_tag() { + let start_el = result_tag.start_el(); + if !(start_el.matches("GetGeneratedTemplateResult")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid result, expected GetGeneratedTemplateResult got {:?}", + start_el + ))); + } + while let Some(mut tag) = result_tag.next_tag() { + match tag.start_el() { + s if s.matches("Status") /* Status com.amazonaws.cloudformation.synthetic#GetGeneratedTemplateOutput$Status */ => { + let var_1 = + Some( + Result::::Ok( + crate::types::GeneratedTemplateStatus::from( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + ) + ? + ) + ; + builder = builder.set_status(var_1); + } + , + s if s.matches("TemplateBody") /* TemplateBody com.amazonaws.cloudformation.synthetic#GetGeneratedTemplateOutput$TemplateBody */ => { + let var_2 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_template_body(var_2); + } + , + _ => {} + } + } + } else { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom( + "expected GetGeneratedTemplateResult tag", + )); + }; + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_get_generated_template_input.rs b/sdk/cloudformation/src/protocol_serde/shape_get_generated_template_input.rs new file mode 100644 index 000000000000..cb27b4b6e3b8 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_get_generated_template_input.rs @@ -0,0 +1,20 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_get_generated_template_input_input_input( + input: &crate::operation::get_generated_template::GetGeneratedTemplateInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + #[allow(unused_mut)] + let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "GetGeneratedTemplate", "2010-05-15"); + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("Format"); + if let Some(var_2) = &input.format { + scope_1.string(var_2.as_str()); + } + #[allow(unused_mut)] + let mut scope_3 = writer.prefix("GeneratedTemplateName"); + if let Some(var_4) = &input.generated_template_name { + scope_3.string(var_4); + } + writer.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_jazz_resource_identifier_properties.rs b/sdk/cloudformation/src/protocol_serde/shape_jazz_resource_identifier_properties.rs new file mode 100644 index 000000000000..5e24d1f9ee4f --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_jazz_resource_identifier_properties.rs @@ -0,0 +1,52 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn de_jazz_resource_identifier_properties( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result<::std::collections::HashMap<::std::string::String, ::std::string::String>, ::aws_smithy_xml::decode::XmlDecodeError> { + let mut out = ::std::collections::HashMap::new(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("entry") => { + crate::protocol_serde::shape_jazz_resource_identifier_properties::de_jazz_resource_identifier_properties_entry(&mut tag, &mut out)?; + } + _ => {} + } + } + Ok(out) +} + +pub fn de_jazz_resource_identifier_properties_entry( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, + out: &mut ::std::collections::HashMap<::std::string::String, ::std::string::String>, +) -> Result<(), ::aws_smithy_xml::decode::XmlDecodeError> { + let mut k: Option<::std::string::String> = None; + let mut v: Option<::std::string::String> = None; + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("key") /* key com.amazonaws.cloudformation#JazzResourceIdentifierProperties$key */ => { + k = Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + } + , + s if s.matches("value") /* value com.amazonaws.cloudformation#JazzResourceIdentifierProperties$value */ => { + v = Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + } + , + _ => {} + } + } + let k = k.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing key map entry"))?; + let v = v.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing value map entry"))?; + out.insert(k, v); + Ok(()) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_list_generated_templates.rs b/sdk/cloudformation/src/protocol_serde/shape_list_generated_templates.rs new file mode 100644 index 000000000000..5469dc0267b9 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_list_generated_templates.rs @@ -0,0 +1,97 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_generated_templates_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_generated_templates::ListGeneratedTemplatesOutput, + crate::operation::list_generated_templates::ListGeneratedTemplatesError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_generated_templates::ListGeneratedTemplatesError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + Err(crate::operation::list_generated_templates::ListGeneratedTemplatesError::generic(generic)) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_generated_templates_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_generated_templates::ListGeneratedTemplatesOutput, + crate::operation::list_generated_templates::ListGeneratedTemplatesError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_generated_templates::builders::ListGeneratedTemplatesOutputBuilder::default(); + output = crate::protocol_serde::shape_list_generated_templates::de_list_generated_templates(_response_body, output) + .map_err(crate::operation::list_generated_templates::ListGeneratedTemplatesError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +#[allow(unused_mut)] +pub fn de_list_generated_templates( + inp: &[u8], + mut builder: crate::operation::list_generated_templates::builders::ListGeneratedTemplatesOutputBuilder, +) -> Result { + let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?; + + #[allow(unused_mut)] + let mut decoder = doc.root_element()?; + #[allow(unused_variables)] + let start_el = decoder.start_el(); + if !(start_el.matches("ListGeneratedTemplatesResponse")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid root, expected ListGeneratedTemplatesResponse got {:?}", + start_el + ))); + } + if let Some(mut result_tag) = decoder.next_tag() { + let start_el = result_tag.start_el(); + if !(start_el.matches("ListGeneratedTemplatesResult")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid result, expected ListGeneratedTemplatesResult got {:?}", + start_el + ))); + } + while let Some(mut tag) = result_tag.next_tag() { + match tag.start_el() { + s if s.matches("Summaries") /* Summaries com.amazonaws.cloudformation.synthetic#ListGeneratedTemplatesOutput$Summaries */ => { + let var_1 = + Some( + crate::protocol_serde::shape_template_summaries::de_template_summaries(&mut tag) + ? + ) + ; + builder = builder.set_summaries(var_1); + } + , + s if s.matches("NextToken") /* NextToken com.amazonaws.cloudformation.synthetic#ListGeneratedTemplatesOutput$NextToken */ => { + let var_2 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_next_token(var_2); + } + , + _ => {} + } + } + } else { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom( + "expected ListGeneratedTemplatesResult tag", + )); + }; + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_list_generated_templates_input.rs b/sdk/cloudformation/src/protocol_serde/shape_list_generated_templates_input.rs new file mode 100644 index 000000000000..ae3f985be2ff --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_list_generated_templates_input.rs @@ -0,0 +1,23 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_list_generated_templates_input_input_input( + input: &crate::operation::list_generated_templates::ListGeneratedTemplatesInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + #[allow(unused_mut)] + let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "ListGeneratedTemplates", "2010-05-15"); + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("NextToken"); + if let Some(var_2) = &input.next_token { + scope_1.string(var_2); + } + #[allow(unused_mut)] + let mut scope_3 = writer.prefix("MaxResults"); + if let Some(var_4) = &input.max_results { + scope_3.number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_4).into()), + ); + } + writer.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_related_resources.rs b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_related_resources.rs new file mode 100644 index 000000000000..fdf8c5b6f055 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_related_resources.rs @@ -0,0 +1,148 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_resource_scan_related_resources_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput, + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceScanInProgress" => { + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError::ResourceScanInProgressException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceScanInProgressExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_scan_in_progress_exception::de_resource_scan_in_progress_exception_xml_err( + _response_body, + output, + ) + .map_err(crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "ResourceScanNotFound" => { + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError::ResourceScanNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceScanNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_scan_not_found_exception::de_resource_scan_not_found_exception_xml_err( + _response_body, + output, + ) + .map_err(crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + _ => crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_resource_scan_related_resources_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesOutput, + crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesOutputBuilder::default(); + output = crate::protocol_serde::shape_list_resource_scan_related_resources::de_list_resource_scan_related_resources(_response_body, output) + .map_err(crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +#[allow(unused_mut)] +pub fn de_list_resource_scan_related_resources( + inp: &[u8], + mut builder: crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesOutputBuilder, +) -> Result< + crate::operation::list_resource_scan_related_resources::builders::ListResourceScanRelatedResourcesOutputBuilder, + ::aws_smithy_xml::decode::XmlDecodeError, +> { + let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?; + + #[allow(unused_mut)] + let mut decoder = doc.root_element()?; + #[allow(unused_variables)] + let start_el = decoder.start_el(); + if !(start_el.matches("ListResourceScanRelatedResourcesResponse")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid root, expected ListResourceScanRelatedResourcesResponse got {:?}", + start_el + ))); + } + if let Some(mut result_tag) = decoder.next_tag() { + let start_el = result_tag.start_el(); + if !(start_el.matches("ListResourceScanRelatedResourcesResult")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid result, expected ListResourceScanRelatedResourcesResult got {:?}", + start_el + ))); + } + while let Some(mut tag) = result_tag.next_tag() { + match tag.start_el() { + s if s.matches("RelatedResources") /* RelatedResources com.amazonaws.cloudformation.synthetic#ListResourceScanRelatedResourcesOutput$RelatedResources */ => { + let var_1 = + Some( + crate::protocol_serde::shape_related_resources::de_related_resources(&mut tag) + ? + ) + ; + builder = builder.set_related_resources(var_1); + } + , + s if s.matches("NextToken") /* NextToken com.amazonaws.cloudformation.synthetic#ListResourceScanRelatedResourcesOutput$NextToken */ => { + let var_2 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_next_token(var_2); + } + , + _ => {} + } + } + } else { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom( + "expected ListResourceScanRelatedResourcesResult tag", + )); + }; + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_related_resources_input.rs b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_related_resources_input.rs new file mode 100644 index 000000000000..a8d3b12e6132 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_related_resources_input.rs @@ -0,0 +1,39 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_list_resource_scan_related_resources_input_input_input( + input: &crate::operation::list_resource_scan_related_resources::ListResourceScanRelatedResourcesInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + #[allow(unused_mut)] + let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "ListResourceScanRelatedResources", "2010-05-15"); + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("ResourceScanId"); + if let Some(var_2) = &input.resource_scan_id { + scope_1.string(var_2); + } + #[allow(unused_mut)] + let mut scope_3 = writer.prefix("Resources"); + if let Some(var_4) = &input.resources { + let mut list_6 = scope_3.start_list(false, None); + for item_5 in var_4 { + #[allow(unused_mut)] + let mut entry_7 = list_6.entry(); + crate::protocol_serde::shape_scanned_resource_identifier::ser_scanned_resource_identifier(entry_7, item_5)?; + } + list_6.finish(); + } + #[allow(unused_mut)] + let mut scope_8 = writer.prefix("NextToken"); + if let Some(var_9) = &input.next_token { + scope_8.string(var_9); + } + #[allow(unused_mut)] + let mut scope_10 = writer.prefix("MaxResults"); + if let Some(var_11) = &input.max_results { + scope_10.number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_11).into()), + ); + } + writer.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_resources.rs b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_resources.rs new file mode 100644 index 000000000000..35d4fe1362eb --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_resources.rs @@ -0,0 +1,148 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_resource_scan_resources_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput, + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_resource_scan_resources::ListResourceScanResourcesError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::list_resource_scan_resources::ListResourceScanResourcesError::unhandled( + generic, + )) + } + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceScanInProgress" => { + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError::ResourceScanInProgressException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceScanInProgressExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_scan_in_progress_exception::de_resource_scan_in_progress_exception_xml_err( + _response_body, + output, + ) + .map_err(crate::operation::list_resource_scan_resources::ListResourceScanResourcesError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "ResourceScanNotFound" => crate::operation::list_resource_scan_resources::ListResourceScanResourcesError::ResourceScanNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceScanNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_scan_not_found_exception::de_resource_scan_not_found_exception_xml_err( + _response_body, + output, + ) + .map_err(crate::operation::list_resource_scan_resources::ListResourceScanResourcesError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::list_resource_scan_resources::ListResourceScanResourcesError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_resource_scan_resources_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_resource_scan_resources::ListResourceScanResourcesOutput, + crate::operation::list_resource_scan_resources::ListResourceScanResourcesError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesOutputBuilder::default(); + output = crate::protocol_serde::shape_list_resource_scan_resources::de_list_resource_scan_resources(_response_body, output) + .map_err(crate::operation::list_resource_scan_resources::ListResourceScanResourcesError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +#[allow(unused_mut)] +pub fn de_list_resource_scan_resources( + inp: &[u8], + mut builder: crate::operation::list_resource_scan_resources::builders::ListResourceScanResourcesOutputBuilder, +) -> Result +{ + let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?; + + #[allow(unused_mut)] + let mut decoder = doc.root_element()?; + #[allow(unused_variables)] + let start_el = decoder.start_el(); + if !(start_el.matches("ListResourceScanResourcesResponse")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid root, expected ListResourceScanResourcesResponse got {:?}", + start_el + ))); + } + if let Some(mut result_tag) = decoder.next_tag() { + let start_el = result_tag.start_el(); + if !(start_el.matches("ListResourceScanResourcesResult")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid result, expected ListResourceScanResourcesResult got {:?}", + start_el + ))); + } + while let Some(mut tag) = result_tag.next_tag() { + match tag.start_el() { + s if s.matches("Resources") /* Resources com.amazonaws.cloudformation.synthetic#ListResourceScanResourcesOutput$Resources */ => { + let var_1 = + Some( + crate::protocol_serde::shape_scanned_resources::de_scanned_resources(&mut tag) + ? + ) + ; + builder = builder.set_resources(var_1); + } + , + s if s.matches("NextToken") /* NextToken com.amazonaws.cloudformation.synthetic#ListResourceScanResourcesOutput$NextToken */ => { + let var_2 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_next_token(var_2); + } + , + _ => {} + } + } + } else { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom( + "expected ListResourceScanResourcesResult tag", + )); + }; + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_resources_input.rs b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_resources_input.rs new file mode 100644 index 000000000000..63a6d5781393 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scan_resources_input.rs @@ -0,0 +1,48 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_list_resource_scan_resources_input_input_input( + input: &crate::operation::list_resource_scan_resources::ListResourceScanResourcesInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + #[allow(unused_mut)] + let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "ListResourceScanResources", "2010-05-15"); + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("ResourceScanId"); + if let Some(var_2) = &input.resource_scan_id { + scope_1.string(var_2); + } + #[allow(unused_mut)] + let mut scope_3 = writer.prefix("ResourceIdentifier"); + if let Some(var_4) = &input.resource_identifier { + scope_3.string(var_4); + } + #[allow(unused_mut)] + let mut scope_5 = writer.prefix("ResourceTypePrefix"); + if let Some(var_6) = &input.resource_type_prefix { + scope_5.string(var_6); + } + #[allow(unused_mut)] + let mut scope_7 = writer.prefix("TagKey"); + if let Some(var_8) = &input.tag_key { + scope_7.string(var_8); + } + #[allow(unused_mut)] + let mut scope_9 = writer.prefix("TagValue"); + if let Some(var_10) = &input.tag_value { + scope_9.string(var_10); + } + #[allow(unused_mut)] + let mut scope_11 = writer.prefix("NextToken"); + if let Some(var_12) = &input.next_token { + scope_11.string(var_12); + } + #[allow(unused_mut)] + let mut scope_13 = writer.prefix("MaxResults"); + if let Some(var_14) = &input.max_results { + scope_13.number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_14).into()), + ); + } + writer.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_list_resource_scans.rs b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scans.rs new file mode 100644 index 000000000000..4dcfed1ed260 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scans.rs @@ -0,0 +1,91 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_resource_scans_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result +{ + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_resource_scans::ListResourceScansError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + Err(crate::operation::list_resource_scans::ListResourceScansError::generic(generic)) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_resource_scans_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result +{ + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_resource_scans::builders::ListResourceScansOutputBuilder::default(); + output = crate::protocol_serde::shape_list_resource_scans::de_list_resource_scans(_response_body, output) + .map_err(crate::operation::list_resource_scans::ListResourceScansError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +#[allow(unused_mut)] +pub fn de_list_resource_scans( + inp: &[u8], + mut builder: crate::operation::list_resource_scans::builders::ListResourceScansOutputBuilder, +) -> Result { + let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?; + + #[allow(unused_mut)] + let mut decoder = doc.root_element()?; + #[allow(unused_variables)] + let start_el = decoder.start_el(); + if !(start_el.matches("ListResourceScansResponse")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid root, expected ListResourceScansResponse got {:?}", + start_el + ))); + } + if let Some(mut result_tag) = decoder.next_tag() { + let start_el = result_tag.start_el(); + if !(start_el.matches("ListResourceScansResult")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid result, expected ListResourceScansResult got {:?}", + start_el + ))); + } + while let Some(mut tag) = result_tag.next_tag() { + match tag.start_el() { + s if s.matches("ResourceScanSummaries") /* ResourceScanSummaries com.amazonaws.cloudformation.synthetic#ListResourceScansOutput$ResourceScanSummaries */ => { + let var_1 = + Some( + crate::protocol_serde::shape_resource_scan_summaries::de_resource_scan_summaries(&mut tag) + ? + ) + ; + builder = builder.set_resource_scan_summaries(var_1); + } + , + s if s.matches("NextToken") /* NextToken com.amazonaws.cloudformation.synthetic#ListResourceScansOutput$NextToken */ => { + let var_2 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_next_token(var_2); + } + , + _ => {} + } + } + } else { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("expected ListResourceScansResult tag")); + }; + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_list_resource_scans_input.rs b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scans_input.rs new file mode 100644 index 000000000000..420466772403 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_list_resource_scans_input.rs @@ -0,0 +1,23 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_list_resource_scans_input_input_input( + input: &crate::operation::list_resource_scans::ListResourceScansInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + #[allow(unused_mut)] + let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "ListResourceScans", "2010-05-15"); + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("NextToken"); + if let Some(var_2) = &input.next_token { + scope_1.string(var_2); + } + #[allow(unused_mut)] + let mut scope_3 = writer.prefix("MaxResults"); + if let Some(var_4) = &input.max_results { + scope_3.number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_4).into()), + ); + } + writer.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_related_resources.rs b/sdk/cloudformation/src/protocol_serde/shape_related_resources.rs new file mode 100644 index 000000000000..307bcc54f37a --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_related_resources.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn de_related_resources( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result<::std::vec::Vec, ::aws_smithy_xml::decode::XmlDecodeError> { + let mut out = std::vec::Vec::new(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("member") /* member com.amazonaws.cloudformation#RelatedResources$member */ => { + out.push( + crate::protocol_serde::shape_scanned_resource::de_scanned_resource(&mut tag) + ? + ); + } + , + _ => {} + } + } + Ok(out) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_resource_definition.rs b/sdk/cloudformation/src/protocol_serde/shape_resource_definition.rs new file mode 100644 index 000000000000..4c02aacab756 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_resource_definition.rs @@ -0,0 +1,31 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(unused_mut)] +pub fn ser_resource_definition( + mut writer: ::aws_smithy_query::QueryValueWriter, + input: &crate::types::ResourceDefinition, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("ResourceType"); + if let Some(var_2) = &input.resource_type { + scope_1.string(var_2); + } + #[allow(unused_mut)] + let mut scope_3 = writer.prefix("LogicalResourceId"); + if let Some(var_4) = &input.logical_resource_id { + scope_3.string(var_4); + } + #[allow(unused_mut)] + let mut scope_5 = writer.prefix("ResourceIdentifier"); + if let Some(var_6) = &input.resource_identifier { + let mut map_7 = scope_5.start_map(false, "key", "value"); + for (key_8, value_9) in var_6 { + #[allow(unused_mut)] + let mut entry_10 = map_7.entry(key_8); + { + entry_10.string(value_9); + } + } + map_7.finish(); + } + Ok(()) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_resource_detail.rs b/sdk/cloudformation/src/protocol_serde/shape_resource_detail.rs new file mode 100644 index 000000000000..ea1721f61e6c --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_resource_detail.rs @@ -0,0 +1,87 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::needless_question_mark)] +pub fn de_resource_detail( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result { + #[allow(unused_mut)] + let mut builder = crate::types::ResourceDetail::builder(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("ResourceType") /* ResourceType com.amazonaws.cloudformation#ResourceDetail$ResourceType */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_resource_type(var_1); + } + , + s if s.matches("LogicalResourceId") /* LogicalResourceId com.amazonaws.cloudformation#ResourceDetail$LogicalResourceId */ => { + let var_2 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_logical_resource_id(var_2); + } + , + s if s.matches("ResourceIdentifier") /* ResourceIdentifier com.amazonaws.cloudformation#ResourceDetail$ResourceIdentifier */ => { + let var_3 = + Some( + crate::protocol_serde::shape_resource_identifier_properties::de_resource_identifier_properties(&mut tag) + ? + ) + ; + builder = builder.set_resource_identifier(var_3); + } + , + s if s.matches("ResourceStatus") /* ResourceStatus com.amazonaws.cloudformation#ResourceDetail$ResourceStatus */ => { + let var_4 = + Some( + Result::::Ok( + crate::types::GeneratedTemplateResourceStatus::from( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + ) + ? + ) + ; + builder = builder.set_resource_status(var_4); + } + , + s if s.matches("ResourceStatusReason") /* ResourceStatusReason com.amazonaws.cloudformation#ResourceDetail$ResourceStatusReason */ => { + let var_5 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_resource_status_reason(var_5); + } + , + s if s.matches("Warnings") /* Warnings com.amazonaws.cloudformation#ResourceDetail$Warnings */ => { + let var_6 = + Some( + crate::protocol_serde::shape_warning_details::de_warning_details(&mut tag) + ? + ) + ; + builder = builder.set_warnings(var_6); + } + , + _ => {} + } + } + Ok(builder.build()) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_resource_details.rs b/sdk/cloudformation/src/protocol_serde/shape_resource_details.rs new file mode 100644 index 000000000000..f0f9491a2ccf --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_resource_details.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn de_resource_details( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result<::std::vec::Vec, ::aws_smithy_xml::decode::XmlDecodeError> { + let mut out = std::vec::Vec::new(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("member") /* member com.amazonaws.cloudformation#ResourceDetails$member */ => { + out.push( + crate::protocol_serde::shape_resource_detail::de_resource_detail(&mut tag) + ? + ); + } + , + _ => {} + } + } + Ok(out) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_resource_identifier_properties.rs b/sdk/cloudformation/src/protocol_serde/shape_resource_identifier_properties.rs new file mode 100644 index 000000000000..f867fac9ce8a --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_resource_identifier_properties.rs @@ -0,0 +1,52 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn de_resource_identifier_properties( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result<::std::collections::HashMap<::std::string::String, ::std::string::String>, ::aws_smithy_xml::decode::XmlDecodeError> { + let mut out = ::std::collections::HashMap::new(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("entry") => { + crate::protocol_serde::shape_resource_identifier_properties::de_resource_identifier_properties_entry(&mut tag, &mut out)?; + } + _ => {} + } + } + Ok(out) +} + +pub fn de_resource_identifier_properties_entry( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, + out: &mut ::std::collections::HashMap<::std::string::String, ::std::string::String>, +) -> Result<(), ::aws_smithy_xml::decode::XmlDecodeError> { + let mut k: Option<::std::string::String> = None; + let mut v: Option<::std::string::String> = None; + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("key") /* key com.amazonaws.cloudformation#ResourceIdentifierProperties$key */ => { + k = Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + } + , + s if s.matches("value") /* value com.amazonaws.cloudformation#ResourceIdentifierProperties$value */ => { + v = Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + } + , + _ => {} + } + } + let k = k.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing key map entry"))?; + let v = v.ok_or_else(|| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing value map entry"))?; + out.insert(k, v); + Ok(()) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_resource_scan_in_progress_exception.rs b/sdk/cloudformation/src/protocol_serde/shape_resource_scan_in_progress_exception.rs new file mode 100644 index 000000000000..86d134857af0 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_resource_scan_in_progress_exception.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(unused_mut)] +pub fn de_resource_scan_in_progress_exception_xml_err( + inp: &[u8], + mut builder: crate::types::error::builders::ResourceScanInProgressExceptionBuilder, +) -> Result { + if inp.is_empty() { + return Ok(builder); + } + let mut document = ::aws_smithy_xml::decode::Document::try_from(inp)?; + #[allow(unused_mut)] + let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?; + while let Some(mut tag) = error_decoder.next_tag() { + match tag.start_el() { + s if s.matches("Message") /* Message com.amazonaws.cloudformation#ResourceScanInProgressException$Message */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_message(var_1); + } + , + _ => {} + } + } + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_resource_scan_limit_exceeded_exception.rs b/sdk/cloudformation/src/protocol_serde/shape_resource_scan_limit_exceeded_exception.rs new file mode 100644 index 000000000000..2e6a94d5c514 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_resource_scan_limit_exceeded_exception.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(unused_mut)] +pub fn de_resource_scan_limit_exceeded_exception_xml_err( + inp: &[u8], + mut builder: crate::types::error::builders::ResourceScanLimitExceededExceptionBuilder, +) -> Result { + if inp.is_empty() { + return Ok(builder); + } + let mut document = ::aws_smithy_xml::decode::Document::try_from(inp)?; + #[allow(unused_mut)] + let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?; + while let Some(mut tag) = error_decoder.next_tag() { + match tag.start_el() { + s if s.matches("Message") /* Message com.amazonaws.cloudformation#ResourceScanLimitExceededException$Message */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_message(var_1); + } + , + _ => {} + } + } + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_resource_scan_not_found_exception.rs b/sdk/cloudformation/src/protocol_serde/shape_resource_scan_not_found_exception.rs new file mode 100644 index 000000000000..bb00de4cdbf1 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_resource_scan_not_found_exception.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(unused_mut)] +pub fn de_resource_scan_not_found_exception_xml_err( + inp: &[u8], + mut builder: crate::types::error::builders::ResourceScanNotFoundExceptionBuilder, +) -> Result { + if inp.is_empty() { + return Ok(builder); + } + let mut document = ::aws_smithy_xml::decode::Document::try_from(inp)?; + #[allow(unused_mut)] + let mut error_decoder = crate::rest_xml_wrapped_errors::error_scope(&mut document)?; + while let Some(mut tag) = error_decoder.next_tag() { + match tag.start_el() { + s if s.matches("Message") /* Message com.amazonaws.cloudformation#ResourceScanNotFoundException$Message */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_message(var_1); + } + , + _ => {} + } + } + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_resource_scan_summaries.rs b/sdk/cloudformation/src/protocol_serde/shape_resource_scan_summaries.rs new file mode 100644 index 000000000000..a9a0bd62035a --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_resource_scan_summaries.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn de_resource_scan_summaries( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result<::std::vec::Vec, ::aws_smithy_xml::decode::XmlDecodeError> { + let mut out = std::vec::Vec::new(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("member") /* member com.amazonaws.cloudformation#ResourceScanSummaries$member */ => { + out.push( + crate::protocol_serde::shape_resource_scan_summary::de_resource_scan_summary(&mut tag) + ? + ); + } + , + _ => {} + } + } + Ok(out) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_resource_scan_summary.rs b/sdk/cloudformation/src/protocol_serde/shape_resource_scan_summary.rs new file mode 100644 index 000000000000..b8b9ccfdaa76 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_resource_scan_summary.rs @@ -0,0 +1,97 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::needless_question_mark)] +pub fn de_resource_scan_summary( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result { + #[allow(unused_mut)] + let mut builder = crate::types::ResourceScanSummary::builder(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("ResourceScanId") /* ResourceScanId com.amazonaws.cloudformation#ResourceScanSummary$ResourceScanId */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_resource_scan_id(var_1); + } + , + s if s.matches("Status") /* Status com.amazonaws.cloudformation#ResourceScanSummary$Status */ => { + let var_2 = + Some( + Result::::Ok( + crate::types::ResourceScanStatus::from( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + ) + ? + ) + ; + builder = builder.set_status(var_2); + } + , + s if s.matches("StatusReason") /* StatusReason com.amazonaws.cloudformation#ResourceScanSummary$StatusReason */ => { + let var_3 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_status_reason(var_3); + } + , + s if s.matches("StartTime") /* StartTime com.amazonaws.cloudformation#ResourceScanSummary$StartTime */ => { + let var_4 = + Some( + ::aws_smithy_types::DateTime::from_str( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + , ::aws_smithy_types::date_time::Format::DateTimeWithOffset + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudformation#Timestamp`)")) + ? + ) + ; + builder = builder.set_start_time(var_4); + } + , + s if s.matches("EndTime") /* EndTime com.amazonaws.cloudformation#ResourceScanSummary$EndTime */ => { + let var_5 = + Some( + ::aws_smithy_types::DateTime::from_str( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + , ::aws_smithy_types::date_time::Format::DateTimeWithOffset + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudformation#Timestamp`)")) + ? + ) + ; + builder = builder.set_end_time(var_5); + } + , + s if s.matches("PercentageCompleted") /* PercentageCompleted com.amazonaws.cloudformation#ResourceScanSummary$PercentageCompleted */ => { + let var_6 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (double: `com.amazonaws.cloudformation#PercentageCompleted`)")) + } + ? + ) + ; + builder = builder.set_percentage_completed(var_6); + } + , + _ => {} + } + } + Ok(builder.build()) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_scanned_resource.rs b/sdk/cloudformation/src/protocol_serde/shape_scanned_resource.rs new file mode 100644 index 000000000000..f465441d91fb --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_scanned_resource.rs @@ -0,0 +1,52 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::needless_question_mark)] +pub fn de_scanned_resource( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result { + #[allow(unused_mut)] + let mut builder = crate::types::ScannedResource::builder(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("ResourceType") /* ResourceType com.amazonaws.cloudformation#ScannedResource$ResourceType */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_resource_type(var_1); + } + , + s if s.matches("ResourceIdentifier") /* ResourceIdentifier com.amazonaws.cloudformation#ScannedResource$ResourceIdentifier */ => { + let var_2 = + Some( + crate::protocol_serde::shape_jazz_resource_identifier_properties::de_jazz_resource_identifier_properties(&mut tag) + ? + ) + ; + builder = builder.set_resource_identifier(var_2); + } + , + s if s.matches("ManagedByStack") /* ManagedByStack com.amazonaws.cloudformation#ScannedResource$ManagedByStack */ => { + let var_3 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.cloudformation#ManagedByStack`)")) + } + ? + ) + ; + builder = builder.set_managed_by_stack(var_3); + } + , + _ => {} + } + } + Ok(builder.build()) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_scanned_resource_identifier.rs b/sdk/cloudformation/src/protocol_serde/shape_scanned_resource_identifier.rs new file mode 100644 index 000000000000..ec1b96c8a451 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_scanned_resource_identifier.rs @@ -0,0 +1,26 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(unused_mut)] +pub fn ser_scanned_resource_identifier( + mut writer: ::aws_smithy_query::QueryValueWriter, + input: &crate::types::ScannedResourceIdentifier, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("ResourceType"); + if let Some(var_2) = &input.resource_type { + scope_1.string(var_2); + } + #[allow(unused_mut)] + let mut scope_3 = writer.prefix("ResourceIdentifier"); + if let Some(var_4) = &input.resource_identifier { + let mut map_5 = scope_3.start_map(false, "key", "value"); + for (key_6, value_7) in var_4 { + #[allow(unused_mut)] + let mut entry_8 = map_5.entry(key_6); + { + entry_8.string(value_7); + } + } + map_5.finish(); + } + Ok(()) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_scanned_resources.rs b/sdk/cloudformation/src/protocol_serde/shape_scanned_resources.rs new file mode 100644 index 000000000000..aa4ef566dddd --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_scanned_resources.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn de_scanned_resources( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result<::std::vec::Vec, ::aws_smithy_xml::decode::XmlDecodeError> { + let mut out = std::vec::Vec::new(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("member") /* member com.amazonaws.cloudformation#ScannedResources$member */ => { + out.push( + crate::protocol_serde::shape_scanned_resource::de_scanned_resource(&mut tag) + ? + ); + } + , + _ => {} + } + } + Ok(out) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_start_resource_scan.rs b/sdk/cloudformation/src/protocol_serde/shape_start_resource_scan.rs new file mode 100644 index 000000000000..c040277e2ad0 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_start_resource_scan.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_start_resource_scan_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result +{ + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::start_resource_scan::StartResourceScanError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::start_resource_scan::StartResourceScanError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceScanInProgress" => crate::operation::start_resource_scan::StartResourceScanError::ResourceScanInProgressException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceScanInProgressExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_scan_in_progress_exception::de_resource_scan_in_progress_exception_xml_err( + _response_body, + output, + ) + .map_err(crate::operation::start_resource_scan::StartResourceScanError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceScanLimitExceeded" => crate::operation::start_resource_scan::StartResourceScanError::ResourceScanLimitExceededException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceScanLimitExceededExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_scan_limit_exceeded_exception::de_resource_scan_limit_exceeded_exception_xml_err( + _response_body, + output, + ) + .map_err(crate::operation::start_resource_scan::StartResourceScanError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::start_resource_scan::StartResourceScanError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_start_resource_scan_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result +{ + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::start_resource_scan::builders::StartResourceScanOutputBuilder::default(); + output = crate::protocol_serde::shape_start_resource_scan::de_start_resource_scan(_response_body, output) + .map_err(crate::operation::start_resource_scan::StartResourceScanError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +#[allow(unused_mut)] +pub fn de_start_resource_scan( + inp: &[u8], + mut builder: crate::operation::start_resource_scan::builders::StartResourceScanOutputBuilder, +) -> Result { + let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?; + + #[allow(unused_mut)] + let mut decoder = doc.root_element()?; + #[allow(unused_variables)] + let start_el = decoder.start_el(); + if !(start_el.matches("StartResourceScanResponse")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid root, expected StartResourceScanResponse got {:?}", + start_el + ))); + } + if let Some(mut result_tag) = decoder.next_tag() { + let start_el = result_tag.start_el(); + if !(start_el.matches("StartResourceScanResult")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid result, expected StartResourceScanResult got {:?}", + start_el + ))); + } + while let Some(mut tag) = result_tag.next_tag() { + match tag.start_el() { + s if s.matches("ResourceScanId") /* ResourceScanId com.amazonaws.cloudformation.synthetic#StartResourceScanOutput$ResourceScanId */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_resource_scan_id(var_1); + } + , + _ => {} + } + } + } else { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("expected StartResourceScanResult tag")); + }; + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_start_resource_scan_input.rs b/sdk/cloudformation/src/protocol_serde/shape_start_resource_scan_input.rs new file mode 100644 index 000000000000..adb8a22df990 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_start_resource_scan_input.rs @@ -0,0 +1,15 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_start_resource_scan_input_input_input( + input: &crate::operation::start_resource_scan::StartResourceScanInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + #[allow(unused_mut)] + let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "StartResourceScan", "2010-05-15"); + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("ClientRequestToken"); + if let Some(var_2) = &input.client_request_token { + scope_1.string(var_2); + } + writer.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_template_configuration.rs b/sdk/cloudformation/src/protocol_serde/shape_template_configuration.rs new file mode 100644 index 000000000000..21f12eefd369 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_template_configuration.rs @@ -0,0 +1,60 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(unused_mut)] +pub fn ser_template_configuration( + mut writer: ::aws_smithy_query::QueryValueWriter, + input: &crate::types::TemplateConfiguration, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("DeletionPolicy"); + if let Some(var_2) = &input.deletion_policy { + scope_1.string(var_2.as_str()); + } + #[allow(unused_mut)] + let mut scope_3 = writer.prefix("UpdateReplacePolicy"); + if let Some(var_4) = &input.update_replace_policy { + scope_3.string(var_4.as_str()); + } + Ok(()) +} + +#[allow(clippy::needless_question_mark)] +pub fn de_template_configuration( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result { + #[allow(unused_mut)] + let mut builder = crate::types::TemplateConfiguration::builder(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("DeletionPolicy") /* DeletionPolicy com.amazonaws.cloudformation#TemplateConfiguration$DeletionPolicy */ => { + let var_5 = + Some( + Result::::Ok( + crate::types::GeneratedTemplateDeletionPolicy::from( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + ) + ? + ) + ; + builder = builder.set_deletion_policy(var_5); + } + , + s if s.matches("UpdateReplacePolicy") /* UpdateReplacePolicy com.amazonaws.cloudformation#TemplateConfiguration$UpdateReplacePolicy */ => { + let var_6 = + Some( + Result::::Ok( + crate::types::GeneratedTemplateUpdateReplacePolicy::from( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + ) + ? + ) + ; + builder = builder.set_update_replace_policy(var_6); + } + , + _ => {} + } + } + Ok(builder.build()) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_template_progress.rs b/sdk/cloudformation/src/protocol_serde/shape_template_progress.rs new file mode 100644 index 000000000000..dca06fced0ad --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_template_progress.rs @@ -0,0 +1,74 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::needless_question_mark)] +pub fn de_template_progress( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result { + #[allow(unused_mut)] + let mut builder = crate::types::TemplateProgress::builder(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("ResourcesSucceeded") /* ResourcesSucceeded com.amazonaws.cloudformation#TemplateProgress$ResourcesSucceeded */ => { + let var_1 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudformation#ResourcesSucceeded`)")) + } + ? + ) + ; + builder = builder.set_resources_succeeded(var_1); + } + , + s if s.matches("ResourcesFailed") /* ResourcesFailed com.amazonaws.cloudformation#TemplateProgress$ResourcesFailed */ => { + let var_2 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudformation#ResourcesFailed`)")) + } + ? + ) + ; + builder = builder.set_resources_failed(var_2); + } + , + s if s.matches("ResourcesProcessing") /* ResourcesProcessing com.amazonaws.cloudformation#TemplateProgress$ResourcesProcessing */ => { + let var_3 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudformation#ResourcesProcessing`)")) + } + ? + ) + ; + builder = builder.set_resources_processing(var_3); + } + , + s if s.matches("ResourcesPending") /* ResourcesPending com.amazonaws.cloudformation#TemplateProgress$ResourcesPending */ => { + let var_4 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudformation#ResourcesPending`)")) + } + ? + ) + ; + builder = builder.set_resources_pending(var_4); + } + , + _ => {} + } + } + Ok(builder.build()) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_template_summaries.rs b/sdk/cloudformation/src/protocol_serde/shape_template_summaries.rs new file mode 100644 index 000000000000..a7c7870d19ae --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_template_summaries.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn de_template_summaries( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result<::std::vec::Vec, ::aws_smithy_xml::decode::XmlDecodeError> { + let mut out = std::vec::Vec::new(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("member") /* member com.amazonaws.cloudformation#TemplateSummaries$member */ => { + out.push( + crate::protocol_serde::shape_template_summary::de_template_summary(&mut tag) + ? + ); + } + , + _ => {} + } + } + Ok(out) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_template_summary.rs b/sdk/cloudformation/src/protocol_serde/shape_template_summary.rs new file mode 100644 index 000000000000..c6946c72ece6 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_template_summary.rs @@ -0,0 +1,110 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::needless_question_mark)] +pub fn de_template_summary( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result { + #[allow(unused_mut)] + let mut builder = crate::types::TemplateSummary::builder(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("GeneratedTemplateId") /* GeneratedTemplateId com.amazonaws.cloudformation#TemplateSummary$GeneratedTemplateId */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_generated_template_id(var_1); + } + , + s if s.matches("GeneratedTemplateName") /* GeneratedTemplateName com.amazonaws.cloudformation#TemplateSummary$GeneratedTemplateName */ => { + let var_2 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_generated_template_name(var_2); + } + , + s if s.matches("Status") /* Status com.amazonaws.cloudformation#TemplateSummary$Status */ => { + let var_3 = + Some( + Result::::Ok( + crate::types::GeneratedTemplateStatus::from( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + ) + ? + ) + ; + builder = builder.set_status(var_3); + } + , + s if s.matches("StatusReason") /* StatusReason com.amazonaws.cloudformation#TemplateSummary$StatusReason */ => { + let var_4 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_status_reason(var_4); + } + , + s if s.matches("CreationTime") /* CreationTime com.amazonaws.cloudformation#TemplateSummary$CreationTime */ => { + let var_5 = + Some( + ::aws_smithy_types::DateTime::from_str( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + , ::aws_smithy_types::date_time::Format::DateTimeWithOffset + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudformation#CreationTime`)")) + ? + ) + ; + builder = builder.set_creation_time(var_5); + } + , + s if s.matches("LastUpdatedTime") /* LastUpdatedTime com.amazonaws.cloudformation#TemplateSummary$LastUpdatedTime */ => { + let var_6 = + Some( + ::aws_smithy_types::DateTime::from_str( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + , ::aws_smithy_types::date_time::Format::DateTimeWithOffset + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudformation#LastUpdatedTime`)")) + ? + ) + ; + builder = builder.set_last_updated_time(var_6); + } + , + s if s.matches("NumberOfResources") /* NumberOfResources com.amazonaws.cloudformation#TemplateSummary$NumberOfResources */ => { + let var_7 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudformation#NumberOfResources`)")) + } + ? + ) + ; + builder = builder.set_number_of_resources(var_7); + } + , + _ => {} + } + } + Ok(builder.build()) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_update_generated_template.rs b/sdk/cloudformation/src/protocol_serde/shape_update_generated_template.rs new file mode 100644 index 000000000000..30db3c70fd2d --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_update_generated_template.rs @@ -0,0 +1,149 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_generated_template_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::update_generated_template::UpdateGeneratedTemplateOutput, + crate::operation::update_generated_template::UpdateGeneratedTemplateError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::update_generated_template::UpdateGeneratedTemplateError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::update_generated_template::UpdateGeneratedTemplateError::unhandled( + generic, + )) + } + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AlreadyExistsException" => crate::operation::update_generated_template::UpdateGeneratedTemplateError::AlreadyExistsException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AlreadyExistsExceptionBuilder::default(); + output = crate::protocol_serde::shape_already_exists_exception::de_already_exists_exception_xml_err(_response_body, output) + .map_err(crate::operation::update_generated_template::UpdateGeneratedTemplateError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "GeneratedTemplateNotFound" => { + crate::operation::update_generated_template::UpdateGeneratedTemplateError::GeneratedTemplateNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::GeneratedTemplateNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_generated_template_not_found_exception::de_generated_template_not_found_exception_xml_err( + _response_body, + output, + ) + .map_err(crate::operation::update_generated_template::UpdateGeneratedTemplateError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "LimitExceededException" => crate::operation::update_generated_template::UpdateGeneratedTemplateError::LimitExceededException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default(); + output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_xml_err(_response_body, output) + .map_err(crate::operation::update_generated_template::UpdateGeneratedTemplateError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::update_generated_template::UpdateGeneratedTemplateError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_generated_template_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::update_generated_template::UpdateGeneratedTemplateOutput, + crate::operation::update_generated_template::UpdateGeneratedTemplateError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::update_generated_template::builders::UpdateGeneratedTemplateOutputBuilder::default(); + output = crate::protocol_serde::shape_update_generated_template::de_update_generated_template(_response_body, output) + .map_err(crate::operation::update_generated_template::UpdateGeneratedTemplateError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +#[allow(unused_mut)] +pub fn de_update_generated_template( + inp: &[u8], + mut builder: crate::operation::update_generated_template::builders::UpdateGeneratedTemplateOutputBuilder, +) -> Result { + let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?; + + #[allow(unused_mut)] + let mut decoder = doc.root_element()?; + #[allow(unused_variables)] + let start_el = decoder.start_el(); + if !(start_el.matches("UpdateGeneratedTemplateResponse")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid root, expected UpdateGeneratedTemplateResponse got {:?}", + start_el + ))); + } + if let Some(mut result_tag) = decoder.next_tag() { + let start_el = result_tag.start_el(); + if !(start_el.matches("UpdateGeneratedTemplateResult")) { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!( + "invalid result, expected UpdateGeneratedTemplateResult got {:?}", + start_el + ))); + } + while let Some(mut tag) = result_tag.next_tag() { + match tag.start_el() { + s if s.matches("GeneratedTemplateId") /* GeneratedTemplateId com.amazonaws.cloudformation.synthetic#UpdateGeneratedTemplateOutput$GeneratedTemplateId */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_generated_template_id(var_1); + } + , + _ => {} + } + } + } else { + return Err(::aws_smithy_xml::decode::XmlDecodeError::custom( + "expected UpdateGeneratedTemplateResult tag", + )); + }; + Ok(builder) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_update_generated_template_input.rs b/sdk/cloudformation/src/protocol_serde/shape_update_generated_template_input.rs new file mode 100644 index 000000000000..5370e3fb219c --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_update_generated_template_input.rs @@ -0,0 +1,52 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_update_generated_template_input_input_input( + input: &crate::operation::update_generated_template::UpdateGeneratedTemplateInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + #[allow(unused_mut)] + let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "UpdateGeneratedTemplate", "2010-05-15"); + #[allow(unused_mut)] + let mut scope_1 = writer.prefix("GeneratedTemplateName"); + if let Some(var_2) = &input.generated_template_name { + scope_1.string(var_2); + } + #[allow(unused_mut)] + let mut scope_3 = writer.prefix("NewGeneratedTemplateName"); + if let Some(var_4) = &input.new_generated_template_name { + scope_3.string(var_4); + } + #[allow(unused_mut)] + let mut scope_5 = writer.prefix("AddResources"); + if let Some(var_6) = &input.add_resources { + let mut list_8 = scope_5.start_list(false, None); + for item_7 in var_6 { + #[allow(unused_mut)] + let mut entry_9 = list_8.entry(); + crate::protocol_serde::shape_resource_definition::ser_resource_definition(entry_9, item_7)?; + } + list_8.finish(); + } + #[allow(unused_mut)] + let mut scope_10 = writer.prefix("RemoveResources"); + if let Some(var_11) = &input.remove_resources { + let mut list_13 = scope_10.start_list(false, None); + for item_12 in var_11 { + #[allow(unused_mut)] + let mut entry_14 = list_13.entry(); + entry_14.string(item_12); + } + list_13.finish(); + } + #[allow(unused_mut)] + let mut scope_15 = writer.prefix("RefreshAllResources"); + if let Some(var_16) = &input.refresh_all_resources { + scope_15.boolean(*var_16); + } + #[allow(unused_mut)] + let mut scope_17 = writer.prefix("TemplateConfiguration"); + if let Some(var_18) = &input.template_configuration { + crate::protocol_serde::shape_template_configuration::ser_template_configuration(scope_17, var_18)?; + } + writer.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_warning_detail.rs b/sdk/cloudformation/src/protocol_serde/shape_warning_detail.rs new file mode 100644 index 000000000000..3435dd21bedc --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_warning_detail.rs @@ -0,0 +1,38 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::needless_question_mark)] +pub fn de_warning_detail( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result { + #[allow(unused_mut)] + let mut builder = crate::types::WarningDetail::builder(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("Type") /* Type com.amazonaws.cloudformation#WarningDetail$Type */ => { + let var_1 = + Some( + Result::::Ok( + crate::types::WarningType::from( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + ) + ? + ) + ; + builder = builder.set_type(var_1); + } + , + s if s.matches("Properties") /* Properties com.amazonaws.cloudformation#WarningDetail$Properties */ => { + let var_2 = + Some( + crate::protocol_serde::shape_warning_properties::de_warning_properties(&mut tag) + ? + ) + ; + builder = builder.set_properties(var_2); + } + , + _ => {} + } + } + Ok(builder.build()) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_warning_details.rs b/sdk/cloudformation/src/protocol_serde/shape_warning_details.rs new file mode 100644 index 000000000000..09c9cf99a1ba --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_warning_details.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn de_warning_details( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result<::std::vec::Vec, ::aws_smithy_xml::decode::XmlDecodeError> { + let mut out = std::vec::Vec::new(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("member") /* member com.amazonaws.cloudformation#WarningDetails$member */ => { + out.push( + crate::protocol_serde::shape_warning_detail::de_warning_detail(&mut tag) + ? + ); + } + , + _ => {} + } + } + Ok(out) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_warning_properties.rs b/sdk/cloudformation/src/protocol_serde/shape_warning_properties.rs new file mode 100644 index 000000000000..4ff6c95946bc --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_warning_properties.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn de_warning_properties( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result<::std::vec::Vec, ::aws_smithy_xml::decode::XmlDecodeError> { + let mut out = std::vec::Vec::new(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("member") /* member com.amazonaws.cloudformation#WarningProperties$member */ => { + out.push( + crate::protocol_serde::shape_warning_property::de_warning_property(&mut tag) + ? + ); + } + , + _ => {} + } + } + Ok(out) +} diff --git a/sdk/cloudformation/src/protocol_serde/shape_warning_property.rs b/sdk/cloudformation/src/protocol_serde/shape_warning_property.rs new file mode 100644 index 000000000000..7328e30864f1 --- /dev/null +++ b/sdk/cloudformation/src/protocol_serde/shape_warning_property.rs @@ -0,0 +1,55 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::needless_question_mark)] +pub fn de_warning_property( + decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder, +) -> Result { + #[allow(unused_mut)] + let mut builder = crate::types::WarningProperty::builder(); + while let Some(mut tag) = decoder.next_tag() { + match tag.start_el() { + s if s.matches("PropertyPath") /* PropertyPath com.amazonaws.cloudformation#WarningProperty$PropertyPath */ => { + let var_1 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_property_path(var_1); + } + , + s if s.matches("Required") /* Required com.amazonaws.cloudformation#WarningProperty$Required */ => { + let var_2 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.cloudformation#RequiredProperty`)")) + } + ? + ) + ; + builder = builder.set_required(var_2); + } + , + s if s.matches("Description") /* Description com.amazonaws.cloudformation#WarningProperty$Description */ => { + let var_3 = + Some( + Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + .into() + ) + ? + ) + ; + builder = builder.set_description(var_3); + } + , + _ => {} + } + } + Ok(builder.build()) +} diff --git a/sdk/cloudformation/src/types.rs b/sdk/cloudformation/src/types.rs index 30a1276218d9..ce17b691698b 100644 --- a/sdk/cloudformation/src/types.rs +++ b/sdk/cloudformation/src/types.rs @@ -29,6 +29,14 @@ pub use crate::types::_rollback_configuration::RollbackConfiguration; pub use crate::types::_rollback_trigger::RollbackTrigger; +pub use crate::types::_template_configuration::TemplateConfiguration; + +pub use crate::types::_generated_template_update_replace_policy::GeneratedTemplateUpdateReplacePolicy; + +pub use crate::types::_generated_template_deletion_policy::GeneratedTemplateDeletionPolicy; + +pub use crate::types::_resource_definition::ResourceDefinition; + pub use crate::types::_third_party_type::ThirdPartyType; pub use crate::types::_resource_signal_status::ResourceSignalStatus; @@ -121,6 +129,18 @@ pub use crate::types::_difference_type::DifferenceType; pub use crate::types::_physical_resource_id_context_key_value_pair::PhysicalResourceIdContextKeyValuePair; +pub use crate::types::_resource_scan_summary::ResourceScanSummary; + +pub use crate::types::_resource_scan_status::ResourceScanStatus; + +pub use crate::types::_scanned_resource::ScannedResource; + +pub use crate::types::_scanned_resource_identifier::ScannedResourceIdentifier; + +pub use crate::types::_template_summary::TemplateSummary; + +pub use crate::types::_generated_template_status::GeneratedTemplateStatus; + pub use crate::types::_export::Export; pub use crate::types::_change_set_summary::ChangeSetSummary; @@ -141,6 +161,8 @@ pub use crate::types::_template_summary_config::TemplateSummaryConfig; pub use crate::types::_template_stage::TemplateStage; +pub use crate::types::_template_format::TemplateFormat; + pub use crate::types::_stack_resource_drift::StackResourceDrift; pub use crate::types::_required_activated_type::RequiredActivatedType; @@ -185,6 +207,18 @@ pub use crate::types::_publisher_status::PublisherStatus; pub use crate::types::_organization_status::OrganizationStatus; +pub use crate::types::_template_progress::TemplateProgress; + +pub use crate::types::_resource_detail::ResourceDetail; + +pub use crate::types::_warning_detail::WarningDetail; + +pub use crate::types::_warning_property::WarningProperty; + +pub use crate::types::_warning_type::WarningType; + +pub use crate::types::_generated_template_resource_status::GeneratedTemplateResourceStatus; + pub use crate::types::_change_set_hooks_status::ChangeSetHooksStatus; pub use crate::types::_change_set_hook::ChangeSetHook; @@ -289,6 +323,14 @@ mod _execution_status; mod _export; +mod _generated_template_deletion_policy; + +mod _generated_template_resource_status; + +mod _generated_template_status; + +mod _generated_template_update_replace_policy; + mod _handler_error_code; mod _hook_failure_mode; @@ -355,8 +397,16 @@ mod _resource_change; mod _resource_change_detail; +mod _resource_definition; + +mod _resource_detail; + mod _resource_identifier_summary; +mod _resource_scan_status; + +mod _resource_scan_summary; + mod _resource_signal_status; mod _resource_status; @@ -369,6 +419,10 @@ mod _rollback_configuration; mod _rollback_trigger; +mod _scanned_resource; + +mod _scanned_resource_identifier; + mod _stack; mod _stack_drift_detection_status; @@ -445,10 +499,18 @@ mod _stack_summary; mod _tag; +mod _template_configuration; + +mod _template_format; + mod _template_parameter; +mod _template_progress; + mod _template_stage; +mod _template_summary; + mod _template_summary_config; mod _third_party_type; @@ -469,6 +531,12 @@ mod _version_bump; mod _visibility; +mod _warning_detail; + +mod _warning_property; + +mod _warning_type; + mod _warnings; /// Builders diff --git a/sdk/cloudformation/src/types/_generated_template_deletion_policy.rs b/sdk/cloudformation/src/types/_generated_template_deletion_policy.rs new file mode 100644 index 000000000000..c4b2f4ebb977 --- /dev/null +++ b/sdk/cloudformation/src/types/_generated_template_deletion_policy.rs @@ -0,0 +1,98 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `GeneratedTemplateDeletionPolicy`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let generatedtemplatedeletionpolicy = unimplemented!(); +/// match generatedtemplatedeletionpolicy { +/// GeneratedTemplateDeletionPolicy::Delete => { /* ... */ }, +/// GeneratedTemplateDeletionPolicy::Retain => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `generatedtemplatedeletionpolicy` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `GeneratedTemplateDeletionPolicy::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `GeneratedTemplateDeletionPolicy::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `GeneratedTemplateDeletionPolicy::NewFeature` is defined. +/// Specifically, when `generatedtemplatedeletionpolicy` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `GeneratedTemplateDeletionPolicy::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum GeneratedTemplateDeletionPolicy { + #[allow(missing_docs)] // documentation missing in model + Delete, + #[allow(missing_docs)] // documentation missing in model + Retain, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for GeneratedTemplateDeletionPolicy { + fn from(s: &str) -> Self { + match s { + "DELETE" => GeneratedTemplateDeletionPolicy::Delete, + "RETAIN" => GeneratedTemplateDeletionPolicy::Retain, + other => GeneratedTemplateDeletionPolicy::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for GeneratedTemplateDeletionPolicy { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(GeneratedTemplateDeletionPolicy::from(s)) + } +} +impl GeneratedTemplateDeletionPolicy { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + GeneratedTemplateDeletionPolicy::Delete => "DELETE", + GeneratedTemplateDeletionPolicy::Retain => "RETAIN", + GeneratedTemplateDeletionPolicy::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["DELETE", "RETAIN"] + } +} +impl ::std::convert::AsRef for GeneratedTemplateDeletionPolicy { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl GeneratedTemplateDeletionPolicy { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} diff --git a/sdk/cloudformation/src/types/_generated_template_resource_status.rs b/sdk/cloudformation/src/types/_generated_template_resource_status.rs new file mode 100644 index 000000000000..8276ce6d5f37 --- /dev/null +++ b/sdk/cloudformation/src/types/_generated_template_resource_status.rs @@ -0,0 +1,108 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `GeneratedTemplateResourceStatus`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let generatedtemplateresourcestatus = unimplemented!(); +/// match generatedtemplateresourcestatus { +/// GeneratedTemplateResourceStatus::Complete => { /* ... */ }, +/// GeneratedTemplateResourceStatus::Failed => { /* ... */ }, +/// GeneratedTemplateResourceStatus::InProgress => { /* ... */ }, +/// GeneratedTemplateResourceStatus::Pending => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `generatedtemplateresourcestatus` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `GeneratedTemplateResourceStatus::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `GeneratedTemplateResourceStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `GeneratedTemplateResourceStatus::NewFeature` is defined. +/// Specifically, when `generatedtemplateresourcestatus` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `GeneratedTemplateResourceStatus::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum GeneratedTemplateResourceStatus { + #[allow(missing_docs)] // documentation missing in model + Complete, + #[allow(missing_docs)] // documentation missing in model + Failed, + #[allow(missing_docs)] // documentation missing in model + InProgress, + #[allow(missing_docs)] // documentation missing in model + Pending, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for GeneratedTemplateResourceStatus { + fn from(s: &str) -> Self { + match s { + "COMPLETE" => GeneratedTemplateResourceStatus::Complete, + "FAILED" => GeneratedTemplateResourceStatus::Failed, + "IN_PROGRESS" => GeneratedTemplateResourceStatus::InProgress, + "PENDING" => GeneratedTemplateResourceStatus::Pending, + other => GeneratedTemplateResourceStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for GeneratedTemplateResourceStatus { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(GeneratedTemplateResourceStatus::from(s)) + } +} +impl GeneratedTemplateResourceStatus { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + GeneratedTemplateResourceStatus::Complete => "COMPLETE", + GeneratedTemplateResourceStatus::Failed => "FAILED", + GeneratedTemplateResourceStatus::InProgress => "IN_PROGRESS", + GeneratedTemplateResourceStatus::Pending => "PENDING", + GeneratedTemplateResourceStatus::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["COMPLETE", "FAILED", "IN_PROGRESS", "PENDING"] + } +} +impl ::std::convert::AsRef for GeneratedTemplateResourceStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl GeneratedTemplateResourceStatus { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} diff --git a/sdk/cloudformation/src/types/_generated_template_status.rs b/sdk/cloudformation/src/types/_generated_template_status.rs new file mode 100644 index 000000000000..4d75b1c8b739 --- /dev/null +++ b/sdk/cloudformation/src/types/_generated_template_status.rs @@ -0,0 +1,137 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `GeneratedTemplateStatus`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let generatedtemplatestatus = unimplemented!(); +/// match generatedtemplatestatus { +/// GeneratedTemplateStatus::Complete => { /* ... */ }, +/// GeneratedTemplateStatus::CreateInProgress => { /* ... */ }, +/// GeneratedTemplateStatus::CreatePending => { /* ... */ }, +/// GeneratedTemplateStatus::DeleteInProgress => { /* ... */ }, +/// GeneratedTemplateStatus::DeletePending => { /* ... */ }, +/// GeneratedTemplateStatus::Failed => { /* ... */ }, +/// GeneratedTemplateStatus::UpdateInProgress => { /* ... */ }, +/// GeneratedTemplateStatus::UpdatePending => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `generatedtemplatestatus` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `GeneratedTemplateStatus::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `GeneratedTemplateStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `GeneratedTemplateStatus::NewFeature` is defined. +/// Specifically, when `generatedtemplatestatus` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `GeneratedTemplateStatus::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum GeneratedTemplateStatus { + #[allow(missing_docs)] // documentation missing in model + Complete, + #[allow(missing_docs)] // documentation missing in model + CreateInProgress, + #[allow(missing_docs)] // documentation missing in model + CreatePending, + #[allow(missing_docs)] // documentation missing in model + DeleteInProgress, + #[allow(missing_docs)] // documentation missing in model + DeletePending, + #[allow(missing_docs)] // documentation missing in model + Failed, + #[allow(missing_docs)] // documentation missing in model + UpdateInProgress, + #[allow(missing_docs)] // documentation missing in model + UpdatePending, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for GeneratedTemplateStatus { + fn from(s: &str) -> Self { + match s { + "COMPLETE" => GeneratedTemplateStatus::Complete, + "CREATE_IN_PROGRESS" => GeneratedTemplateStatus::CreateInProgress, + "CREATE_PENDING" => GeneratedTemplateStatus::CreatePending, + "DELETE_IN_PROGRESS" => GeneratedTemplateStatus::DeleteInProgress, + "DELETE_PENDING" => GeneratedTemplateStatus::DeletePending, + "FAILED" => GeneratedTemplateStatus::Failed, + "UPDATE_IN_PROGRESS" => GeneratedTemplateStatus::UpdateInProgress, + "UPDATE_PENDING" => GeneratedTemplateStatus::UpdatePending, + other => GeneratedTemplateStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for GeneratedTemplateStatus { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(GeneratedTemplateStatus::from(s)) + } +} +impl GeneratedTemplateStatus { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + GeneratedTemplateStatus::Complete => "COMPLETE", + GeneratedTemplateStatus::CreateInProgress => "CREATE_IN_PROGRESS", + GeneratedTemplateStatus::CreatePending => "CREATE_PENDING", + GeneratedTemplateStatus::DeleteInProgress => "DELETE_IN_PROGRESS", + GeneratedTemplateStatus::DeletePending => "DELETE_PENDING", + GeneratedTemplateStatus::Failed => "FAILED", + GeneratedTemplateStatus::UpdateInProgress => "UPDATE_IN_PROGRESS", + GeneratedTemplateStatus::UpdatePending => "UPDATE_PENDING", + GeneratedTemplateStatus::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &[ + "COMPLETE", + "CREATE_IN_PROGRESS", + "CREATE_PENDING", + "DELETE_IN_PROGRESS", + "DELETE_PENDING", + "FAILED", + "UPDATE_IN_PROGRESS", + "UPDATE_PENDING", + ] + } +} +impl ::std::convert::AsRef for GeneratedTemplateStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl GeneratedTemplateStatus { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} diff --git a/sdk/cloudformation/src/types/_generated_template_update_replace_policy.rs b/sdk/cloudformation/src/types/_generated_template_update_replace_policy.rs new file mode 100644 index 000000000000..375bb21d70dc --- /dev/null +++ b/sdk/cloudformation/src/types/_generated_template_update_replace_policy.rs @@ -0,0 +1,98 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `GeneratedTemplateUpdateReplacePolicy`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let generatedtemplateupdatereplacepolicy = unimplemented!(); +/// match generatedtemplateupdatereplacepolicy { +/// GeneratedTemplateUpdateReplacePolicy::Delete => { /* ... */ }, +/// GeneratedTemplateUpdateReplacePolicy::Retain => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `generatedtemplateupdatereplacepolicy` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `GeneratedTemplateUpdateReplacePolicy::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `GeneratedTemplateUpdateReplacePolicy::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `GeneratedTemplateUpdateReplacePolicy::NewFeature` is defined. +/// Specifically, when `generatedtemplateupdatereplacepolicy` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `GeneratedTemplateUpdateReplacePolicy::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum GeneratedTemplateUpdateReplacePolicy { + #[allow(missing_docs)] // documentation missing in model + Delete, + #[allow(missing_docs)] // documentation missing in model + Retain, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for GeneratedTemplateUpdateReplacePolicy { + fn from(s: &str) -> Self { + match s { + "DELETE" => GeneratedTemplateUpdateReplacePolicy::Delete, + "RETAIN" => GeneratedTemplateUpdateReplacePolicy::Retain, + other => GeneratedTemplateUpdateReplacePolicy::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for GeneratedTemplateUpdateReplacePolicy { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(GeneratedTemplateUpdateReplacePolicy::from(s)) + } +} +impl GeneratedTemplateUpdateReplacePolicy { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + GeneratedTemplateUpdateReplacePolicy::Delete => "DELETE", + GeneratedTemplateUpdateReplacePolicy::Retain => "RETAIN", + GeneratedTemplateUpdateReplacePolicy::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["DELETE", "RETAIN"] + } +} +impl ::std::convert::AsRef for GeneratedTemplateUpdateReplacePolicy { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl GeneratedTemplateUpdateReplacePolicy { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} diff --git a/sdk/cloudformation/src/types/_resource_definition.rs b/sdk/cloudformation/src/types/_resource_definition.rs new file mode 100644 index 000000000000..e96c9011d95c --- /dev/null +++ b/sdk/cloudformation/src/types/_resource_definition.rs @@ -0,0 +1,108 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

A resource included in a generated template. This data type is used with the CreateGeneratedTemplate and UpdateGeneratedTemplate API actions.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ResourceDefinition { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types in the CloudFormation User Guide

+ pub resource_type: ::std::option::Option<::std::string::String>, + ///

The logical resource id for this resource in the generated template.

+ pub logical_resource_id: ::std::option::Option<::std::string::String>, + ///

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub resource_identifier: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, +} +impl ResourceDefinition { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types in the CloudFormation User Guide

+ pub fn resource_type(&self) -> ::std::option::Option<&str> { + self.resource_type.as_deref() + } + ///

The logical resource id for this resource in the generated template.

+ pub fn logical_resource_id(&self) -> ::std::option::Option<&str> { + self.logical_resource_id.as_deref() + } + ///

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn resource_identifier(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> { + self.resource_identifier.as_ref() + } +} +impl ResourceDefinition { + /// Creates a new builder-style object to manufacture [`ResourceDefinition`](crate::types::ResourceDefinition). + pub fn builder() -> crate::types::builders::ResourceDefinitionBuilder { + crate::types::builders::ResourceDefinitionBuilder::default() + } +} + +/// A builder for [`ResourceDefinition`](crate::types::ResourceDefinition). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ResourceDefinitionBuilder { + pub(crate) resource_type: ::std::option::Option<::std::string::String>, + pub(crate) logical_resource_id: ::std::option::Option<::std::string::String>, + pub(crate) resource_identifier: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, +} +impl ResourceDefinitionBuilder { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types in the CloudFormation User Guide

+ /// This field is required. + pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_type = ::std::option::Option::Some(input.into()); + self + } + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types in the CloudFormation User Guide

+ pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_type = input; + self + } + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types in the CloudFormation User Guide

+ pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_type + } + ///

The logical resource id for this resource in the generated template.

+ pub fn logical_resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.logical_resource_id = ::std::option::Option::Some(input.into()); + self + } + ///

The logical resource id for this resource in the generated template.

+ pub fn set_logical_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.logical_resource_id = input; + self + } + ///

The logical resource id for this resource in the generated template.

+ pub fn get_logical_resource_id(&self) -> &::std::option::Option<::std::string::String> { + &self.logical_resource_id + } + /// Adds a key-value pair to `resource_identifier`. + /// + /// To override the contents of this collection use [`set_resource_identifier`](Self::set_resource_identifier). + /// + ///

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn resource_identifier( + mut self, + k: impl ::std::convert::Into<::std::string::String>, + v: impl ::std::convert::Into<::std::string::String>, + ) -> Self { + let mut hash_map = self.resource_identifier.unwrap_or_default(); + hash_map.insert(k.into(), v.into()); + self.resource_identifier = ::std::option::Option::Some(hash_map); + self + } + ///

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn set_resource_identifier( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + ) -> Self { + self.resource_identifier = input; + self + } + ///

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn get_resource_identifier(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { + &self.resource_identifier + } + /// Consumes the builder and constructs a [`ResourceDefinition`](crate::types::ResourceDefinition). + pub fn build(self) -> crate::types::ResourceDefinition { + crate::types::ResourceDefinition { + resource_type: self.resource_type, + logical_resource_id: self.logical_resource_id, + resource_identifier: self.resource_identifier, + } + } +} diff --git a/sdk/cloudformation/src/types/_resource_detail.rs b/sdk/cloudformation/src/types/_resource_detail.rs new file mode 100644 index 000000000000..e48bb03be8eb --- /dev/null +++ b/sdk/cloudformation/src/types/_resource_detail.rs @@ -0,0 +1,311 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

Details about a resource in a generated template

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ResourceDetail { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub resource_type: ::std::option::Option<::std::string::String>, + ///

The logical id for this resource in the final generated template.

+ pub logical_resource_id: ::std::option::Option<::std::string::String>, + ///

A list of up to 256 key-value pairs that identifies the resource in the generated template. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub resource_identifier: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + ///

Status of the processing of a resource in a generated template.

+ ///
+ ///
+ /// InProgress + ///
+ ///
+ ///

The resource processing is still in progress.

+ ///
+ ///
+ /// Complete + ///
+ ///
+ ///

The resource processing is complete.

+ ///
+ ///
+ /// Pending + ///
+ ///
+ ///

The resource processing is pending.

+ ///
+ ///
+ /// Failed + ///
+ ///
+ ///

The resource processing has failed.

+ ///
+ ///
+ pub resource_status: ::std::option::Option, + ///

The reason for the resource detail, providing more information if a failure happened.

+ pub resource_status_reason: ::std::option::Option<::std::string::String>, + ///

The warnings generated for this resource.

+ pub warnings: ::std::option::Option<::std::vec::Vec>, +} +impl ResourceDetail { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub fn resource_type(&self) -> ::std::option::Option<&str> { + self.resource_type.as_deref() + } + ///

The logical id for this resource in the final generated template.

+ pub fn logical_resource_id(&self) -> ::std::option::Option<&str> { + self.logical_resource_id.as_deref() + } + ///

A list of up to 256 key-value pairs that identifies the resource in the generated template. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn resource_identifier(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> { + self.resource_identifier.as_ref() + } + ///

Status of the processing of a resource in a generated template.

+ ///
+ ///
+ /// InProgress + ///
+ ///
+ ///

The resource processing is still in progress.

+ ///
+ ///
+ /// Complete + ///
+ ///
+ ///

The resource processing is complete.

+ ///
+ ///
+ /// Pending + ///
+ ///
+ ///

The resource processing is pending.

+ ///
+ ///
+ /// Failed + ///
+ ///
+ ///

The resource processing has failed.

+ ///
+ ///
+ pub fn resource_status(&self) -> ::std::option::Option<&crate::types::GeneratedTemplateResourceStatus> { + self.resource_status.as_ref() + } + ///

The reason for the resource detail, providing more information if a failure happened.

+ pub fn resource_status_reason(&self) -> ::std::option::Option<&str> { + self.resource_status_reason.as_deref() + } + ///

The warnings generated for this resource.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.warnings.is_none()`. + pub fn warnings(&self) -> &[crate::types::WarningDetail] { + self.warnings.as_deref().unwrap_or_default() + } +} +impl ResourceDetail { + /// Creates a new builder-style object to manufacture [`ResourceDetail`](crate::types::ResourceDetail). + pub fn builder() -> crate::types::builders::ResourceDetailBuilder { + crate::types::builders::ResourceDetailBuilder::default() + } +} + +/// A builder for [`ResourceDetail`](crate::types::ResourceDetail). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ResourceDetailBuilder { + pub(crate) resource_type: ::std::option::Option<::std::string::String>, + pub(crate) logical_resource_id: ::std::option::Option<::std::string::String>, + pub(crate) resource_identifier: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + pub(crate) resource_status: ::std::option::Option, + pub(crate) resource_status_reason: ::std::option::Option<::std::string::String>, + pub(crate) warnings: ::std::option::Option<::std::vec::Vec>, +} +impl ResourceDetailBuilder { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_type = ::std::option::Option::Some(input.into()); + self + } + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_type = input; + self + } + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_type + } + ///

The logical id for this resource in the final generated template.

+ pub fn logical_resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.logical_resource_id = ::std::option::Option::Some(input.into()); + self + } + ///

The logical id for this resource in the final generated template.

+ pub fn set_logical_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.logical_resource_id = input; + self + } + ///

The logical id for this resource in the final generated template.

+ pub fn get_logical_resource_id(&self) -> &::std::option::Option<::std::string::String> { + &self.logical_resource_id + } + /// Adds a key-value pair to `resource_identifier`. + /// + /// To override the contents of this collection use [`set_resource_identifier`](Self::set_resource_identifier). + /// + ///

A list of up to 256 key-value pairs that identifies the resource in the generated template. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn resource_identifier( + mut self, + k: impl ::std::convert::Into<::std::string::String>, + v: impl ::std::convert::Into<::std::string::String>, + ) -> Self { + let mut hash_map = self.resource_identifier.unwrap_or_default(); + hash_map.insert(k.into(), v.into()); + self.resource_identifier = ::std::option::Option::Some(hash_map); + self + } + ///

A list of up to 256 key-value pairs that identifies the resource in the generated template. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn set_resource_identifier( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + ) -> Self { + self.resource_identifier = input; + self + } + ///

A list of up to 256 key-value pairs that identifies the resource in the generated template. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn get_resource_identifier(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { + &self.resource_identifier + } + ///

Status of the processing of a resource in a generated template.

+ ///
+ ///
+ /// InProgress + ///
+ ///
+ ///

The resource processing is still in progress.

+ ///
+ ///
+ /// Complete + ///
+ ///
+ ///

The resource processing is complete.

+ ///
+ ///
+ /// Pending + ///
+ ///
+ ///

The resource processing is pending.

+ ///
+ ///
+ /// Failed + ///
+ ///
+ ///

The resource processing has failed.

+ ///
+ ///
+ pub fn resource_status(mut self, input: crate::types::GeneratedTemplateResourceStatus) -> Self { + self.resource_status = ::std::option::Option::Some(input); + self + } + ///

Status of the processing of a resource in a generated template.

+ ///
+ ///
+ /// InProgress + ///
+ ///
+ ///

The resource processing is still in progress.

+ ///
+ ///
+ /// Complete + ///
+ ///
+ ///

The resource processing is complete.

+ ///
+ ///
+ /// Pending + ///
+ ///
+ ///

The resource processing is pending.

+ ///
+ ///
+ /// Failed + ///
+ ///
+ ///

The resource processing has failed.

+ ///
+ ///
+ pub fn set_resource_status(mut self, input: ::std::option::Option) -> Self { + self.resource_status = input; + self + } + ///

Status of the processing of a resource in a generated template.

+ ///
+ ///
+ /// InProgress + ///
+ ///
+ ///

The resource processing is still in progress.

+ ///
+ ///
+ /// Complete + ///
+ ///
+ ///

The resource processing is complete.

+ ///
+ ///
+ /// Pending + ///
+ ///
+ ///

The resource processing is pending.

+ ///
+ ///
+ /// Failed + ///
+ ///
+ ///

The resource processing has failed.

+ ///
+ ///
+ pub fn get_resource_status(&self) -> &::std::option::Option { + &self.resource_status + } + ///

The reason for the resource detail, providing more information if a failure happened.

+ pub fn resource_status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_status_reason = ::std::option::Option::Some(input.into()); + self + } + ///

The reason for the resource detail, providing more information if a failure happened.

+ pub fn set_resource_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_status_reason = input; + self + } + ///

The reason for the resource detail, providing more information if a failure happened.

+ pub fn get_resource_status_reason(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_status_reason + } + /// Appends an item to `warnings`. + /// + /// To override the contents of this collection use [`set_warnings`](Self::set_warnings). + /// + ///

The warnings generated for this resource.

+ pub fn warnings(mut self, input: crate::types::WarningDetail) -> Self { + let mut v = self.warnings.unwrap_or_default(); + v.push(input); + self.warnings = ::std::option::Option::Some(v); + self + } + ///

The warnings generated for this resource.

+ pub fn set_warnings(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.warnings = input; + self + } + ///

The warnings generated for this resource.

+ pub fn get_warnings(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.warnings + } + /// Consumes the builder and constructs a [`ResourceDetail`](crate::types::ResourceDetail). + pub fn build(self) -> crate::types::ResourceDetail { + crate::types::ResourceDetail { + resource_type: self.resource_type, + logical_resource_id: self.logical_resource_id, + resource_identifier: self.resource_identifier, + resource_status: self.resource_status, + resource_status_reason: self.resource_status_reason, + warnings: self.warnings, + } + } +} diff --git a/sdk/cloudformation/src/types/_resource_scan_status.rs b/sdk/cloudformation/src/types/_resource_scan_status.rs new file mode 100644 index 000000000000..8f16572feddd --- /dev/null +++ b/sdk/cloudformation/src/types/_resource_scan_status.rs @@ -0,0 +1,108 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `ResourceScanStatus`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let resourcescanstatus = unimplemented!(); +/// match resourcescanstatus { +/// ResourceScanStatus::Complete => { /* ... */ }, +/// ResourceScanStatus::Expired => { /* ... */ }, +/// ResourceScanStatus::Failed => { /* ... */ }, +/// ResourceScanStatus::InProgress => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `resourcescanstatus` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `ResourceScanStatus::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `ResourceScanStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `ResourceScanStatus::NewFeature` is defined. +/// Specifically, when `resourcescanstatus` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `ResourceScanStatus::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum ResourceScanStatus { + #[allow(missing_docs)] // documentation missing in model + Complete, + #[allow(missing_docs)] // documentation missing in model + Expired, + #[allow(missing_docs)] // documentation missing in model + Failed, + #[allow(missing_docs)] // documentation missing in model + InProgress, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for ResourceScanStatus { + fn from(s: &str) -> Self { + match s { + "COMPLETE" => ResourceScanStatus::Complete, + "EXPIRED" => ResourceScanStatus::Expired, + "FAILED" => ResourceScanStatus::Failed, + "IN_PROGRESS" => ResourceScanStatus::InProgress, + other => ResourceScanStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for ResourceScanStatus { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(ResourceScanStatus::from(s)) + } +} +impl ResourceScanStatus { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + ResourceScanStatus::Complete => "COMPLETE", + ResourceScanStatus::Expired => "EXPIRED", + ResourceScanStatus::Failed => "FAILED", + ResourceScanStatus::InProgress => "IN_PROGRESS", + ResourceScanStatus::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["COMPLETE", "EXPIRED", "FAILED", "IN_PROGRESS"] + } +} +impl ::std::convert::AsRef for ResourceScanStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl ResourceScanStatus { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} diff --git a/sdk/cloudformation/src/types/_resource_scan_summary.rs b/sdk/cloudformation/src/types/_resource_scan_summary.rs new file mode 100644 index 000000000000..48772d778dc5 --- /dev/null +++ b/sdk/cloudformation/src/types/_resource_scan_summary.rs @@ -0,0 +1,290 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

A summary of the resource scan. This is returned by the ListResourceScan API action.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ResourceScanSummary { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub resource_scan_id: ::std::option::Option<::std::string::String>, + ///

Status of the resource scan.

+ ///
+ ///
+ /// INPROGRESS + ///
+ ///
+ ///

The resource scan is still in progress.

+ ///
+ ///
+ /// COMPLETE + ///
+ ///
+ ///

The resource scan is complete.

+ ///
+ ///
+ /// EXPIRED + ///
+ ///
+ ///

The resource scan has expired.

+ ///
+ ///
+ /// FAILED + ///
+ ///
+ ///

The resource scan has failed.

+ ///
+ ///
+ pub status: ::std::option::Option, + ///

The reason for the resource scan status, providing more information if a failure happened.

+ pub status_reason: ::std::option::Option<::std::string::String>, + ///

The time that the resource scan was started.

+ pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The time that the resource scan was finished.

+ pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The percentage of the resource scan that has been completed.

+ pub percentage_completed: ::std::option::Option, +} +impl ResourceScanSummary { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn resource_scan_id(&self) -> ::std::option::Option<&str> { + self.resource_scan_id.as_deref() + } + ///

Status of the resource scan.

+ ///
+ ///
+ /// INPROGRESS + ///
+ ///
+ ///

The resource scan is still in progress.

+ ///
+ ///
+ /// COMPLETE + ///
+ ///
+ ///

The resource scan is complete.

+ ///
+ ///
+ /// EXPIRED + ///
+ ///
+ ///

The resource scan has expired.

+ ///
+ ///
+ /// FAILED + ///
+ ///
+ ///

The resource scan has failed.

+ ///
+ ///
+ pub fn status(&self) -> ::std::option::Option<&crate::types::ResourceScanStatus> { + self.status.as_ref() + } + ///

The reason for the resource scan status, providing more information if a failure happened.

+ pub fn status_reason(&self) -> ::std::option::Option<&str> { + self.status_reason.as_deref() + } + ///

The time that the resource scan was started.

+ pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.start_time.as_ref() + } + ///

The time that the resource scan was finished.

+ pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.end_time.as_ref() + } + ///

The percentage of the resource scan that has been completed.

+ pub fn percentage_completed(&self) -> ::std::option::Option { + self.percentage_completed + } +} +impl ResourceScanSummary { + /// Creates a new builder-style object to manufacture [`ResourceScanSummary`](crate::types::ResourceScanSummary). + pub fn builder() -> crate::types::builders::ResourceScanSummaryBuilder { + crate::types::builders::ResourceScanSummaryBuilder::default() + } +} + +/// A builder for [`ResourceScanSummary`](crate::types::ResourceScanSummary). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ResourceScanSummaryBuilder { + pub(crate) resource_scan_id: ::std::option::Option<::std::string::String>, + pub(crate) status: ::std::option::Option, + pub(crate) status_reason: ::std::option::Option<::std::string::String>, + pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) percentage_completed: ::std::option::Option, +} +impl ResourceScanSummaryBuilder { + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn resource_scan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_scan_id = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn set_resource_scan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_scan_id = input; + self + } + ///

The Amazon Resource Name (ARN) of the resource scan.

+ pub fn get_resource_scan_id(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_scan_id + } + ///

Status of the resource scan.

+ ///
+ ///
+ /// INPROGRESS + ///
+ ///
+ ///

The resource scan is still in progress.

+ ///
+ ///
+ /// COMPLETE + ///
+ ///
+ ///

The resource scan is complete.

+ ///
+ ///
+ /// EXPIRED + ///
+ ///
+ ///

The resource scan has expired.

+ ///
+ ///
+ /// FAILED + ///
+ ///
+ ///

The resource scan has failed.

+ ///
+ ///
+ pub fn status(mut self, input: crate::types::ResourceScanStatus) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + ///

Status of the resource scan.

+ ///
+ ///
+ /// INPROGRESS + ///
+ ///
+ ///

The resource scan is still in progress.

+ ///
+ ///
+ /// COMPLETE + ///
+ ///
+ ///

The resource scan is complete.

+ ///
+ ///
+ /// EXPIRED + ///
+ ///
+ ///

The resource scan has expired.

+ ///
+ ///
+ /// FAILED + ///
+ ///
+ ///

The resource scan has failed.

+ ///
+ ///
+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + ///

Status of the resource scan.

+ ///
+ ///
+ /// INPROGRESS + ///
+ ///
+ ///

The resource scan is still in progress.

+ ///
+ ///
+ /// COMPLETE + ///
+ ///
+ ///

The resource scan is complete.

+ ///
+ ///
+ /// EXPIRED + ///
+ ///
+ ///

The resource scan has expired.

+ ///
+ ///
+ /// FAILED + ///
+ ///
+ ///

The resource scan has failed.

+ ///
+ ///
+ pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + ///

The reason for the resource scan status, providing more information if a failure happened.

+ pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.status_reason = ::std::option::Option::Some(input.into()); + self + } + ///

The reason for the resource scan status, providing more information if a failure happened.

+ pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.status_reason = input; + self + } + ///

The reason for the resource scan status, providing more information if a failure happened.

+ pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> { + &self.status_reason + } + ///

The time that the resource scan was started.

+ pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.start_time = ::std::option::Option::Some(input); + self + } + ///

The time that the resource scan was started.

+ pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.start_time = input; + self + } + ///

The time that the resource scan was started.

+ pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.start_time + } + ///

The time that the resource scan was finished.

+ pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.end_time = ::std::option::Option::Some(input); + self + } + ///

The time that the resource scan was finished.

+ pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.end_time = input; + self + } + ///

The time that the resource scan was finished.

+ pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.end_time + } + ///

The percentage of the resource scan that has been completed.

+ pub fn percentage_completed(mut self, input: f64) -> Self { + self.percentage_completed = ::std::option::Option::Some(input); + self + } + ///

The percentage of the resource scan that has been completed.

+ pub fn set_percentage_completed(mut self, input: ::std::option::Option) -> Self { + self.percentage_completed = input; + self + } + ///

The percentage of the resource scan that has been completed.

+ pub fn get_percentage_completed(&self) -> &::std::option::Option { + &self.percentage_completed + } + /// Consumes the builder and constructs a [`ResourceScanSummary`](crate::types::ResourceScanSummary). + pub fn build(self) -> crate::types::ResourceScanSummary { + crate::types::ResourceScanSummary { + resource_scan_id: self.resource_scan_id, + status: self.status, + status_reason: self.status_reason, + start_time: self.start_time, + end_time: self.end_time, + percentage_completed: self.percentage_completed, + } + } +} diff --git a/sdk/cloudformation/src/types/_scanned_resource.rs b/sdk/cloudformation/src/types/_scanned_resource.rs new file mode 100644 index 000000000000..9940cbfe94b5 --- /dev/null +++ b/sdk/cloudformation/src/types/_scanned_resource.rs @@ -0,0 +1,107 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

A scanned resource returned by ListResourceScanResources or ListResourceScanRelatedResources.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ScannedResource { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub resource_type: ::std::option::Option<::std::string::String>, + ///

A list of up to 256 key-value pairs that identifies for the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub resource_identifier: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + ///

If true, the resource is managed by a CloudFormation stack.

+ pub managed_by_stack: ::std::option::Option, +} +impl ScannedResource { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub fn resource_type(&self) -> ::std::option::Option<&str> { + self.resource_type.as_deref() + } + ///

A list of up to 256 key-value pairs that identifies for the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn resource_identifier(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> { + self.resource_identifier.as_ref() + } + ///

If true, the resource is managed by a CloudFormation stack.

+ pub fn managed_by_stack(&self) -> ::std::option::Option { + self.managed_by_stack + } +} +impl ScannedResource { + /// Creates a new builder-style object to manufacture [`ScannedResource`](crate::types::ScannedResource). + pub fn builder() -> crate::types::builders::ScannedResourceBuilder { + crate::types::builders::ScannedResourceBuilder::default() + } +} + +/// A builder for [`ScannedResource`](crate::types::ScannedResource). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ScannedResourceBuilder { + pub(crate) resource_type: ::std::option::Option<::std::string::String>, + pub(crate) resource_identifier: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + pub(crate) managed_by_stack: ::std::option::Option, +} +impl ScannedResourceBuilder { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_type = ::std::option::Option::Some(input.into()); + self + } + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_type = input; + self + } + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_type + } + /// Adds a key-value pair to `resource_identifier`. + /// + /// To override the contents of this collection use [`set_resource_identifier`](Self::set_resource_identifier). + /// + ///

A list of up to 256 key-value pairs that identifies for the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn resource_identifier( + mut self, + k: impl ::std::convert::Into<::std::string::String>, + v: impl ::std::convert::Into<::std::string::String>, + ) -> Self { + let mut hash_map = self.resource_identifier.unwrap_or_default(); + hash_map.insert(k.into(), v.into()); + self.resource_identifier = ::std::option::Option::Some(hash_map); + self + } + ///

A list of up to 256 key-value pairs that identifies for the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn set_resource_identifier( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + ) -> Self { + self.resource_identifier = input; + self + } + ///

A list of up to 256 key-value pairs that identifies for the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn get_resource_identifier(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { + &self.resource_identifier + } + ///

If true, the resource is managed by a CloudFormation stack.

+ pub fn managed_by_stack(mut self, input: bool) -> Self { + self.managed_by_stack = ::std::option::Option::Some(input); + self + } + ///

If true, the resource is managed by a CloudFormation stack.

+ pub fn set_managed_by_stack(mut self, input: ::std::option::Option) -> Self { + self.managed_by_stack = input; + self + } + ///

If true, the resource is managed by a CloudFormation stack.

+ pub fn get_managed_by_stack(&self) -> &::std::option::Option { + &self.managed_by_stack + } + /// Consumes the builder and constructs a [`ScannedResource`](crate::types::ScannedResource). + pub fn build(self) -> crate::types::ScannedResource { + crate::types::ScannedResource { + resource_type: self.resource_type, + resource_identifier: self.resource_identifier, + managed_by_stack: self.managed_by_stack, + } + } +} diff --git a/sdk/cloudformation/src/types/_scanned_resource_identifier.rs b/sdk/cloudformation/src/types/_scanned_resource_identifier.rs new file mode 100644 index 000000000000..c73afd60691b --- /dev/null +++ b/sdk/cloudformation/src/types/_scanned_resource_identifier.rs @@ -0,0 +1,86 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

Identifies a scanned resource. This is used with the ListResourceScanRelatedResources API action.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ScannedResourceIdentifier { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub resource_type: ::std::option::Option<::std::string::String>, + ///

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub resource_identifier: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, +} +impl ScannedResourceIdentifier { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub fn resource_type(&self) -> ::std::option::Option<&str> { + self.resource_type.as_deref() + } + ///

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn resource_identifier(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> { + self.resource_identifier.as_ref() + } +} +impl ScannedResourceIdentifier { + /// Creates a new builder-style object to manufacture [`ScannedResourceIdentifier`](crate::types::ScannedResourceIdentifier). + pub fn builder() -> crate::types::builders::ScannedResourceIdentifierBuilder { + crate::types::builders::ScannedResourceIdentifierBuilder::default() + } +} + +/// A builder for [`ScannedResourceIdentifier`](crate::types::ScannedResourceIdentifier). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ScannedResourceIdentifierBuilder { + pub(crate) resource_type: ::std::option::Option<::std::string::String>, + pub(crate) resource_identifier: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, +} +impl ScannedResourceIdentifierBuilder { + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ /// This field is required. + pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_type = ::std::option::Option::Some(input.into()); + self + } + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_type = input; + self + } + ///

The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see IaC generator supported resource types In the CloudFormation User Guide

+ pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_type + } + /// Adds a key-value pair to `resource_identifier`. + /// + /// To override the contents of this collection use [`set_resource_identifier`](Self::set_resource_identifier). + /// + ///

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn resource_identifier( + mut self, + k: impl ::std::convert::Into<::std::string::String>, + v: impl ::std::convert::Into<::std::string::String>, + ) -> Self { + let mut hash_map = self.resource_identifier.unwrap_or_default(); + hash_map.insert(k.into(), v.into()); + self.resource_identifier = ::std::option::Option::Some(hash_map); + self + } + ///

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn set_resource_identifier( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + ) -> Self { + self.resource_identifier = input; + self + } + ///

A list of up to 256 key-value pairs that identifies the scanned resource. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface User guide for extension development.

+ pub fn get_resource_identifier(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { + &self.resource_identifier + } + /// Consumes the builder and constructs a [`ScannedResourceIdentifier`](crate::types::ScannedResourceIdentifier). + pub fn build(self) -> crate::types::ScannedResourceIdentifier { + crate::types::ScannedResourceIdentifier { + resource_type: self.resource_type, + resource_identifier: self.resource_identifier, + } + } +} diff --git a/sdk/cloudformation/src/types/_stack_set_operation_preferences.rs b/sdk/cloudformation/src/types/_stack_set_operation_preferences.rs index 1694a642adff..cd6ce6e57256 100644 --- a/sdk/cloudformation/src/types/_stack_set_operation_preferences.rs +++ b/sdk/cloudformation/src/types/_stack_set_operation_preferences.rs @@ -7,7 +7,9 @@ pub struct StackSetOperationPreferences { ///

The concurrency type of deploying StackSets operations in Regions, could be in parallel or one Region at a time.

pub region_concurrency_type: ::std::option::Option, - ///

The order of the Regions where you want to perform the stack operation.

+ ///

The order of the Regions where you want to perform the stack operation.

+ ///

RegionOrder isn't followed if AutoDeployment is enabled.

+ ///
pub region_order: ::std::option::Option<::std::vec::Vec<::std::string::String>>, ///

The number of accounts, per Region, for which this operation can fail before CloudFormation stops the operation in that Region. If the operation is stopped in a Region, CloudFormation doesn't attempt the operation in any subsequent Regions.

///

Conditional: You must specify either FailureToleranceCount or FailureTolerancePercentage (but not both).

@@ -44,7 +46,9 @@ impl StackSetOperationPreferences { pub fn region_concurrency_type(&self) -> ::std::option::Option<&crate::types::RegionConcurrencyType> { self.region_concurrency_type.as_ref() } - ///

The order of the Regions where you want to perform the stack operation.

+ ///

The order of the Regions where you want to perform the stack operation.

+ ///

RegionOrder isn't followed if AutoDeployment is enabled.

+ ///
/// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.region_order.is_none()`. pub fn region_order(&self) -> &[::std::string::String] { @@ -128,19 +132,25 @@ impl StackSetOperationPreferencesBuilder { /// /// To override the contents of this collection use [`set_region_order`](Self::set_region_order). /// - ///

The order of the Regions where you want to perform the stack operation.

+ ///

The order of the Regions where you want to perform the stack operation.

+ ///

RegionOrder isn't followed if AutoDeployment is enabled.

+ ///
pub fn region_order(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { let mut v = self.region_order.unwrap_or_default(); v.push(input.into()); self.region_order = ::std::option::Option::Some(v); self } - ///

The order of the Regions where you want to perform the stack operation.

+ ///

The order of the Regions where you want to perform the stack operation.

+ ///

RegionOrder isn't followed if AutoDeployment is enabled.

+ ///
pub fn set_region_order(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { self.region_order = input; self } - ///

The order of the Regions where you want to perform the stack operation.

+ ///

The order of the Regions where you want to perform the stack operation.

+ ///

RegionOrder isn't followed if AutoDeployment is enabled.

+ ///
pub fn get_region_order(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { &self.region_order } diff --git a/sdk/cloudformation/src/types/_template_configuration.rs b/sdk/cloudformation/src/types/_template_configuration.rs new file mode 100644 index 000000000000..38e005bf1b51 --- /dev/null +++ b/sdk/cloudformation/src/types/_template_configuration.rs @@ -0,0 +1,142 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The configuration details of a generated template.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct TemplateConfiguration { + ///

The DeletionPolicy assigned to resources in the generated template. Supported values are:

+ ///
    + ///
  • + ///

    DELETE - delete all resources when the stack is deleted.

  • + ///
  • + ///

    RETAIN - retain all resources when the stack is deleted.

  • + ///
+ ///

For more information, see DeletionPolicy attribute in the CloudFormation User Guide.

+ pub deletion_policy: ::std::option::Option, + ///

The UpdateReplacePolicy assigned to resources in the generated template. Supported values are:

+ ///
    + ///
  • + ///

    DELETE - delete all resources when the resource is replaced during an update operation.

  • + ///
  • + ///

    RETAIN - retain all resources when the resource is replaced during an update operation.

  • + ///
+ ///

For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.

+ pub update_replace_policy: ::std::option::Option, +} +impl TemplateConfiguration { + ///

The DeletionPolicy assigned to resources in the generated template. Supported values are:

+ ///
    + ///
  • + ///

    DELETE - delete all resources when the stack is deleted.

  • + ///
  • + ///

    RETAIN - retain all resources when the stack is deleted.

  • + ///
+ ///

For more information, see DeletionPolicy attribute in the CloudFormation User Guide.

+ pub fn deletion_policy(&self) -> ::std::option::Option<&crate::types::GeneratedTemplateDeletionPolicy> { + self.deletion_policy.as_ref() + } + ///

The UpdateReplacePolicy assigned to resources in the generated template. Supported values are:

+ ///
    + ///
  • + ///

    DELETE - delete all resources when the resource is replaced during an update operation.

  • + ///
  • + ///

    RETAIN - retain all resources when the resource is replaced during an update operation.

  • + ///
+ ///

For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.

+ pub fn update_replace_policy(&self) -> ::std::option::Option<&crate::types::GeneratedTemplateUpdateReplacePolicy> { + self.update_replace_policy.as_ref() + } +} +impl TemplateConfiguration { + /// Creates a new builder-style object to manufacture [`TemplateConfiguration`](crate::types::TemplateConfiguration). + pub fn builder() -> crate::types::builders::TemplateConfigurationBuilder { + crate::types::builders::TemplateConfigurationBuilder::default() + } +} + +/// A builder for [`TemplateConfiguration`](crate::types::TemplateConfiguration). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct TemplateConfigurationBuilder { + pub(crate) deletion_policy: ::std::option::Option, + pub(crate) update_replace_policy: ::std::option::Option, +} +impl TemplateConfigurationBuilder { + ///

The DeletionPolicy assigned to resources in the generated template. Supported values are:

+ ///
    + ///
  • + ///

    DELETE - delete all resources when the stack is deleted.

  • + ///
  • + ///

    RETAIN - retain all resources when the stack is deleted.

  • + ///
+ ///

For more information, see DeletionPolicy attribute in the CloudFormation User Guide.

+ pub fn deletion_policy(mut self, input: crate::types::GeneratedTemplateDeletionPolicy) -> Self { + self.deletion_policy = ::std::option::Option::Some(input); + self + } + ///

The DeletionPolicy assigned to resources in the generated template. Supported values are:

+ ///
    + ///
  • + ///

    DELETE - delete all resources when the stack is deleted.

  • + ///
  • + ///

    RETAIN - retain all resources when the stack is deleted.

  • + ///
+ ///

For more information, see DeletionPolicy attribute in the CloudFormation User Guide.

+ pub fn set_deletion_policy(mut self, input: ::std::option::Option) -> Self { + self.deletion_policy = input; + self + } + ///

The DeletionPolicy assigned to resources in the generated template. Supported values are:

+ ///
    + ///
  • + ///

    DELETE - delete all resources when the stack is deleted.

  • + ///
  • + ///

    RETAIN - retain all resources when the stack is deleted.

  • + ///
+ ///

For more information, see DeletionPolicy attribute in the CloudFormation User Guide.

+ pub fn get_deletion_policy(&self) -> &::std::option::Option { + &self.deletion_policy + } + ///

The UpdateReplacePolicy assigned to resources in the generated template. Supported values are:

+ ///
    + ///
  • + ///

    DELETE - delete all resources when the resource is replaced during an update operation.

  • + ///
  • + ///

    RETAIN - retain all resources when the resource is replaced during an update operation.

  • + ///
+ ///

For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.

+ pub fn update_replace_policy(mut self, input: crate::types::GeneratedTemplateUpdateReplacePolicy) -> Self { + self.update_replace_policy = ::std::option::Option::Some(input); + self + } + ///

The UpdateReplacePolicy assigned to resources in the generated template. Supported values are:

+ ///
    + ///
  • + ///

    DELETE - delete all resources when the resource is replaced during an update operation.

  • + ///
  • + ///

    RETAIN - retain all resources when the resource is replaced during an update operation.

  • + ///
+ ///

For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.

+ pub fn set_update_replace_policy(mut self, input: ::std::option::Option) -> Self { + self.update_replace_policy = input; + self + } + ///

The UpdateReplacePolicy assigned to resources in the generated template. Supported values are:

+ ///
    + ///
  • + ///

    DELETE - delete all resources when the resource is replaced during an update operation.

  • + ///
  • + ///

    RETAIN - retain all resources when the resource is replaced during an update operation.

  • + ///
+ ///

For more information, see UpdateReplacePolicy attribute in the CloudFormation User Guide.

+ pub fn get_update_replace_policy(&self) -> &::std::option::Option { + &self.update_replace_policy + } + /// Consumes the builder and constructs a [`TemplateConfiguration`](crate::types::TemplateConfiguration). + pub fn build(self) -> crate::types::TemplateConfiguration { + crate::types::TemplateConfiguration { + deletion_policy: self.deletion_policy, + update_replace_policy: self.update_replace_policy, + } + } +} diff --git a/sdk/cloudformation/src/types/_template_format.rs b/sdk/cloudformation/src/types/_template_format.rs new file mode 100644 index 000000000000..b3c34c694ce9 --- /dev/null +++ b/sdk/cloudformation/src/types/_template_format.rs @@ -0,0 +1,98 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `TemplateFormat`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let templateformat = unimplemented!(); +/// match templateformat { +/// TemplateFormat::Json => { /* ... */ }, +/// TemplateFormat::Yaml => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `templateformat` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `TemplateFormat::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `TemplateFormat::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `TemplateFormat::NewFeature` is defined. +/// Specifically, when `templateformat` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `TemplateFormat::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum TemplateFormat { + #[allow(missing_docs)] // documentation missing in model + Json, + #[allow(missing_docs)] // documentation missing in model + Yaml, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for TemplateFormat { + fn from(s: &str) -> Self { + match s { + "JSON" => TemplateFormat::Json, + "YAML" => TemplateFormat::Yaml, + other => TemplateFormat::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for TemplateFormat { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(TemplateFormat::from(s)) + } +} +impl TemplateFormat { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + TemplateFormat::Json => "JSON", + TemplateFormat::Yaml => "YAML", + TemplateFormat::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["JSON", "YAML"] + } +} +impl ::std::convert::AsRef for TemplateFormat { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl TemplateFormat { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} diff --git a/sdk/cloudformation/src/types/_template_progress.rs b/sdk/cloudformation/src/types/_template_progress.rs new file mode 100644 index 000000000000..3ba4ac2ff365 --- /dev/null +++ b/sdk/cloudformation/src/types/_template_progress.rs @@ -0,0 +1,116 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

A summary of the progress of the template generation.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct TemplateProgress { + ///

The number of resources that succeeded the template generation.

+ pub resources_succeeded: ::std::option::Option, + ///

The number of resources that failed the template generation.

+ pub resources_failed: ::std::option::Option, + ///

The number of resources that are in-process for the template generation.

+ pub resources_processing: ::std::option::Option, + ///

The number of resources that are still pending the template generation.

+ pub resources_pending: ::std::option::Option, +} +impl TemplateProgress { + ///

The number of resources that succeeded the template generation.

+ pub fn resources_succeeded(&self) -> ::std::option::Option { + self.resources_succeeded + } + ///

The number of resources that failed the template generation.

+ pub fn resources_failed(&self) -> ::std::option::Option { + self.resources_failed + } + ///

The number of resources that are in-process for the template generation.

+ pub fn resources_processing(&self) -> ::std::option::Option { + self.resources_processing + } + ///

The number of resources that are still pending the template generation.

+ pub fn resources_pending(&self) -> ::std::option::Option { + self.resources_pending + } +} +impl TemplateProgress { + /// Creates a new builder-style object to manufacture [`TemplateProgress`](crate::types::TemplateProgress). + pub fn builder() -> crate::types::builders::TemplateProgressBuilder { + crate::types::builders::TemplateProgressBuilder::default() + } +} + +/// A builder for [`TemplateProgress`](crate::types::TemplateProgress). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct TemplateProgressBuilder { + pub(crate) resources_succeeded: ::std::option::Option, + pub(crate) resources_failed: ::std::option::Option, + pub(crate) resources_processing: ::std::option::Option, + pub(crate) resources_pending: ::std::option::Option, +} +impl TemplateProgressBuilder { + ///

The number of resources that succeeded the template generation.

+ pub fn resources_succeeded(mut self, input: i32) -> Self { + self.resources_succeeded = ::std::option::Option::Some(input); + self + } + ///

The number of resources that succeeded the template generation.

+ pub fn set_resources_succeeded(mut self, input: ::std::option::Option) -> Self { + self.resources_succeeded = input; + self + } + ///

The number of resources that succeeded the template generation.

+ pub fn get_resources_succeeded(&self) -> &::std::option::Option { + &self.resources_succeeded + } + ///

The number of resources that failed the template generation.

+ pub fn resources_failed(mut self, input: i32) -> Self { + self.resources_failed = ::std::option::Option::Some(input); + self + } + ///

The number of resources that failed the template generation.

+ pub fn set_resources_failed(mut self, input: ::std::option::Option) -> Self { + self.resources_failed = input; + self + } + ///

The number of resources that failed the template generation.

+ pub fn get_resources_failed(&self) -> &::std::option::Option { + &self.resources_failed + } + ///

The number of resources that are in-process for the template generation.

+ pub fn resources_processing(mut self, input: i32) -> Self { + self.resources_processing = ::std::option::Option::Some(input); + self + } + ///

The number of resources that are in-process for the template generation.

+ pub fn set_resources_processing(mut self, input: ::std::option::Option) -> Self { + self.resources_processing = input; + self + } + ///

The number of resources that are in-process for the template generation.

+ pub fn get_resources_processing(&self) -> &::std::option::Option { + &self.resources_processing + } + ///

The number of resources that are still pending the template generation.

+ pub fn resources_pending(mut self, input: i32) -> Self { + self.resources_pending = ::std::option::Option::Some(input); + self + } + ///

The number of resources that are still pending the template generation.

+ pub fn set_resources_pending(mut self, input: ::std::option::Option) -> Self { + self.resources_pending = input; + self + } + ///

The number of resources that are still pending the template generation.

+ pub fn get_resources_pending(&self) -> &::std::option::Option { + &self.resources_pending + } + /// Consumes the builder and constructs a [`TemplateProgress`](crate::types::TemplateProgress). + pub fn build(self) -> crate::types::TemplateProgress { + crate::types::TemplateProgress { + resources_succeeded: self.resources_succeeded, + resources_failed: self.resources_failed, + resources_processing: self.resources_processing, + resources_pending: self.resources_pending, + } + } +} diff --git a/sdk/cloudformation/src/types/_template_summary.rs b/sdk/cloudformation/src/types/_template_summary.rs new file mode 100644 index 000000000000..b1ed9c2123e0 --- /dev/null +++ b/sdk/cloudformation/src/types/_template_summary.rs @@ -0,0 +1,272 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The summary of a generated template.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct TemplateSummary { + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub generated_template_id: ::std::option::Option<::std::string::String>, + ///

The name of the generated template.

+ pub generated_template_name: ::std::option::Option<::std::string::String>, + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub status: ::std::option::Option, + ///

The reason for the current template generation status. This will provide more details if a failure happened.

+ pub status_reason: ::std::option::Option<::std::string::String>, + ///

The time the generated template was created.

+ pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The time the generated template was last updated.

+ pub last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The number of resources in the generated template. This is a total of resources in pending, in-progress, completed, and failed states.

+ pub number_of_resources: ::std::option::Option, +} +impl TemplateSummary { + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn generated_template_id(&self) -> ::std::option::Option<&str> { + self.generated_template_id.as_deref() + } + ///

The name of the generated template.

+ pub fn generated_template_name(&self) -> ::std::option::Option<&str> { + self.generated_template_name.as_deref() + } + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn status(&self) -> ::std::option::Option<&crate::types::GeneratedTemplateStatus> { + self.status.as_ref() + } + ///

The reason for the current template generation status. This will provide more details if a failure happened.

+ pub fn status_reason(&self) -> ::std::option::Option<&str> { + self.status_reason.as_deref() + } + ///

The time the generated template was created.

+ pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.creation_time.as_ref() + } + ///

The time the generated template was last updated.

+ pub fn last_updated_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.last_updated_time.as_ref() + } + ///

The number of resources in the generated template. This is a total of resources in pending, in-progress, completed, and failed states.

+ pub fn number_of_resources(&self) -> ::std::option::Option { + self.number_of_resources + } +} +impl TemplateSummary { + /// Creates a new builder-style object to manufacture [`TemplateSummary`](crate::types::TemplateSummary). + pub fn builder() -> crate::types::builders::TemplateSummaryBuilder { + crate::types::builders::TemplateSummaryBuilder::default() + } +} + +/// A builder for [`TemplateSummary`](crate::types::TemplateSummary). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct TemplateSummaryBuilder { + pub(crate) generated_template_id: ::std::option::Option<::std::string::String>, + pub(crate) generated_template_name: ::std::option::Option<::std::string::String>, + pub(crate) status: ::std::option::Option, + pub(crate) status_reason: ::std::option::Option<::std::string::String>, + pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) number_of_resources: ::std::option::Option, +} +impl TemplateSummaryBuilder { + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn generated_template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.generated_template_id = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn set_generated_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.generated_template_id = input; + self + } + ///

The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc .

+ pub fn get_generated_template_id(&self) -> &::std::option::Option<::std::string::String> { + &self.generated_template_id + } + ///

The name of the generated template.

+ pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.generated_template_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name of the generated template.

+ pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.generated_template_name = input; + self + } + ///

The name of the generated template.

+ pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> { + &self.generated_template_name + } + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn status(mut self, input: crate::types::GeneratedTemplateStatus) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + ///

The status of the template generation. Supported values are:

+ ///
    + ///
  • + ///

    CreatePending - the creation of the template is pending.

  • + ///
  • + ///

    CreateInProgress - the creation of the template is in progress.

  • + ///
  • + ///

    DeletePending - the deletion of the template is pending.

  • + ///
  • + ///

    DeleteInProgress - the deletion of the template is in progress.

  • + ///
  • + ///

    UpdatePending - the update of the template is pending.

  • + ///
  • + ///

    UpdateInProgress - the update of the template is in progress.

  • + ///
  • + ///

    Failed - the template operation failed.

  • + ///
  • + ///

    Complete - the template operation is complete.

  • + ///
+ pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + ///

The reason for the current template generation status. This will provide more details if a failure happened.

+ pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.status_reason = ::std::option::Option::Some(input.into()); + self + } + ///

The reason for the current template generation status. This will provide more details if a failure happened.

+ pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.status_reason = input; + self + } + ///

The reason for the current template generation status. This will provide more details if a failure happened.

+ pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> { + &self.status_reason + } + ///

The time the generated template was created.

+ pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.creation_time = ::std::option::Option::Some(input); + self + } + ///

The time the generated template was created.

+ pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.creation_time = input; + self + } + ///

The time the generated template was created.

+ pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.creation_time + } + ///

The time the generated template was last updated.

+ pub fn last_updated_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.last_updated_time = ::std::option::Option::Some(input); + self + } + ///

The time the generated template was last updated.

+ pub fn set_last_updated_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.last_updated_time = input; + self + } + ///

The time the generated template was last updated.

+ pub fn get_last_updated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.last_updated_time + } + ///

The number of resources in the generated template. This is a total of resources in pending, in-progress, completed, and failed states.

+ pub fn number_of_resources(mut self, input: i32) -> Self { + self.number_of_resources = ::std::option::Option::Some(input); + self + } + ///

The number of resources in the generated template. This is a total of resources in pending, in-progress, completed, and failed states.

+ pub fn set_number_of_resources(mut self, input: ::std::option::Option) -> Self { + self.number_of_resources = input; + self + } + ///

The number of resources in the generated template. This is a total of resources in pending, in-progress, completed, and failed states.

+ pub fn get_number_of_resources(&self) -> &::std::option::Option { + &self.number_of_resources + } + /// Consumes the builder and constructs a [`TemplateSummary`](crate::types::TemplateSummary). + pub fn build(self) -> crate::types::TemplateSummary { + crate::types::TemplateSummary { + generated_template_id: self.generated_template_id, + generated_template_name: self.generated_template_name, + status: self.status, + status_reason: self.status_reason, + creation_time: self.creation_time, + last_updated_time: self.last_updated_time, + number_of_resources: self.number_of_resources, + } + } +} diff --git a/sdk/cloudformation/src/types/_warning_detail.rs b/sdk/cloudformation/src/types/_warning_detail.rs new file mode 100644 index 000000000000..1b4ef4d657e1 --- /dev/null +++ b/sdk/cloudformation/src/types/_warning_detail.rs @@ -0,0 +1,130 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The warnings generated for a specific resource for this generated template.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct WarningDetail { + ///

The type of this warning. For more information, see IaC generator and write-only properties in the CloudFormation User Guide.

+ ///
    + ///
  • + ///

    MUTUALLY_EXCLUSIVE_PROPERTIES - The resource requires mutually-exclusive write-only properties. The IaC generator selects one set of mutually exclusive properties and converts the included properties into parameters. The parameter names have a suffix OneOf and the parameter descriptions indicate that the corresponding property can be replaced with other exclusive properties.

  • + ///
  • + ///

    UNSUPPORTED_PROPERTIES - Unsupported properties are present in the resource. One example of unsupported properties would be a required write-only property that is an array, because a parameter cannot be an array. Another example is an optional write-only property.

  • + ///
  • + ///

    MUTUALLY_EXCLUSIVE_TYPES - One or more required write-only properties are found in the resource, and the type of that property can be any of several types.

  • + ///
+ ///

Currently the resource and property reference documentation does not indicate if a property uses a type of oneOf or anyOf. You need to look at the resource provider schema.

+ ///
+ pub r#type: ::std::option::Option, + ///

The properties of the resource that are impacted by this warning.

+ pub properties: ::std::option::Option<::std::vec::Vec>, +} +impl WarningDetail { + ///

The type of this warning. For more information, see IaC generator and write-only properties in the CloudFormation User Guide.

+ ///
    + ///
  • + ///

    MUTUALLY_EXCLUSIVE_PROPERTIES - The resource requires mutually-exclusive write-only properties. The IaC generator selects one set of mutually exclusive properties and converts the included properties into parameters. The parameter names have a suffix OneOf and the parameter descriptions indicate that the corresponding property can be replaced with other exclusive properties.

  • + ///
  • + ///

    UNSUPPORTED_PROPERTIES - Unsupported properties are present in the resource. One example of unsupported properties would be a required write-only property that is an array, because a parameter cannot be an array. Another example is an optional write-only property.

  • + ///
  • + ///

    MUTUALLY_EXCLUSIVE_TYPES - One or more required write-only properties are found in the resource, and the type of that property can be any of several types.

  • + ///
+ ///

Currently the resource and property reference documentation does not indicate if a property uses a type of oneOf or anyOf. You need to look at the resource provider schema.

+ ///
+ pub fn r#type(&self) -> ::std::option::Option<&crate::types::WarningType> { + self.r#type.as_ref() + } + ///

The properties of the resource that are impacted by this warning.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.properties.is_none()`. + pub fn properties(&self) -> &[crate::types::WarningProperty] { + self.properties.as_deref().unwrap_or_default() + } +} +impl WarningDetail { + /// Creates a new builder-style object to manufacture [`WarningDetail`](crate::types::WarningDetail). + pub fn builder() -> crate::types::builders::WarningDetailBuilder { + crate::types::builders::WarningDetailBuilder::default() + } +} + +/// A builder for [`WarningDetail`](crate::types::WarningDetail). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct WarningDetailBuilder { + pub(crate) r#type: ::std::option::Option, + pub(crate) properties: ::std::option::Option<::std::vec::Vec>, +} +impl WarningDetailBuilder { + ///

The type of this warning. For more information, see IaC generator and write-only properties in the CloudFormation User Guide.

+ ///
    + ///
  • + ///

    MUTUALLY_EXCLUSIVE_PROPERTIES - The resource requires mutually-exclusive write-only properties. The IaC generator selects one set of mutually exclusive properties and converts the included properties into parameters. The parameter names have a suffix OneOf and the parameter descriptions indicate that the corresponding property can be replaced with other exclusive properties.

  • + ///
  • + ///

    UNSUPPORTED_PROPERTIES - Unsupported properties are present in the resource. One example of unsupported properties would be a required write-only property that is an array, because a parameter cannot be an array. Another example is an optional write-only property.

  • + ///
  • + ///

    MUTUALLY_EXCLUSIVE_TYPES - One or more required write-only properties are found in the resource, and the type of that property can be any of several types.

  • + ///
+ ///

Currently the resource and property reference documentation does not indicate if a property uses a type of oneOf or anyOf. You need to look at the resource provider schema.

+ ///
+ pub fn r#type(mut self, input: crate::types::WarningType) -> Self { + self.r#type = ::std::option::Option::Some(input); + self + } + ///

The type of this warning. For more information, see IaC generator and write-only properties in the CloudFormation User Guide.

+ ///
    + ///
  • + ///

    MUTUALLY_EXCLUSIVE_PROPERTIES - The resource requires mutually-exclusive write-only properties. The IaC generator selects one set of mutually exclusive properties and converts the included properties into parameters. The parameter names have a suffix OneOf and the parameter descriptions indicate that the corresponding property can be replaced with other exclusive properties.

  • + ///
  • + ///

    UNSUPPORTED_PROPERTIES - Unsupported properties are present in the resource. One example of unsupported properties would be a required write-only property that is an array, because a parameter cannot be an array. Another example is an optional write-only property.

  • + ///
  • + ///

    MUTUALLY_EXCLUSIVE_TYPES - One or more required write-only properties are found in the resource, and the type of that property can be any of several types.

  • + ///
+ ///

Currently the resource and property reference documentation does not indicate if a property uses a type of oneOf or anyOf. You need to look at the resource provider schema.

+ ///
+ pub fn set_type(mut self, input: ::std::option::Option) -> Self { + self.r#type = input; + self + } + ///

The type of this warning. For more information, see IaC generator and write-only properties in the CloudFormation User Guide.

+ ///
    + ///
  • + ///

    MUTUALLY_EXCLUSIVE_PROPERTIES - The resource requires mutually-exclusive write-only properties. The IaC generator selects one set of mutually exclusive properties and converts the included properties into parameters. The parameter names have a suffix OneOf and the parameter descriptions indicate that the corresponding property can be replaced with other exclusive properties.

  • + ///
  • + ///

    UNSUPPORTED_PROPERTIES - Unsupported properties are present in the resource. One example of unsupported properties would be a required write-only property that is an array, because a parameter cannot be an array. Another example is an optional write-only property.

  • + ///
  • + ///

    MUTUALLY_EXCLUSIVE_TYPES - One or more required write-only properties are found in the resource, and the type of that property can be any of several types.

  • + ///
+ ///

Currently the resource and property reference documentation does not indicate if a property uses a type of oneOf or anyOf. You need to look at the resource provider schema.

+ ///
+ pub fn get_type(&self) -> &::std::option::Option { + &self.r#type + } + /// Appends an item to `properties`. + /// + /// To override the contents of this collection use [`set_properties`](Self::set_properties). + /// + ///

The properties of the resource that are impacted by this warning.

+ pub fn properties(mut self, input: crate::types::WarningProperty) -> Self { + let mut v = self.properties.unwrap_or_default(); + v.push(input); + self.properties = ::std::option::Option::Some(v); + self + } + ///

The properties of the resource that are impacted by this warning.

+ pub fn set_properties(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.properties = input; + self + } + ///

The properties of the resource that are impacted by this warning.

+ pub fn get_properties(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.properties + } + /// Consumes the builder and constructs a [`WarningDetail`](crate::types::WarningDetail). + pub fn build(self) -> crate::types::WarningDetail { + crate::types::WarningDetail { + r#type: self.r#type, + properties: self.properties, + } + } +} diff --git a/sdk/cloudformation/src/types/_warning_property.rs b/sdk/cloudformation/src/types/_warning_property.rs new file mode 100644 index 000000000000..37ab685ad996 --- /dev/null +++ b/sdk/cloudformation/src/types/_warning_property.rs @@ -0,0 +1,94 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

A specific property that is impacted by a warning.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct WarningProperty { + ///

The path of the property. For example, if this is for the S3Bucket member of the Code property, the property path would be Code/S3Bucket.

+ pub property_path: ::std::option::Option<::std::string::String>, + ///

If true, the specified property is required.

+ pub required: ::std::option::Option, + ///

The description of the property from the resource provider schema.

+ pub description: ::std::option::Option<::std::string::String>, +} +impl WarningProperty { + ///

The path of the property. For example, if this is for the S3Bucket member of the Code property, the property path would be Code/S3Bucket.

+ pub fn property_path(&self) -> ::std::option::Option<&str> { + self.property_path.as_deref() + } + ///

If true, the specified property is required.

+ pub fn required(&self) -> ::std::option::Option { + self.required + } + ///

The description of the property from the resource provider schema.

+ pub fn description(&self) -> ::std::option::Option<&str> { + self.description.as_deref() + } +} +impl WarningProperty { + /// Creates a new builder-style object to manufacture [`WarningProperty`](crate::types::WarningProperty). + pub fn builder() -> crate::types::builders::WarningPropertyBuilder { + crate::types::builders::WarningPropertyBuilder::default() + } +} + +/// A builder for [`WarningProperty`](crate::types::WarningProperty). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct WarningPropertyBuilder { + pub(crate) property_path: ::std::option::Option<::std::string::String>, + pub(crate) required: ::std::option::Option, + pub(crate) description: ::std::option::Option<::std::string::String>, +} +impl WarningPropertyBuilder { + ///

The path of the property. For example, if this is for the S3Bucket member of the Code property, the property path would be Code/S3Bucket.

+ pub fn property_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.property_path = ::std::option::Option::Some(input.into()); + self + } + ///

The path of the property. For example, if this is for the S3Bucket member of the Code property, the property path would be Code/S3Bucket.

+ pub fn set_property_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.property_path = input; + self + } + ///

The path of the property. For example, if this is for the S3Bucket member of the Code property, the property path would be Code/S3Bucket.

+ pub fn get_property_path(&self) -> &::std::option::Option<::std::string::String> { + &self.property_path + } + ///

If true, the specified property is required.

+ pub fn required(mut self, input: bool) -> Self { + self.required = ::std::option::Option::Some(input); + self + } + ///

If true, the specified property is required.

+ pub fn set_required(mut self, input: ::std::option::Option) -> Self { + self.required = input; + self + } + ///

If true, the specified property is required.

+ pub fn get_required(&self) -> &::std::option::Option { + &self.required + } + ///

The description of the property from the resource provider schema.

+ pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.description = ::std::option::Option::Some(input.into()); + self + } + ///

The description of the property from the resource provider schema.

+ pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.description = input; + self + } + ///

The description of the property from the resource provider schema.

+ pub fn get_description(&self) -> &::std::option::Option<::std::string::String> { + &self.description + } + /// Consumes the builder and constructs a [`WarningProperty`](crate::types::WarningProperty). + pub fn build(self) -> crate::types::WarningProperty { + crate::types::WarningProperty { + property_path: self.property_path, + required: self.required, + description: self.description, + } + } +} diff --git a/sdk/cloudformation/src/types/_warning_type.rs b/sdk/cloudformation/src/types/_warning_type.rs new file mode 100644 index 000000000000..3ac3f203d171 --- /dev/null +++ b/sdk/cloudformation/src/types/_warning_type.rs @@ -0,0 +1,103 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `WarningType`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let warningtype = unimplemented!(); +/// match warningtype { +/// WarningType::MutuallyExclusiveProperties => { /* ... */ }, +/// WarningType::MutuallyExclusiveTypes => { /* ... */ }, +/// WarningType::UnsupportedProperties => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `warningtype` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `WarningType::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `WarningType::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `WarningType::NewFeature` is defined. +/// Specifically, when `warningtype` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `WarningType::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum WarningType { + #[allow(missing_docs)] // documentation missing in model + MutuallyExclusiveProperties, + #[allow(missing_docs)] // documentation missing in model + MutuallyExclusiveTypes, + #[allow(missing_docs)] // documentation missing in model + UnsupportedProperties, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for WarningType { + fn from(s: &str) -> Self { + match s { + "MUTUALLY_EXCLUSIVE_PROPERTIES" => WarningType::MutuallyExclusiveProperties, + "MUTUALLY_EXCLUSIVE_TYPES" => WarningType::MutuallyExclusiveTypes, + "UNSUPPORTED_PROPERTIES" => WarningType::UnsupportedProperties, + other => WarningType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for WarningType { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(WarningType::from(s)) + } +} +impl WarningType { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + WarningType::MutuallyExclusiveProperties => "MUTUALLY_EXCLUSIVE_PROPERTIES", + WarningType::MutuallyExclusiveTypes => "MUTUALLY_EXCLUSIVE_TYPES", + WarningType::UnsupportedProperties => "UNSUPPORTED_PROPERTIES", + WarningType::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["MUTUALLY_EXCLUSIVE_PROPERTIES", "MUTUALLY_EXCLUSIVE_TYPES", "UNSUPPORTED_PROPERTIES"] + } +} +impl ::std::convert::AsRef for WarningType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl WarningType { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} diff --git a/sdk/cloudformation/src/types/builders.rs b/sdk/cloudformation/src/types/builders.rs index a0298dab7eed..f2a79fdb1977 100644 --- a/sdk/cloudformation/src/types/builders.rs +++ b/sdk/cloudformation/src/types/builders.rs @@ -17,6 +17,10 @@ pub use crate::types::_rollback_configuration::RollbackConfigurationBuilder; pub use crate::types::_rollback_trigger::RollbackTriggerBuilder; +pub use crate::types::_template_configuration::TemplateConfigurationBuilder; + +pub use crate::types::_resource_definition::ResourceDefinitionBuilder; + pub use crate::types::_logging_config::LoggingConfigBuilder; pub use crate::types::_type_version_summary::TypeVersionSummaryBuilder; @@ -59,6 +63,14 @@ pub use crate::types::_property_difference::PropertyDifferenceBuilder; pub use crate::types::_physical_resource_id_context_key_value_pair::PhysicalResourceIdContextKeyValuePairBuilder; +pub use crate::types::_resource_scan_summary::ResourceScanSummaryBuilder; + +pub use crate::types::_scanned_resource::ScannedResourceBuilder; + +pub use crate::types::_scanned_resource_identifier::ScannedResourceIdentifierBuilder; + +pub use crate::types::_template_summary::TemplateSummaryBuilder; + pub use crate::types::_export::ExportBuilder; pub use crate::types::_change_set_summary::ChangeSetSummaryBuilder; @@ -99,6 +111,14 @@ pub use crate::types::_stack_instance::StackInstanceBuilder; pub use crate::types::_stack_event::StackEventBuilder; +pub use crate::types::_template_progress::TemplateProgressBuilder; + +pub use crate::types::_resource_detail::ResourceDetailBuilder; + +pub use crate::types::_warning_detail::WarningDetailBuilder; + +pub use crate::types::_warning_property::WarningPropertyBuilder; + pub use crate::types::_change_set_hook::ChangeSetHookBuilder; pub use crate::types::_change_set_hook_target_details::ChangeSetHookTargetDetailsBuilder; diff --git a/sdk/cloudformation/src/types/error.rs b/sdk/cloudformation/src/types/error.rs index d65e0ce149e3..d8b0d8011ac1 100644 --- a/sdk/cloudformation/src/types/error.rs +++ b/sdk/cloudformation/src/types/error.rs @@ -15,19 +15,29 @@ pub use crate::types::error::_token_already_exists_exception::TokenAlreadyExists pub use crate::types::error::_insufficient_capabilities_exception::InsufficientCapabilitiesException; +pub use crate::types::error::_limit_exceeded_exception::LimitExceededException; + +pub use crate::types::error::_generated_template_not_found_exception::GeneratedTemplateNotFoundException; + +pub use crate::types::error::_already_exists_exception::AlreadyExistsException; + pub use crate::types::error::_type_not_found_exception::TypeNotFoundException; pub use crate::types::error::_cfn_registry_exception::CfnRegistryException; pub use crate::types::error::_operation_not_found_exception::OperationNotFoundException; +pub use crate::types::error::_resource_scan_limit_exceeded_exception::ResourceScanLimitExceededException; + +pub use crate::types::error::_resource_scan_in_progress_exception::ResourceScanInProgressException; + pub use crate::types::error::_operation_status_check_failed_exception::OperationStatusCheckFailedException; pub use crate::types::error::_invalid_state_transition_exception::InvalidStateTransitionException; -pub use crate::types::error::_stack_not_found_exception::StackNotFoundException; +pub use crate::types::error::_resource_scan_not_found_exception::ResourceScanNotFoundException; -pub use crate::types::error::_limit_exceeded_exception::LimitExceededException; +pub use crate::types::error::_stack_not_found_exception::StackNotFoundException; pub use crate::types::error::_change_set_not_found_exception::ChangeSetNotFoundException; @@ -35,12 +45,12 @@ pub use crate::types::error::_invalid_change_set_status_exception::InvalidChange pub use crate::types::error::_stack_set_not_empty_exception::StackSetNotEmptyException; +pub use crate::types::error::_concurrent_resources_limit_exceeded_exception::ConcurrentResourcesLimitExceededException; + pub use crate::types::error::_name_already_exists_exception::NameAlreadyExistsException; pub use crate::types::error::_created_but_modified_exception::CreatedButModifiedException; -pub use crate::types::error::_already_exists_exception::AlreadyExistsException; - pub use crate::types::error::_type_configuration_not_found_exception::TypeConfigurationNotFoundException; mod _already_exists_exception; @@ -49,8 +59,12 @@ mod _cfn_registry_exception; mod _change_set_not_found_exception; +mod _concurrent_resources_limit_exceeded_exception; + mod _created_but_modified_exception; +mod _generated_template_not_found_exception; + mod _insufficient_capabilities_exception; mod _invalid_change_set_status_exception; @@ -71,6 +85,12 @@ mod _operation_not_found_exception; mod _operation_status_check_failed_exception; +mod _resource_scan_in_progress_exception; + +mod _resource_scan_limit_exceeded_exception; + +mod _resource_scan_not_found_exception; + mod _stack_instance_not_found_exception; mod _stack_not_found_exception; diff --git a/sdk/cloudformation/src/types/error/_concurrent_resources_limit_exceeded_exception.rs b/sdk/cloudformation/src/types/error/_concurrent_resources_limit_exceeded_exception.rs new file mode 100644 index 000000000000..415963431e3f --- /dev/null +++ b/sdk/cloudformation/src/types/error/_concurrent_resources_limit_exceeded_exception.rs @@ -0,0 +1,87 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

No more than 5 generated templates can be in an InProgress or Pending status at one time. This error is also returned if a generated template that is in an InProgress or Pending status is attempted to be updated or deleted.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ConcurrentResourcesLimitExceededException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::option::Option<::std::string::String>, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ConcurrentResourcesLimitExceededException { + /// Returns the error message. + pub fn message(&self) -> ::std::option::Option<&str> { + self.message.as_deref() + } +} +impl ::std::fmt::Display for ConcurrentResourcesLimitExceededException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ConcurrentResourcesLimitExceededException")?; + if let ::std::option::Option::Some(inner_1) = &self.message { + { + ::std::write!(f, ": {}", inner_1)?; + } + } + Ok(()) + } +} +impl ::std::error::Error for ConcurrentResourcesLimitExceededException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ConcurrentResourcesLimitExceededException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConcurrentResourcesLimitExceededException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ConcurrentResourcesLimitExceededException { + /// Creates a new builder-style object to manufacture [`ConcurrentResourcesLimitExceededException`](crate::types::error::ConcurrentResourcesLimitExceededException). + pub fn builder() -> crate::types::error::builders::ConcurrentResourcesLimitExceededExceptionBuilder { + crate::types::error::builders::ConcurrentResourcesLimitExceededExceptionBuilder::default() + } +} + +/// A builder for [`ConcurrentResourcesLimitExceededException`](crate::types::error::ConcurrentResourcesLimitExceededException). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ConcurrentResourcesLimitExceededExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ConcurrentResourcesLimitExceededExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ConcurrentResourcesLimitExceededException`](crate::types::error::ConcurrentResourcesLimitExceededException). + pub fn build(self) -> crate::types::error::ConcurrentResourcesLimitExceededException { + crate::types::error::ConcurrentResourcesLimitExceededException { + message: self.message, + meta: self.meta.unwrap_or_default(), + } + } +} diff --git a/sdk/cloudformation/src/types/error/_generated_template_not_found_exception.rs b/sdk/cloudformation/src/types/error/_generated_template_not_found_exception.rs new file mode 100644 index 000000000000..2de9f8f1dcbe --- /dev/null +++ b/sdk/cloudformation/src/types/error/_generated_template_not_found_exception.rs @@ -0,0 +1,87 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The generated template was not found.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GeneratedTemplateNotFoundException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::option::Option<::std::string::String>, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl GeneratedTemplateNotFoundException { + /// Returns the error message. + pub fn message(&self) -> ::std::option::Option<&str> { + self.message.as_deref() + } +} +impl ::std::fmt::Display for GeneratedTemplateNotFoundException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "GeneratedTemplateNotFoundException")?; + if let ::std::option::Option::Some(inner_1) = &self.message { + { + ::std::write!(f, ": {}", inner_1)?; + } + } + Ok(()) + } +} +impl ::std::error::Error for GeneratedTemplateNotFoundException {} +impl ::aws_types::request_id::RequestId for crate::types::error::GeneratedTemplateNotFoundException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GeneratedTemplateNotFoundException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl GeneratedTemplateNotFoundException { + /// Creates a new builder-style object to manufacture [`GeneratedTemplateNotFoundException`](crate::types::error::GeneratedTemplateNotFoundException). + pub fn builder() -> crate::types::error::builders::GeneratedTemplateNotFoundExceptionBuilder { + crate::types::error::builders::GeneratedTemplateNotFoundExceptionBuilder::default() + } +} + +/// A builder for [`GeneratedTemplateNotFoundException`](crate::types::error::GeneratedTemplateNotFoundException). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct GeneratedTemplateNotFoundExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl GeneratedTemplateNotFoundExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`GeneratedTemplateNotFoundException`](crate::types::error::GeneratedTemplateNotFoundException). + pub fn build(self) -> crate::types::error::GeneratedTemplateNotFoundException { + crate::types::error::GeneratedTemplateNotFoundException { + message: self.message, + meta: self.meta.unwrap_or_default(), + } + } +} diff --git a/sdk/cloudformation/src/types/error/_resource_scan_in_progress_exception.rs b/sdk/cloudformation/src/types/error/_resource_scan_in_progress_exception.rs new file mode 100644 index 000000000000..20c9a690175e --- /dev/null +++ b/sdk/cloudformation/src/types/error/_resource_scan_in_progress_exception.rs @@ -0,0 +1,87 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

A resource scan is currently in progress. Only one can be run at a time for an account in a Region.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ResourceScanInProgressException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::option::Option<::std::string::String>, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ResourceScanInProgressException { + /// Returns the error message. + pub fn message(&self) -> ::std::option::Option<&str> { + self.message.as_deref() + } +} +impl ::std::fmt::Display for ResourceScanInProgressException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ResourceScanInProgressException")?; + if let ::std::option::Option::Some(inner_1) = &self.message { + { + ::std::write!(f, ": {}", inner_1)?; + } + } + Ok(()) + } +} +impl ::std::error::Error for ResourceScanInProgressException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ResourceScanInProgressException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResourceScanInProgressException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ResourceScanInProgressException { + /// Creates a new builder-style object to manufacture [`ResourceScanInProgressException`](crate::types::error::ResourceScanInProgressException). + pub fn builder() -> crate::types::error::builders::ResourceScanInProgressExceptionBuilder { + crate::types::error::builders::ResourceScanInProgressExceptionBuilder::default() + } +} + +/// A builder for [`ResourceScanInProgressException`](crate::types::error::ResourceScanInProgressException). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ResourceScanInProgressExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ResourceScanInProgressExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ResourceScanInProgressException`](crate::types::error::ResourceScanInProgressException). + pub fn build(self) -> crate::types::error::ResourceScanInProgressException { + crate::types::error::ResourceScanInProgressException { + message: self.message, + meta: self.meta.unwrap_or_default(), + } + } +} diff --git a/sdk/cloudformation/src/types/error/_resource_scan_limit_exceeded_exception.rs b/sdk/cloudformation/src/types/error/_resource_scan_limit_exceeded_exception.rs new file mode 100644 index 000000000000..fdbad136b37a --- /dev/null +++ b/sdk/cloudformation/src/types/error/_resource_scan_limit_exceeded_exception.rs @@ -0,0 +1,95 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The limit on resource scans has been exceeded. Reasons include:

+///
    +///
  • +///

    Exceeded the daily quota for resource scans.

  • +///
  • +///

    A resource scan recently failed. You must wait 10 minutes before starting a new resource scan.

  • +///
  • +///

    The last resource scan failed after exceeding 100,000 resources. When this happens, you must wait 24 hours before starting a new resource scan.

  • +///
+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ResourceScanLimitExceededException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::option::Option<::std::string::String>, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ResourceScanLimitExceededException { + /// Returns the error message. + pub fn message(&self) -> ::std::option::Option<&str> { + self.message.as_deref() + } +} +impl ::std::fmt::Display for ResourceScanLimitExceededException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ResourceScanLimitExceededException")?; + if let ::std::option::Option::Some(inner_1) = &self.message { + { + ::std::write!(f, ": {}", inner_1)?; + } + } + Ok(()) + } +} +impl ::std::error::Error for ResourceScanLimitExceededException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ResourceScanLimitExceededException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResourceScanLimitExceededException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ResourceScanLimitExceededException { + /// Creates a new builder-style object to manufacture [`ResourceScanLimitExceededException`](crate::types::error::ResourceScanLimitExceededException). + pub fn builder() -> crate::types::error::builders::ResourceScanLimitExceededExceptionBuilder { + crate::types::error::builders::ResourceScanLimitExceededExceptionBuilder::default() + } +} + +/// A builder for [`ResourceScanLimitExceededException`](crate::types::error::ResourceScanLimitExceededException). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ResourceScanLimitExceededExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ResourceScanLimitExceededExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ResourceScanLimitExceededException`](crate::types::error::ResourceScanLimitExceededException). + pub fn build(self) -> crate::types::error::ResourceScanLimitExceededException { + crate::types::error::ResourceScanLimitExceededException { + message: self.message, + meta: self.meta.unwrap_or_default(), + } + } +} diff --git a/sdk/cloudformation/src/types/error/_resource_scan_not_found_exception.rs b/sdk/cloudformation/src/types/error/_resource_scan_not_found_exception.rs new file mode 100644 index 000000000000..d46ba129f898 --- /dev/null +++ b/sdk/cloudformation/src/types/error/_resource_scan_not_found_exception.rs @@ -0,0 +1,87 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The resource scan was not found.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ResourceScanNotFoundException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::option::Option<::std::string::String>, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ResourceScanNotFoundException { + /// Returns the error message. + pub fn message(&self) -> ::std::option::Option<&str> { + self.message.as_deref() + } +} +impl ::std::fmt::Display for ResourceScanNotFoundException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ResourceScanNotFoundException")?; + if let ::std::option::Option::Some(inner_1) = &self.message { + { + ::std::write!(f, ": {}", inner_1)?; + } + } + Ok(()) + } +} +impl ::std::error::Error for ResourceScanNotFoundException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ResourceScanNotFoundException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResourceScanNotFoundException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ResourceScanNotFoundException { + /// Creates a new builder-style object to manufacture [`ResourceScanNotFoundException`](crate::types::error::ResourceScanNotFoundException). + pub fn builder() -> crate::types::error::builders::ResourceScanNotFoundExceptionBuilder { + crate::types::error::builders::ResourceScanNotFoundExceptionBuilder::default() + } +} + +/// A builder for [`ResourceScanNotFoundException`](crate::types::error::ResourceScanNotFoundException). +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ResourceScanNotFoundExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ResourceScanNotFoundExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ResourceScanNotFoundException`](crate::types::error::ResourceScanNotFoundException). + pub fn build(self) -> crate::types::error::ResourceScanNotFoundException { + crate::types::error::ResourceScanNotFoundException { + message: self.message, + meta: self.meta.unwrap_or_default(), + } + } +} diff --git a/sdk/cloudformation/src/types/error/builders.rs b/sdk/cloudformation/src/types/error/builders.rs index db2b66a129a8..8667f98cd8d1 100644 --- a/sdk/cloudformation/src/types/error/builders.rs +++ b/sdk/cloudformation/src/types/error/builders.rs @@ -15,19 +15,29 @@ pub use crate::types::error::_token_already_exists_exception::TokenAlreadyExists pub use crate::types::error::_insufficient_capabilities_exception::InsufficientCapabilitiesExceptionBuilder; +pub use crate::types::error::_limit_exceeded_exception::LimitExceededExceptionBuilder; + +pub use crate::types::error::_generated_template_not_found_exception::GeneratedTemplateNotFoundExceptionBuilder; + +pub use crate::types::error::_already_exists_exception::AlreadyExistsExceptionBuilder; + pub use crate::types::error::_type_not_found_exception::TypeNotFoundExceptionBuilder; pub use crate::types::error::_cfn_registry_exception::CfnRegistryExceptionBuilder; pub use crate::types::error::_operation_not_found_exception::OperationNotFoundExceptionBuilder; +pub use crate::types::error::_resource_scan_limit_exceeded_exception::ResourceScanLimitExceededExceptionBuilder; + +pub use crate::types::error::_resource_scan_in_progress_exception::ResourceScanInProgressExceptionBuilder; + pub use crate::types::error::_operation_status_check_failed_exception::OperationStatusCheckFailedExceptionBuilder; pub use crate::types::error::_invalid_state_transition_exception::InvalidStateTransitionExceptionBuilder; -pub use crate::types::error::_stack_not_found_exception::StackNotFoundExceptionBuilder; +pub use crate::types::error::_resource_scan_not_found_exception::ResourceScanNotFoundExceptionBuilder; -pub use crate::types::error::_limit_exceeded_exception::LimitExceededExceptionBuilder; +pub use crate::types::error::_stack_not_found_exception::StackNotFoundExceptionBuilder; pub use crate::types::error::_change_set_not_found_exception::ChangeSetNotFoundExceptionBuilder; @@ -35,10 +45,10 @@ pub use crate::types::error::_invalid_change_set_status_exception::InvalidChange pub use crate::types::error::_stack_set_not_empty_exception::StackSetNotEmptyExceptionBuilder; +pub use crate::types::error::_concurrent_resources_limit_exceeded_exception::ConcurrentResourcesLimitExceededExceptionBuilder; + pub use crate::types::error::_name_already_exists_exception::NameAlreadyExistsExceptionBuilder; pub use crate::types::error::_created_but_modified_exception::CreatedButModifiedExceptionBuilder; -pub use crate::types::error::_already_exists_exception::AlreadyExistsExceptionBuilder; - pub use crate::types::error::_type_configuration_not_found_exception::TypeConfigurationNotFoundExceptionBuilder; diff --git a/sdk/elasticloadbalancingv2/Cargo.toml b/sdk/elasticloadbalancingv2/Cargo.toml index 3b29d73a8b6d..14d704376912 100644 --- a/sdk/elasticloadbalancingv2/Cargo.toml +++ b/sdk/elasticloadbalancingv2/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-elasticloadbalancingv2" -version = "1.12.0" +version = "1.13.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for Elastic Load Balancing" edition = "2021" diff --git a/sdk/elasticloadbalancingv2/README.md b/sdk/elasticloadbalancingv2/README.md index adbc2e9377b0..8866c8aa32ac 100644 --- a/sdk/elasticloadbalancingv2/README.md +++ b/sdk/elasticloadbalancingv2/README.md @@ -23,7 +23,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.4", features = ["behavior-version-latest"] } -aws-sdk-elasticloadbalancingv2 = "1.12.0" +aws-sdk-elasticloadbalancingv2 = "1.13.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/elasticloadbalancingv2/src/client/create_load_balancer.rs b/sdk/elasticloadbalancingv2/src/client/create_load_balancer.rs index a83f968c038b..b35d6331176f 100644 --- a/sdk/elasticloadbalancingv2/src/client/create_load_balancer.rs +++ b/sdk/elasticloadbalancingv2/src/client/create_load_balancer.rs @@ -4,8 +4,8 @@ impl super::Client { /// /// - The fluent builder is configurable: /// - [`name(impl Into)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::name) / [`set_name(Option)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::set_name):
required: **true**

The name of the load balancer.

This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, must not begin or end with a hyphen, and must not begin with "internal-".


- /// - [`subnets(impl Into)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::subnets) / [`set_subnets(Option>)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::set_subnets):
required: **false**

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

[Network Load Balancers] You can specify subnets from one or more Availability Zones.

[Gateway Load Balancers] You can specify subnets from one or more Availability Zones.


- /// - [`subnet_mappings(SubnetMapping)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::subnet_mappings) / [`set_subnet_mappings(Option>)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::set_subnet_mappings):
required: **false**

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

[Network Load Balancers] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.

[Gateway Load Balancers] You can specify subnets from one or more Availability Zones. You cannot specify Elastic IP addresses for your subnets.


+ /// - [`subnets(impl Into)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::subnets) / [`set_subnets(Option>)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::set_subnets):
required: **false**

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

[Network Load Balancers] You can specify subnets from one or more Availability Zones.

[Gateway Load Balancers] You can specify subnets from one or more Availability Zones.


+ /// - [`subnet_mappings(SubnetMapping)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::subnet_mappings) / [`set_subnet_mappings(Option>)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::set_subnet_mappings):
required: **false**

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

[Network Load Balancers] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.

[Gateway Load Balancers] You can specify subnets from one or more Availability Zones. You cannot specify Elastic IP addresses for your subnets.


/// - [`security_groups(impl Into)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::security_groups) / [`set_security_groups(Option>)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::set_security_groups):
required: **false**

[Application Load Balancers and Network Load Balancers] The IDs of the security groups for the load balancer.


/// - [`scheme(LoadBalancerSchemeEnum)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::scheme) / [`set_scheme(Option)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::set_scheme):
required: **false**

The nodes of an Internet-facing load balancer have public IP addresses. The DNS name of an Internet-facing load balancer is publicly resolvable to the public IP addresses of the nodes. Therefore, Internet-facing load balancers can route requests from clients over the internet.

The nodes of an internal load balancer have only private IP addresses. The DNS name of an internal load balancer is publicly resolvable to the private IP addresses of the nodes. Therefore, internal load balancers can route requests only from clients with access to the VPC for the load balancer.

The default is an Internet-facing load balancer.

You cannot specify a scheme for a Gateway Load Balancer.


/// - [`tags(Tag)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::tags) / [`set_tags(Option>)`](crate::operation::create_load_balancer::builders::CreateLoadBalancerFluentBuilder::set_tags):
required: **false**

The tags to assign to the load balancer.


diff --git a/sdk/elasticloadbalancingv2/src/lib.rs b/sdk/elasticloadbalancingv2/src/lib.rs index 8b9531ec38c8..79f10cd571cc 100644 --- a/sdk/elasticloadbalancingv2/src/lib.rs +++ b/sdk/elasticloadbalancingv2/src/lib.rs @@ -38,7 +38,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.4", features = ["behavior-version-latest"] } -//! aws-sdk-elasticloadbalancingv2 = "1.12.0" +//! aws-sdk-elasticloadbalancingv2 = "1.13.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/elasticloadbalancingv2/src/operation/create_load_balancer/_create_load_balancer_input.rs b/sdk/elasticloadbalancingv2/src/operation/create_load_balancer/_create_load_balancer_input.rs index 815a21365162..c4fbcdb8f82c 100644 --- a/sdk/elasticloadbalancingv2/src/operation/create_load_balancer/_create_load_balancer_input.rs +++ b/sdk/elasticloadbalancingv2/src/operation/create_load_balancer/_create_load_balancer_input.rs @@ -6,14 +6,14 @@ pub struct CreateLoadBalancerInput { ///

The name of the load balancer.

///

This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, must not begin or end with a hyphen, and must not begin with "internal-".

pub name: ::std::option::Option<::std::string::String>, - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

///

[Network Load Balancers] You can specify subnets from one or more Availability Zones.

///

[Gateway Load Balancers] You can specify subnets from one or more Availability Zones.

pub subnets: ::std::option::Option<::std::vec::Vec<::std::string::String>>, - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -42,7 +42,7 @@ impl CreateLoadBalancerInput { pub fn name(&self) -> ::std::option::Option<&str> { self.name.as_deref() } - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -53,7 +53,7 @@ impl CreateLoadBalancerInput { pub fn subnets(&self) -> &[::std::string::String] { self.subnets.as_deref().unwrap_or_default() } - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -140,7 +140,7 @@ impl CreateLoadBalancerInputBuilder { /// /// To override the contents of this collection use [`set_subnets`](Self::set_subnets). /// - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -152,7 +152,7 @@ impl CreateLoadBalancerInputBuilder { self.subnets = ::std::option::Option::Some(v); self } - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -162,7 +162,7 @@ impl CreateLoadBalancerInputBuilder { self.subnets = input; self } - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -175,7 +175,7 @@ impl CreateLoadBalancerInputBuilder { /// /// To override the contents of this collection use [`set_subnet_mappings`](Self::set_subnet_mappings). /// - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -187,7 +187,7 @@ impl CreateLoadBalancerInputBuilder { self.subnet_mappings = ::std::option::Option::Some(v); self } - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -197,7 +197,7 @@ impl CreateLoadBalancerInputBuilder { self.subnet_mappings = input; self } - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

diff --git a/sdk/elasticloadbalancingv2/src/operation/create_load_balancer/builders.rs b/sdk/elasticloadbalancingv2/src/operation/create_load_balancer/builders.rs index c0c74da7379d..8fdd174cbbe2 100644 --- a/sdk/elasticloadbalancingv2/src/operation/create_load_balancer/builders.rs +++ b/sdk/elasticloadbalancingv2/src/operation/create_load_balancer/builders.rs @@ -139,7 +139,7 @@ impl CreateLoadBalancerFluentBuilder { /// /// To override the contents of this collection use [`set_subnets`](Self::set_subnets). /// - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -149,7 +149,7 @@ impl CreateLoadBalancerFluentBuilder { self.inner = self.inner.subnets(input.into()); self } - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -159,7 +159,7 @@ impl CreateLoadBalancerFluentBuilder { self.inner = self.inner.set_subnets(input); self } - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -172,7 +172,7 @@ impl CreateLoadBalancerFluentBuilder { /// /// To override the contents of this collection use [`set_subnet_mappings`](Self::set_subnet_mappings). /// - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -182,7 +182,7 @@ impl CreateLoadBalancerFluentBuilder { self.inner = self.inner.subnet_mappings(input); self } - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

@@ -192,7 +192,7 @@ impl CreateLoadBalancerFluentBuilder { self.inner = self.inner.set_subnet_mappings(input); self } - ///

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

+ ///

The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings, but not both.

///

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

///

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

///

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

diff --git a/sdk/elasticloadbalancingv2/src/types/_source_ip_condition_config.rs b/sdk/elasticloadbalancingv2/src/types/_source_ip_condition_config.rs index a74e8686aaf0..079441b34cc7 100644 --- a/sdk/elasticloadbalancingv2/src/types/_source_ip_condition_config.rs +++ b/sdk/elasticloadbalancingv2/src/types/_source_ip_condition_config.rs @@ -7,11 +7,13 @@ pub struct SourceIpConditionConfig { ///

The source IP addresses, in CIDR format. You can use both IPv4 and IPv6 addresses. Wildcards are not supported.

///

If you specify multiple addresses, the condition is satisfied if the source IP address of the request matches one of the CIDR blocks. This condition is not satisfied by the addresses in the X-Forwarded-For header. To search for addresses in the X-Forwarded-For header, use HttpHeaderConditionConfig.

+ ///

The total number of values must be less than, or equal to five.

pub values: ::std::option::Option<::std::vec::Vec<::std::string::String>>, } impl SourceIpConditionConfig { ///

The source IP addresses, in CIDR format. You can use both IPv4 and IPv6 addresses. Wildcards are not supported.

///

If you specify multiple addresses, the condition is satisfied if the source IP address of the request matches one of the CIDR blocks. This condition is not satisfied by the addresses in the X-Forwarded-For header. To search for addresses in the X-Forwarded-For header, use HttpHeaderConditionConfig.

+ ///

The total number of values must be less than, or equal to five.

/// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.values.is_none()`. pub fn values(&self) -> &[::std::string::String] { @@ -38,6 +40,7 @@ impl SourceIpConditionConfigBuilder { /// ///

The source IP addresses, in CIDR format. You can use both IPv4 and IPv6 addresses. Wildcards are not supported.

///

If you specify multiple addresses, the condition is satisfied if the source IP address of the request matches one of the CIDR blocks. This condition is not satisfied by the addresses in the X-Forwarded-For header. To search for addresses in the X-Forwarded-For header, use HttpHeaderConditionConfig.

+ ///

The total number of values must be less than, or equal to five.

pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { let mut v = self.values.unwrap_or_default(); v.push(input.into()); @@ -46,12 +49,14 @@ impl SourceIpConditionConfigBuilder { } ///

The source IP addresses, in CIDR format. You can use both IPv4 and IPv6 addresses. Wildcards are not supported.

///

If you specify multiple addresses, the condition is satisfied if the source IP address of the request matches one of the CIDR blocks. This condition is not satisfied by the addresses in the X-Forwarded-For header. To search for addresses in the X-Forwarded-For header, use HttpHeaderConditionConfig.

+ ///

The total number of values must be less than, or equal to five.

pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { self.values = input; self } ///

The source IP addresses, in CIDR format. You can use both IPv4 and IPv6 addresses. Wildcards are not supported.

///

If you specify multiple addresses, the condition is satisfied if the source IP address of the request matches one of the CIDR blocks. This condition is not satisfied by the addresses in the X-Forwarded-For header. To search for addresses in the X-Forwarded-For header, use HttpHeaderConditionConfig.

+ ///

The total number of values must be less than, or equal to five.

pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { &self.values } diff --git a/sdk/elasticloadbalancingv2/src/types/_target_group_attribute.rs b/sdk/elasticloadbalancingv2/src/types/_target_group_attribute.rs index f70b3c627566..08a9c40d32e5 100644 --- a/sdk/elasticloadbalancingv2/src/types/_target_group_attribute.rs +++ b/sdk/elasticloadbalancingv2/src/types/_target_group_attribute.rs @@ -65,6 +65,9 @@ pub struct TargetGroupAttribute { ///

proxy_protocol_v2.enabled - Indicates whether Proxy Protocol version 2 is enabled. The value is true or false. The default is false.

///
  • ///

    target_health_state.unhealthy.connection_termination.enabled - Indicates whether the load balancer terminates connections to unhealthy targets. The value is true or false. The default is true.

  • + ///
  • + ///

    target_health_state.unhealthy.draining_interval_seconds - The amount of time for Elastic Load Balancing to wait before changing the state of an unhealthy target from unhealthy.draining to unhealthy. The range is 0-360000 seconds. The default value is 0 seconds.

    + ///

    Note: This attribute can only be configured when target_health_state.unhealthy.connection_termination.enabled is false.

  • /// ///

    The following attributes are supported only by Gateway Load Balancers:

    ///
      @@ -139,6 +142,9 @@ impl TargetGroupAttribute { ///

      proxy_protocol_v2.enabled - Indicates whether Proxy Protocol version 2 is enabled. The value is true or false. The default is false.

      ///
    • ///

      target_health_state.unhealthy.connection_termination.enabled - Indicates whether the load balancer terminates connections to unhealthy targets. The value is true or false. The default is true.

    • + ///
    • + ///

      target_health_state.unhealthy.draining_interval_seconds - The amount of time for Elastic Load Balancing to wait before changing the state of an unhealthy target from unhealthy.draining to unhealthy. The range is 0-360000 seconds. The default value is 0 seconds.

      + ///

      Note: This attribute can only be configured when target_health_state.unhealthy.connection_termination.enabled is false.

    • ///
    ///

    The following attributes are supported only by Gateway Load Balancers:

    ///
      @@ -231,6 +237,9 @@ impl TargetGroupAttributeBuilder { ///

      proxy_protocol_v2.enabled - Indicates whether Proxy Protocol version 2 is enabled. The value is true or false. The default is false.

      ///
    • ///

      target_health_state.unhealthy.connection_termination.enabled - Indicates whether the load balancer terminates connections to unhealthy targets. The value is true or false. The default is true.

    • + ///
    • + ///

      target_health_state.unhealthy.draining_interval_seconds - The amount of time for Elastic Load Balancing to wait before changing the state of an unhealthy target from unhealthy.draining to unhealthy. The range is 0-360000 seconds. The default value is 0 seconds.

      + ///

      Note: This attribute can only be configured when target_health_state.unhealthy.connection_termination.enabled is false.

    • ///
    ///

    The following attributes are supported only by Gateway Load Balancers:

    ///
      @@ -304,6 +313,9 @@ impl TargetGroupAttributeBuilder { ///

      proxy_protocol_v2.enabled - Indicates whether Proxy Protocol version 2 is enabled. The value is true or false. The default is false.

      ///
    • ///

      target_health_state.unhealthy.connection_termination.enabled - Indicates whether the load balancer terminates connections to unhealthy targets. The value is true or false. The default is true.

    • + ///
    • + ///

      target_health_state.unhealthy.draining_interval_seconds - The amount of time for Elastic Load Balancing to wait before changing the state of an unhealthy target from unhealthy.draining to unhealthy. The range is 0-360000 seconds. The default value is 0 seconds.

      + ///

      Note: This attribute can only be configured when target_health_state.unhealthy.connection_termination.enabled is false.

    • ///
    ///

    The following attributes are supported only by Gateway Load Balancers:

    ///
      @@ -377,6 +389,9 @@ impl TargetGroupAttributeBuilder { ///

      proxy_protocol_v2.enabled - Indicates whether Proxy Protocol version 2 is enabled. The value is true or false. The default is false.

      ///
    • ///

      target_health_state.unhealthy.connection_termination.enabled - Indicates whether the load balancer terminates connections to unhealthy targets. The value is true or false. The default is true.

    • + ///
    • + ///

      target_health_state.unhealthy.draining_interval_seconds - The amount of time for Elastic Load Balancing to wait before changing the state of an unhealthy target from unhealthy.draining to unhealthy. The range is 0-360000 seconds. The default value is 0 seconds.

      + ///

      Note: This attribute can only be configured when target_health_state.unhealthy.connection_termination.enabled is false.

    • ///
    ///

    The following attributes are supported only by Gateway Load Balancers:

    ///
      diff --git a/sdk/elasticloadbalancingv2/src/types/_target_health_state_enum.rs b/sdk/elasticloadbalancingv2/src/types/_target_health_state_enum.rs index 5ce69d18da39..29db0bd33ec1 100644 --- a/sdk/elasticloadbalancingv2/src/types/_target_health_state_enum.rs +++ b/sdk/elasticloadbalancingv2/src/types/_target_health_state_enum.rs @@ -17,6 +17,7 @@ /// TargetHealthStateEnum::Initial => { /* ... */ }, /// TargetHealthStateEnum::Unavailable => { /* ... */ }, /// TargetHealthStateEnum::Unhealthy => { /* ... */ }, +/// TargetHealthStateEnum::UnhealthyDraining => { /* ... */ }, /// TargetHealthStateEnum::Unused => { /* ... */ }, /// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, /// _ => { /* ... */ }, @@ -56,6 +57,8 @@ pub enum TargetHealthStateEnum { #[allow(missing_docs)] // documentation missing in model Unhealthy, #[allow(missing_docs)] // documentation missing in model + UnhealthyDraining, + #[allow(missing_docs)] // documentation missing in model Unused, /// `Unknown` contains new variants that have been added since this code was generated. #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] @@ -69,6 +72,7 @@ impl ::std::convert::From<&str> for TargetHealthStateEnum { "initial" => TargetHealthStateEnum::Initial, "unavailable" => TargetHealthStateEnum::Unavailable, "unhealthy" => TargetHealthStateEnum::Unhealthy, + "unhealthy.draining" => TargetHealthStateEnum::UnhealthyDraining, "unused" => TargetHealthStateEnum::Unused, other => TargetHealthStateEnum::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), } @@ -90,13 +94,22 @@ impl TargetHealthStateEnum { TargetHealthStateEnum::Initial => "initial", TargetHealthStateEnum::Unavailable => "unavailable", TargetHealthStateEnum::Unhealthy => "unhealthy", + TargetHealthStateEnum::UnhealthyDraining => "unhealthy.draining", TargetHealthStateEnum::Unused => "unused", TargetHealthStateEnum::Unknown(value) => value.as_str(), } } /// Returns all the `&str` representations of the enum members. pub const fn values() -> &'static [&'static str] { - &["draining", "healthy", "initial", "unavailable", "unhealthy", "unused"] + &[ + "draining", + "healthy", + "initial", + "unavailable", + "unhealthy", + "unhealthy.draining", + "unused", + ] } } impl ::std::convert::AsRef for TargetHealthStateEnum { diff --git a/sdk/glue/Cargo.toml b/sdk/glue/Cargo.toml index ab4860b8fa7b..7576950d9573 100644 --- a/sdk/glue/Cargo.toml +++ b/sdk/glue/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-glue" -version = "1.14.0" +version = "1.15.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWS Glue" edition = "2021" diff --git a/sdk/glue/README.md b/sdk/glue/README.md index 60c1acc58d3f..8e1352044d0c 100644 --- a/sdk/glue/README.md +++ b/sdk/glue/README.md @@ -14,7 +14,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.4", features = ["behavior-version-latest"] } -aws-sdk-glue = "1.14.0" +aws-sdk-glue = "1.15.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/glue/src/lib.rs b/sdk/glue/src/lib.rs index 53122ef1af87..f9c8adbe11e2 100644 --- a/sdk/glue/src/lib.rs +++ b/sdk/glue/src/lib.rs @@ -29,7 +29,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.4", features = ["behavior-version-latest"] } -//! aws-sdk-glue = "1.14.0" +//! aws-sdk-glue = "1.15.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/glue/src/types/_job_command.rs b/sdk/glue/src/types/_job_command.rs index dc1d105e7195..7e6841642da8 100644 --- a/sdk/glue/src/types/_job_command.rs +++ b/sdk/glue/src/types/_job_command.rs @@ -10,7 +10,7 @@ pub struct JobCommand { pub script_location: ::std::option::Option<::std::string::String>, ///

      The Python version being used to run a Python shell job. Allowed values are 2 or 3.

      pub python_version: ::std::option::Option<::std::string::String>, - ///

      In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional libraries available in your environment. This field is not used in other job types. For supported runtime environment values, see Working with Ray jobs in the Glue Developer Guide.

      + ///

      In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional libraries available in your environment. This field is not used in other job types. For supported runtime environment values, see Supported Ray runtime environments in the Glue Developer Guide.

      pub runtime: ::std::option::Option<::std::string::String>, } impl JobCommand { @@ -26,7 +26,7 @@ impl JobCommand { pub fn python_version(&self) -> ::std::option::Option<&str> { self.python_version.as_deref() } - ///

      In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional libraries available in your environment. This field is not used in other job types. For supported runtime environment values, see Working with Ray jobs in the Glue Developer Guide.

      + ///

      In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional libraries available in your environment. This field is not used in other job types. For supported runtime environment values, see Supported Ray runtime environments in the Glue Developer Guide.

      pub fn runtime(&self) -> ::std::option::Option<&str> { self.runtime.as_deref() } @@ -90,17 +90,17 @@ impl JobCommandBuilder { pub fn get_python_version(&self) -> &::std::option::Option<::std::string::String> { &self.python_version } - ///

      In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional libraries available in your environment. This field is not used in other job types. For supported runtime environment values, see Working with Ray jobs in the Glue Developer Guide.

      + ///

      In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional libraries available in your environment. This field is not used in other job types. For supported runtime environment values, see Supported Ray runtime environments in the Glue Developer Guide.

      pub fn runtime(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.runtime = ::std::option::Option::Some(input.into()); self } - ///

      In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional libraries available in your environment. This field is not used in other job types. For supported runtime environment values, see Working with Ray jobs in the Glue Developer Guide.

      + ///

      In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional libraries available in your environment. This field is not used in other job types. For supported runtime environment values, see Supported Ray runtime environments in the Glue Developer Guide.

      pub fn set_runtime(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.runtime = input; self } - ///

      In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional libraries available in your environment. This field is not used in other job types. For supported runtime environment values, see Working with Ray jobs in the Glue Developer Guide.

      + ///

      In Ray jobs, Runtime is used to specify the versions of Ray, Python and additional libraries available in your environment. This field is not used in other job types. For supported runtime environment values, see Supported Ray runtime environments in the Glue Developer Guide.

      pub fn get_runtime(&self) -> &::std::option::Option<::std::string::String> { &self.runtime } diff --git a/sdk/ssm/Cargo.toml b/sdk/ssm/Cargo.toml index 9d0c88390650..8140298229fc 100644 --- a/sdk/ssm/Cargo.toml +++ b/sdk/ssm/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-ssm" -version = "1.12.0" +version = "1.13.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for Amazon Simple Systems Manager (SSM)" edition = "2021" diff --git a/sdk/ssm/README.md b/sdk/ssm/README.md index c8307228f868..75a4f6cc0b69 100644 --- a/sdk/ssm/README.md +++ b/sdk/ssm/README.md @@ -22,7 +22,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.4", features = ["behavior-version-latest"] } -aws-sdk-ssm = "1.12.0" +aws-sdk-ssm = "1.13.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/ssm/src/client/create_association.rs b/sdk/ssm/src/client/create_association.rs index b517af264cdb..9d21a0da38df 100644 --- a/sdk/ssm/src/client/create_association.rs +++ b/sdk/ssm/src/client/create_association.rs @@ -20,6 +20,7 @@ impl super::Client { /// - [`calendar_names(impl Into)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::calendar_names) / [`set_calendar_names(Option>)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::set_calendar_names):
      required: **false**

      The names or Amazon Resource Names (ARNs) of the Change Calendar type documents you want to gate your associations under. The associations only run when that change calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.


      /// - [`target_locations(TargetLocation)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::target_locations) / [`set_target_locations(Option>)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::set_target_locations):
      required: **false**

      A location is a combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association. Use this action to create an association in multiple Regions and multiple accounts.


      /// - [`schedule_offset(i32)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::schedule_offset) / [`set_schedule_offset(Option)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::set_schedule_offset):
      required: **false**

      Number of days to wait after the scheduled day to run an association. For example, if you specified a cron schedule of cron(0 0 ? * THU#2 *), you could specify an offset of 3 to run the association each Sunday after the second Thursday of the month. For more information about cron schedules for associations, see Reference: Cron and rate expressions for Systems Manager in the Amazon Web Services Systems Manager User Guide.

      To use offsets, you must specify the ApplyOnlyAtCronInterval parameter. This option tells the system not to run an association immediately after you create it.


      + /// - [`duration(i32)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::duration) / [`set_duration(Option)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::set_duration):
      required: **false**

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      The Duration parameter applies only when both these conditions are true:

      • The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.


      /// - [`target_maps(HashMap::>)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::target_maps) / [`set_target_maps(Option>>>)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::set_target_maps):
      required: **false**

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.


      /// - [`tags(Tag)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::tags) / [`set_tags(Option>)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::set_tags):
      required: **false**

      Adds or overwrites one or more tags for a State Manager association. Tags are metadata that you can assign to your Amazon Web Services resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define.


      /// - [`alarm_configuration(AlarmConfiguration)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::alarm_configuration) / [`set_alarm_configuration(Option)`](crate::operation::create_association::builders::CreateAssociationFluentBuilder::set_alarm_configuration):
      required: **false**

      The details for the CloudWatch alarm you want to apply to an automation or command.


      diff --git a/sdk/ssm/src/client/describe_document.rs b/sdk/ssm/src/client/describe_document.rs index 21339c6e4d6d..73d3e1f6bb22 100644 --- a/sdk/ssm/src/client/describe_document.rs +++ b/sdk/ssm/src/client/describe_document.rs @@ -5,7 +5,7 @@ impl super::Client { /// - The fluent builder is configurable: /// - [`name(impl Into)`](crate::operation::describe_document::builders::DescribeDocumentFluentBuilder::name) / [`set_name(Option)`](crate::operation::describe_document::builders::DescribeDocumentFluentBuilder::set_name):
      required: **true**

      The name of the SSM document.


      /// - [`document_version(impl Into)`](crate::operation::describe_document::builders::DescribeDocumentFluentBuilder::document_version) / [`set_document_version(Option)`](crate::operation::describe_document::builders::DescribeDocumentFluentBuilder::set_document_version):
      required: **false**

      The document version for which you want information. Can be a specific version or the default version.


      - /// - [`version_name(impl Into)`](crate::operation::describe_document::builders::DescribeDocumentFluentBuilder::version_name) / [`set_version_name(Option)`](crate::operation::describe_document::builders::DescribeDocumentFluentBuilder::set_version_name):
      required: **false**

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.


      + /// - [`version_name(impl Into)`](crate::operation::describe_document::builders::DescribeDocumentFluentBuilder::version_name) / [`set_version_name(Option)`](crate::operation::describe_document::builders::DescribeDocumentFluentBuilder::set_version_name):
      required: **false**

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.


      /// - On success, responds with [`DescribeDocumentOutput`](crate::operation::describe_document::DescribeDocumentOutput) with field(s): /// - [`document(Option)`](crate::operation::describe_document::DescribeDocumentOutput::document):

      Information about the SSM document.

      /// - On failure, responds with [`SdkError`](crate::operation::describe_document::DescribeDocumentError) diff --git a/sdk/ssm/src/client/get_connection_status.rs b/sdk/ssm/src/client/get_connection_status.rs index 171f8243afa5..effc3db1921f 100644 --- a/sdk/ssm/src/client/get_connection_status.rs +++ b/sdk/ssm/src/client/get_connection_status.rs @@ -6,7 +6,7 @@ impl super::Client { /// - [`target(impl Into)`](crate::operation::get_connection_status::builders::GetConnectionStatusFluentBuilder::target) / [`set_target(Option)`](crate::operation::get_connection_status::builders::GetConnectionStatusFluentBuilder::set_target):
      required: **true**

      The managed node ID.


      /// - On success, responds with [`GetConnectionStatusOutput`](crate::operation::get_connection_status::GetConnectionStatusOutput) with field(s): /// - [`target(Option)`](crate::operation::get_connection_status::GetConnectionStatusOutput::target):

      The ID of the managed node to check connection status.

      - /// - [`status(Option)`](crate::operation::get_connection_status::GetConnectionStatusOutput::status):

      The status of the connection to the managed node. For example, 'Connected' or 'Not Connected'.

      + /// - [`status(Option)`](crate::operation::get_connection_status::GetConnectionStatusOutput::status):

      The status of the connection to the managed node.

      /// - On failure, responds with [`SdkError`](crate::operation::get_connection_status::GetConnectionStatusError) pub fn get_connection_status(&self) -> crate::operation::get_connection_status::builders::GetConnectionStatusFluentBuilder { crate::operation::get_connection_status::builders::GetConnectionStatusFluentBuilder::new(self.handle.clone()) diff --git a/sdk/ssm/src/client/get_document.rs b/sdk/ssm/src/client/get_document.rs index ae06fedaf822..31fb447a2308 100644 --- a/sdk/ssm/src/client/get_document.rs +++ b/sdk/ssm/src/client/get_document.rs @@ -4,14 +4,14 @@ impl super::Client { /// /// - The fluent builder is configurable: /// - [`name(impl Into)`](crate::operation::get_document::builders::GetDocumentFluentBuilder::name) / [`set_name(Option)`](crate::operation::get_document::builders::GetDocumentFluentBuilder::set_name):
      required: **true**

      The name of the SSM document.


      - /// - [`version_name(impl Into)`](crate::operation::get_document::builders::GetDocumentFluentBuilder::version_name) / [`set_version_name(Option)`](crate::operation::get_document::builders::GetDocumentFluentBuilder::set_version_name):
      required: **false**

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document and can't be changed.


      + /// - [`version_name(impl Into)`](crate::operation::get_document::builders::GetDocumentFluentBuilder::version_name) / [`set_version_name(Option)`](crate::operation::get_document::builders::GetDocumentFluentBuilder::set_version_name):
      required: **false**

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.


      /// - [`document_version(impl Into)`](crate::operation::get_document::builders::GetDocumentFluentBuilder::document_version) / [`set_document_version(Option)`](crate::operation::get_document::builders::GetDocumentFluentBuilder::set_document_version):
      required: **false**

      The document version for which you want information.


      /// - [`document_format(DocumentFormat)`](crate::operation::get_document::builders::GetDocumentFluentBuilder::document_format) / [`set_document_format(Option)`](crate::operation::get_document::builders::GetDocumentFluentBuilder::set_document_format):
      required: **false**

      Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.


      /// - On success, responds with [`GetDocumentOutput`](crate::operation::get_document::GetDocumentOutput) with field(s): /// - [`name(Option)`](crate::operation::get_document::GetDocumentOutput::name):

      The name of the SSM document.

      /// - [`created_date(Option)`](crate::operation::get_document::GetDocumentOutput::created_date):

      The date the SSM document was created.

      /// - [`display_name(Option)`](crate::operation::get_document::GetDocumentOutput::display_name):

      The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see UpdateDocument.

      - /// - [`version_name(Option)`](crate::operation::get_document::GetDocumentOutput::version_name):

      The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + /// - [`version_name(Option)`](crate::operation::get_document::GetDocumentOutput::version_name):

      The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      /// - [`document_version(Option)`](crate::operation::get_document::GetDocumentOutput::document_version):

      The document version.

      /// - [`status(Option)`](crate::operation::get_document::GetDocumentOutput::status):

      The status of the SSM document, such as Creating, Active, Updating, Failed, and Deleting.

      /// - [`status_information(Option)`](crate::operation::get_document::GetDocumentOutput::status_information):

      A message returned by Amazon Web Services Systems Manager that explains the Status value. For example, a Failed status might be explained by the StatusInformation message, "The specified S3 bucket doesn't exist. Verify that the URL of the S3 bucket is correct."

      diff --git a/sdk/ssm/src/client/update_association.rs b/sdk/ssm/src/client/update_association.rs index b6798433f3b9..27575ccbc4f3 100644 --- a/sdk/ssm/src/client/update_association.rs +++ b/sdk/ssm/src/client/update_association.rs @@ -21,6 +21,7 @@ impl super::Client { /// - [`calendar_names(impl Into)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::calendar_names) / [`set_calendar_names(Option>)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::set_calendar_names):
      required: **false**

      The names or Amazon Resource Names (ARNs) of the Change Calendar type documents you want to gate your associations under. The associations only run when that change calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.


      /// - [`target_locations(TargetLocation)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::target_locations) / [`set_target_locations(Option>)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::set_target_locations):
      required: **false**

      A location is a combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association. Use this action to update an association in multiple Regions and multiple accounts.


      /// - [`schedule_offset(i32)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::schedule_offset) / [`set_schedule_offset(Option)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::set_schedule_offset):
      required: **false**

      Number of days to wait after the scheduled day to run an association. For example, if you specified a cron schedule of cron(0 0 ? * THU#2 *), you could specify an offset of 3 to run the association each Sunday after the second Thursday of the month. For more information about cron schedules for associations, see Reference: Cron and rate expressions for Systems Manager in the Amazon Web Services Systems Manager User Guide.

      To use offsets, you must specify the ApplyOnlyAtCronInterval parameter. This option tells the system not to run an association immediately after you create it.


      + /// - [`duration(i32)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::duration) / [`set_duration(Option)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::set_duration):
      required: **false**

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      The Duration parameter applies only when both these conditions are true:

      • The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is updated, but only according to the specified schedule.


      /// - [`target_maps(HashMap::>)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::target_maps) / [`set_target_maps(Option>>>)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::set_target_maps):
      required: **false**

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.


      /// - [`alarm_configuration(AlarmConfiguration)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::alarm_configuration) / [`set_alarm_configuration(Option)`](crate::operation::update_association::builders::UpdateAssociationFluentBuilder::set_alarm_configuration):
      required: **false**

      The details for the CloudWatch alarm you want to apply to an automation or command.


      /// - On success, responds with [`UpdateAssociationOutput`](crate::operation::update_association::UpdateAssociationOutput) with field(s): diff --git a/sdk/ssm/src/client/update_document.rs b/sdk/ssm/src/client/update_document.rs index 247802cd0a9d..db1348649bb7 100644 --- a/sdk/ssm/src/client/update_document.rs +++ b/sdk/ssm/src/client/update_document.rs @@ -7,7 +7,7 @@ impl super::Client { /// - [`attachments(AttachmentsSource)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::attachments) / [`set_attachments(Option>)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::set_attachments):
      required: **false**

      A list of key-value pairs that describe attachments to a version of a document.


      /// - [`name(impl Into)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::name) / [`set_name(Option)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::set_name):
      required: **true**

      The name of the SSM document that you want to update.


      /// - [`display_name(impl Into)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::display_name) / [`set_display_name(Option)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::set_display_name):
      required: **false**

      The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.


      - /// - [`version_name(impl Into)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::version_name) / [`set_version_name(Option)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::set_version_name):
      required: **false**

      An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.


      + /// - [`version_name(impl Into)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::version_name) / [`set_version_name(Option)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::set_version_name):
      required: **false**

      An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.


      /// - [`document_version(impl Into)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::document_version) / [`set_document_version(Option)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::set_document_version):
      required: **false**

      The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the $LATEST variable.

      If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the apply-only-at-cron-interval parameter.


      /// - [`document_format(DocumentFormat)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::document_format) / [`set_document_format(Option)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::set_document_format):
      required: **false**

      Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.


      /// - [`target_type(impl Into)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::target_type) / [`set_target_type(Option)`](crate::operation::update_document::builders::UpdateDocumentFluentBuilder::set_target_type):
      required: **false**

      Specify a new target type for the document.


      diff --git a/sdk/ssm/src/lib.rs b/sdk/ssm/src/lib.rs index ad34e5d5588b..b463f7e001ff 100644 --- a/sdk/ssm/src/lib.rs +++ b/sdk/ssm/src/lib.rs @@ -37,7 +37,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.4", features = ["behavior-version-latest"] } -//! aws-sdk-ssm = "1.12.0" +//! aws-sdk-ssm = "1.13.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/ssm/src/operation/create_association/_create_association_input.rs b/sdk/ssm/src/operation/create_association/_create_association_input.rs index 0aeb41fccc4a..892fa6923142 100644 --- a/sdk/ssm/src/operation/create_association/_create_association_input.rs +++ b/sdk/ssm/src/operation/create_association/_create_association_input.rs @@ -53,6 +53,15 @@ pub struct CreateAssociationInput { ///

      To use offsets, you must specify the ApplyOnlyAtCronInterval parameter. This option tells the system not to run an association immediately after you create it.

      /// pub schedule_offset: ::std::option::Option, + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub duration: ::std::option::Option, ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      pub target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, @@ -152,6 +161,17 @@ impl CreateAssociationInput { pub fn schedule_offset(&self) -> ::std::option::Option { self.schedule_offset } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub fn duration(&self) -> ::std::option::Option { + self.duration + } ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_maps.is_none()`. @@ -189,6 +209,7 @@ impl ::std::fmt::Debug for CreateAssociationInput { formatter.field("calendar_names", &self.calendar_names); formatter.field("target_locations", &self.target_locations); formatter.field("schedule_offset", &self.schedule_offset); + formatter.field("duration", &self.duration); formatter.field("target_maps", &self.target_maps); formatter.field("tags", &self.tags); formatter.field("alarm_configuration", &self.alarm_configuration); @@ -223,6 +244,7 @@ pub struct CreateAssociationInputBuilder { pub(crate) calendar_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>, pub(crate) target_locations: ::std::option::Option<::std::vec::Vec>, pub(crate) schedule_offset: ::std::option::Option, + pub(crate) duration: ::std::option::Option, pub(crate) target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, pub(crate) tags: ::std::option::Option<::std::vec::Vec>, @@ -545,6 +567,41 @@ impl CreateAssociationInputBuilder { pub fn get_schedule_offset(&self) -> &::std::option::Option { &self.schedule_offset } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub fn duration(mut self, input: i32) -> Self { + self.duration = ::std::option::Option::Some(input); + self + } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub fn set_duration(mut self, input: ::std::option::Option) -> Self { + self.duration = input; + self + } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub fn get_duration(&self) -> &::std::option::Option { + &self.duration + } /// Appends an item to `target_maps`. /// /// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps). @@ -626,6 +683,7 @@ impl CreateAssociationInputBuilder { calendar_names: self.calendar_names, target_locations: self.target_locations, schedule_offset: self.schedule_offset, + duration: self.duration, target_maps: self.target_maps, tags: self.tags, alarm_configuration: self.alarm_configuration, @@ -652,6 +710,7 @@ impl ::std::fmt::Debug for CreateAssociationInputBuilder { formatter.field("calendar_names", &self.calendar_names); formatter.field("target_locations", &self.target_locations); formatter.field("schedule_offset", &self.schedule_offset); + formatter.field("duration", &self.duration); formatter.field("target_maps", &self.target_maps); formatter.field("tags", &self.tags); formatter.field("alarm_configuration", &self.alarm_configuration); diff --git a/sdk/ssm/src/operation/create_association/builders.rs b/sdk/ssm/src/operation/create_association/builders.rs index daa8aa30b194..fd1e7d1b8287 100644 --- a/sdk/ssm/src/operation/create_association/builders.rs +++ b/sdk/ssm/src/operation/create_association/builders.rs @@ -415,6 +415,41 @@ impl CreateAssociationFluentBuilder { pub fn get_schedule_offset(&self) -> &::std::option::Option { self.inner.get_schedule_offset() } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub fn duration(mut self, input: i32) -> Self { + self.inner = self.inner.duration(input); + self + } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub fn set_duration(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_duration(input); + self + } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub fn get_duration(&self) -> &::std::option::Option { + self.inner.get_duration() + } /// Appends an item to `TargetMaps`. /// /// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps). diff --git a/sdk/ssm/src/operation/describe_available_patches/builders.rs b/sdk/ssm/src/operation/describe_available_patches/builders.rs index 96e1ff6eb63e..c7a3e91b302d 100644 --- a/sdk/ssm/src/operation/describe_available_patches/builders.rs +++ b/sdk/ssm/src/operation/describe_available_patches/builders.rs @@ -22,7 +22,9 @@ impl DescribeAvailablePatchesInputBuilder { } /// Fluent builder constructing a request to `DescribeAvailablePatches`. /// -///

      Lists all patches eligible to be included in a patch baseline.

      +///

      Lists all patches eligible to be included in a patch baseline.

      +///

      Currently, DescribeAvailablePatches supports only the Amazon Linux 1, Amazon Linux 2, and Windows Server operating systems.

      +///
      #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct DescribeAvailablePatchesFluentBuilder { handle: ::std::sync::Arc, diff --git a/sdk/ssm/src/operation/describe_document/_describe_document_input.rs b/sdk/ssm/src/operation/describe_document/_describe_document_input.rs index dd1fcf18eef5..8eeb53676205 100644 --- a/sdk/ssm/src/operation/describe_document/_describe_document_input.rs +++ b/sdk/ssm/src/operation/describe_document/_describe_document_input.rs @@ -7,7 +7,7 @@ pub struct DescribeDocumentInput { pub name: ::std::option::Option<::std::string::String>, ///

      The document version for which you want information. Can be a specific version or the default version.

      pub document_version: ::std::option::Option<::std::string::String>, - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub version_name: ::std::option::Option<::std::string::String>, } impl DescribeDocumentInput { @@ -19,7 +19,7 @@ impl DescribeDocumentInput { pub fn document_version(&self) -> ::std::option::Option<&str> { self.document_version.as_deref() } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(&self) -> ::std::option::Option<&str> { self.version_name.as_deref() } @@ -69,17 +69,17 @@ impl DescribeDocumentInputBuilder { pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> { &self.document_version } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.version_name = ::std::option::Option::Some(input.into()); self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.version_name = input; self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> { &self.version_name } diff --git a/sdk/ssm/src/operation/describe_document/builders.rs b/sdk/ssm/src/operation/describe_document/builders.rs index 78b5da38755d..8148d870479d 100644 --- a/sdk/ssm/src/operation/describe_document/builders.rs +++ b/sdk/ssm/src/operation/describe_document/builders.rs @@ -136,17 +136,17 @@ impl DescribeDocumentFluentBuilder { pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_document_version() } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.version_name(input.into()); self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_version_name(input); self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_version_name() } diff --git a/sdk/ssm/src/operation/get_connection_status/_get_connection_status_output.rs b/sdk/ssm/src/operation/get_connection_status/_get_connection_status_output.rs index f6addde0d21a..c2d9e0cabe73 100644 --- a/sdk/ssm/src/operation/get_connection_status/_get_connection_status_output.rs +++ b/sdk/ssm/src/operation/get_connection_status/_get_connection_status_output.rs @@ -5,7 +5,7 @@ pub struct GetConnectionStatusOutput { ///

      The ID of the managed node to check connection status.

      pub target: ::std::option::Option<::std::string::String>, - ///

      The status of the connection to the managed node. For example, 'Connected' or 'Not Connected'.

      + ///

      The status of the connection to the managed node.

      pub status: ::std::option::Option, _request_id: Option, } @@ -14,7 +14,7 @@ impl GetConnectionStatusOutput { pub fn target(&self) -> ::std::option::Option<&str> { self.target.as_deref() } - ///

      The status of the connection to the managed node. For example, 'Connected' or 'Not Connected'.

      + ///

      The status of the connection to the managed node.

      pub fn status(&self) -> ::std::option::Option<&crate::types::ConnectionStatus> { self.status.as_ref() } @@ -54,17 +54,17 @@ impl GetConnectionStatusOutputBuilder { pub fn get_target(&self) -> &::std::option::Option<::std::string::String> { &self.target } - ///

      The status of the connection to the managed node. For example, 'Connected' or 'Not Connected'.

      + ///

      The status of the connection to the managed node.

      pub fn status(mut self, input: crate::types::ConnectionStatus) -> Self { self.status = ::std::option::Option::Some(input); self } - ///

      The status of the connection to the managed node. For example, 'Connected' or 'Not Connected'.

      + ///

      The status of the connection to the managed node.

      pub fn set_status(mut self, input: ::std::option::Option) -> Self { self.status = input; self } - ///

      The status of the connection to the managed node. For example, 'Connected' or 'Not Connected'.

      + ///

      The status of the connection to the managed node.

      pub fn get_status(&self) -> &::std::option::Option { &self.status } diff --git a/sdk/ssm/src/operation/get_document/_get_document_input.rs b/sdk/ssm/src/operation/get_document/_get_document_input.rs index 9c15c6192423..23db70ee6422 100644 --- a/sdk/ssm/src/operation/get_document/_get_document_input.rs +++ b/sdk/ssm/src/operation/get_document/_get_document_input.rs @@ -5,7 +5,7 @@ pub struct GetDocumentInput { ///

      The name of the SSM document.

      pub name: ::std::option::Option<::std::string::String>, - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.

      pub version_name: ::std::option::Option<::std::string::String>, ///

      The document version for which you want information.

      pub document_version: ::std::option::Option<::std::string::String>, @@ -17,7 +17,7 @@ impl GetDocumentInput { pub fn name(&self) -> ::std::option::Option<&str> { self.name.as_deref() } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.

      pub fn version_name(&self) -> ::std::option::Option<&str> { self.version_name.as_deref() } @@ -62,17 +62,17 @@ impl GetDocumentInputBuilder { pub fn get_name(&self) -> &::std::option::Option<::std::string::String> { &self.name } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.

      pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.version_name = ::std::option::Option::Some(input.into()); self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.

      pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.version_name = input; self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.

      pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> { &self.version_name } diff --git a/sdk/ssm/src/operation/get_document/_get_document_output.rs b/sdk/ssm/src/operation/get_document/_get_document_output.rs index 33b1819d447c..d4127446dda9 100644 --- a/sdk/ssm/src/operation/get_document/_get_document_output.rs +++ b/sdk/ssm/src/operation/get_document/_get_document_output.rs @@ -9,7 +9,7 @@ pub struct GetDocumentOutput { pub created_date: ::std::option::Option<::aws_smithy_types::DateTime>, ///

      The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see UpdateDocument.

      pub display_name: ::std::option::Option<::std::string::String>, - ///

      The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub version_name: ::std::option::Option<::std::string::String>, ///

      The document version.

      pub document_version: ::std::option::Option<::std::string::String>, @@ -46,7 +46,7 @@ impl GetDocumentOutput { pub fn display_name(&self) -> ::std::option::Option<&str> { self.display_name.as_deref() } - ///

      The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(&self) -> ::std::option::Option<&str> { self.version_name.as_deref() } @@ -167,17 +167,17 @@ impl GetDocumentOutputBuilder { pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> { &self.display_name } - ///

      The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.version_name = ::std::option::Option::Some(input.into()); self } - ///

      The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.version_name = input; self } - ///

      The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> { &self.version_name } diff --git a/sdk/ssm/src/operation/get_document/builders.rs b/sdk/ssm/src/operation/get_document/builders.rs index b8c66ceaf7c8..21281c93294d 100644 --- a/sdk/ssm/src/operation/get_document/builders.rs +++ b/sdk/ssm/src/operation/get_document/builders.rs @@ -122,17 +122,17 @@ impl GetDocumentFluentBuilder { pub fn get_name(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_name() } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.

      pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.version_name(input.into()); self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.

      pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_version_name(input); self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document and can't be changed.

      pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_version_name() } diff --git a/sdk/ssm/src/operation/update_association/_update_association_input.rs b/sdk/ssm/src/operation/update_association/_update_association_input.rs index 77b2d69207d7..87587ca75629 100644 --- a/sdk/ssm/src/operation/update_association/_update_association_input.rs +++ b/sdk/ssm/src/operation/update_association/_update_association_input.rs @@ -55,6 +55,15 @@ pub struct UpdateAssociationInput { ///

      To use offsets, you must specify the ApplyOnlyAtCronInterval parameter. This option tells the system not to run an association immediately after you create it.

      /// pub schedule_offset: ::std::option::Option, + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is updated, but only according to the specified schedule.

      • + ///
      + pub duration: ::std::option::Option, ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      pub target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, @@ -156,6 +165,17 @@ impl UpdateAssociationInput { pub fn schedule_offset(&self) -> ::std::option::Option { self.schedule_offset } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is updated, but only according to the specified schedule.

      • + ///
      + pub fn duration(&self) -> ::std::option::Option { + self.duration + } ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_maps.is_none()`. @@ -188,6 +208,7 @@ impl ::std::fmt::Debug for UpdateAssociationInput { formatter.field("calendar_names", &self.calendar_names); formatter.field("target_locations", &self.target_locations); formatter.field("schedule_offset", &self.schedule_offset); + formatter.field("duration", &self.duration); formatter.field("target_maps", &self.target_maps); formatter.field("alarm_configuration", &self.alarm_configuration); formatter.finish() @@ -222,6 +243,7 @@ pub struct UpdateAssociationInputBuilder { pub(crate) calendar_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>, pub(crate) target_locations: ::std::option::Option<::std::vec::Vec>, pub(crate) schedule_offset: ::std::option::Option, + pub(crate) duration: ::std::option::Option, pub(crate) target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, pub(crate) alarm_configuration: ::std::option::Option, @@ -557,6 +579,41 @@ impl UpdateAssociationInputBuilder { pub fn get_schedule_offset(&self) -> &::std::option::Option { &self.schedule_offset } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is updated, but only according to the specified schedule.

      • + ///
      + pub fn duration(mut self, input: i32) -> Self { + self.duration = ::std::option::Option::Some(input); + self + } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is updated, but only according to the specified schedule.

      • + ///
      + pub fn set_duration(mut self, input: ::std::option::Option) -> Self { + self.duration = input; + self + } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is updated, but only according to the specified schedule.

      • + ///
      + pub fn get_duration(&self) -> &::std::option::Option { + &self.duration + } /// Appends an item to `target_maps`. /// /// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps). @@ -619,6 +676,7 @@ impl UpdateAssociationInputBuilder { calendar_names: self.calendar_names, target_locations: self.target_locations, schedule_offset: self.schedule_offset, + duration: self.duration, target_maps: self.target_maps, alarm_configuration: self.alarm_configuration, }) @@ -645,6 +703,7 @@ impl ::std::fmt::Debug for UpdateAssociationInputBuilder { formatter.field("calendar_names", &self.calendar_names); formatter.field("target_locations", &self.target_locations); formatter.field("schedule_offset", &self.schedule_offset); + formatter.field("duration", &self.duration); formatter.field("target_maps", &self.target_maps); formatter.field("alarm_configuration", &self.alarm_configuration); formatter.finish() diff --git a/sdk/ssm/src/operation/update_association/builders.rs b/sdk/ssm/src/operation/update_association/builders.rs index 81b9174c7bd4..6ffd7a178564 100644 --- a/sdk/ssm/src/operation/update_association/builders.rs +++ b/sdk/ssm/src/operation/update_association/builders.rs @@ -435,6 +435,41 @@ impl UpdateAssociationFluentBuilder { pub fn get_schedule_offset(&self) -> &::std::option::Option { self.inner.get_schedule_offset() } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is updated, but only according to the specified schedule.

      • + ///
      + pub fn duration(mut self, input: i32) -> Self { + self.inner = self.inner.duration(input); + self + } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is updated, but only according to the specified schedule.

      • + ///
      + pub fn set_duration(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_duration(input); + self + } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is updated, but only according to the specified schedule.

      • + ///
      + pub fn get_duration(&self) -> &::std::option::Option { + self.inner.get_duration() + } /// Appends an item to `TargetMaps`. /// /// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps). diff --git a/sdk/ssm/src/operation/update_document/_update_document_input.rs b/sdk/ssm/src/operation/update_document/_update_document_input.rs index 388047a8384d..06cf36356acd 100644 --- a/sdk/ssm/src/operation/update_document/_update_document_input.rs +++ b/sdk/ssm/src/operation/update_document/_update_document_input.rs @@ -11,7 +11,7 @@ pub struct UpdateDocumentInput { pub name: ::std::option::Option<::std::string::String>, ///

      The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.

      pub display_name: ::std::option::Option<::std::string::String>, - ///

      An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub version_name: ::std::option::Option<::std::string::String>, ///

      The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the $LATEST variable.

      ///

      If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the apply-only-at-cron-interval parameter.

      @@ -41,7 +41,7 @@ impl UpdateDocumentInput { pub fn display_name(&self) -> ::std::option::Option<&str> { self.display_name.as_deref() } - ///

      An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(&self) -> ::std::option::Option<&str> { self.version_name.as_deref() } @@ -145,17 +145,17 @@ impl UpdateDocumentInputBuilder { pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> { &self.display_name } - ///

      An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.version_name = ::std::option::Option::Some(input.into()); self } - ///

      An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.version_name = input; self } - ///

      An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> { &self.version_name } diff --git a/sdk/ssm/src/operation/update_document/builders.rs b/sdk/ssm/src/operation/update_document/builders.rs index 453fc49dd27f..2d42da6ab143 100644 --- a/sdk/ssm/src/operation/update_document/builders.rs +++ b/sdk/ssm/src/operation/update_document/builders.rs @@ -168,17 +168,17 @@ impl UpdateDocumentFluentBuilder { pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_display_name() } - ///

      An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.version_name(input.into()); self } - ///

      An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_version_name(input); self } - ///

      An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_version_name() } diff --git a/sdk/ssm/src/protocol_serde/shape_association.rs b/sdk/ssm/src/protocol_serde/shape_association.rs index 8363b8de4a3c..1c09124be179 100644 --- a/sdk/ssm/src/protocol_serde/shape_association.rs +++ b/sdk/ssm/src/protocol_serde/shape_association.rs @@ -82,6 +82,13 @@ where .transpose()?, ); } + "Duration" => { + builder = builder.set_duration( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i32::try_from) + .transpose()?, + ); + } "TargetMaps" => { builder = builder.set_target_maps(crate::protocol_serde::shape_target_maps::de_target_maps(tokens)?); } diff --git a/sdk/ssm/src/protocol_serde/shape_association_description.rs b/sdk/ssm/src/protocol_serde/shape_association_description.rs index 1d9306dad721..bd5b97acb9c9 100644 --- a/sdk/ssm/src/protocol_serde/shape_association_description.rs +++ b/sdk/ssm/src/protocol_serde/shape_association_description.rs @@ -158,6 +158,13 @@ where .transpose()?, ); } + "Duration" => { + builder = builder.set_duration( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i32::try_from) + .transpose()?, + ); + } "TargetMaps" => { builder = builder.set_target_maps(crate::protocol_serde::shape_target_maps::de_target_maps(tokens)?); } diff --git a/sdk/ssm/src/protocol_serde/shape_association_version_info.rs b/sdk/ssm/src/protocol_serde/shape_association_version_info.rs index c46af9ba60ce..976d3fdc93c9 100644 --- a/sdk/ssm/src/protocol_serde/shape_association_version_info.rs +++ b/sdk/ssm/src/protocol_serde/shape_association_version_info.rs @@ -120,6 +120,13 @@ where .transpose()?, ); } + "Duration" => { + builder = builder.set_duration( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i32::try_from) + .transpose()?, + ); + } "TargetMaps" => { builder = builder.set_target_maps(crate::protocol_serde::shape_target_maps::de_target_maps(tokens)?); } diff --git a/sdk/ssm/src/protocol_serde/shape_create_association_batch_request_entry.rs b/sdk/ssm/src/protocol_serde/shape_create_association_batch_request_entry.rs index ce5e02aa3068..34fb0e1e0fd1 100644 --- a/sdk/ssm/src/protocol_serde/shape_create_association_batch_request_entry.rs +++ b/sdk/ssm/src/protocol_serde/shape_create_association_batch_request_entry.rs @@ -97,33 +97,39 @@ pub fn ser_create_association_batch_request_entry( ::aws_smithy_types::Number::NegInt((*var_29).into()), ); } - if let Some(var_30) = &input.target_maps { - let mut array_31 = object.key("TargetMaps").start_array(); - for item_32 in var_30 { + if let Some(var_30) = &input.duration { + object.key("Duration").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_30).into()), + ); + } + if let Some(var_31) = &input.target_maps { + let mut array_32 = object.key("TargetMaps").start_array(); + for item_33 in var_31 { { #[allow(unused_mut)] - let mut object_33 = array_31.value().start_object(); - for (key_34, value_35) in item_32 { + let mut object_34 = array_32.value().start_object(); + for (key_35, value_36) in item_33 { { - let mut array_36 = object_33.key(key_34.as_str()).start_array(); - for item_37 in value_35 { + let mut array_37 = object_34.key(key_35.as_str()).start_array(); + for item_38 in value_36 { { - array_36.value().string(item_37.as_str()); + array_37.value().string(item_38.as_str()); } } - array_36.finish(); + array_37.finish(); } } - object_33.finish(); + object_34.finish(); } } - array_31.finish(); + array_32.finish(); } - if let Some(var_38) = &input.alarm_configuration { + if let Some(var_39) = &input.alarm_configuration { #[allow(unused_mut)] - let mut object_39 = object.key("AlarmConfiguration").start_object(); - crate::protocol_serde::shape_alarm_configuration::ser_alarm_configuration(&mut object_39, var_38)?; - object_39.finish(); + let mut object_40 = object.key("AlarmConfiguration").start_object(); + crate::protocol_serde::shape_alarm_configuration::ser_alarm_configuration(&mut object_40, var_39)?; + object_40.finish(); } Ok(()) } @@ -243,6 +249,13 @@ where .transpose()?, ); } + "Duration" => { + builder = builder.set_duration( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i32::try_from) + .transpose()?, + ); + } "TargetMaps" => { builder = builder.set_target_maps(crate::protocol_serde::shape_target_maps::de_target_maps(tokens)?); } diff --git a/sdk/ssm/src/protocol_serde/shape_create_association_input.rs b/sdk/ssm/src/protocol_serde/shape_create_association_input.rs index 8c7531f72711..b3727f62175d 100644 --- a/sdk/ssm/src/protocol_serde/shape_create_association_input.rs +++ b/sdk/ssm/src/protocol_serde/shape_create_association_input.rs @@ -97,45 +97,51 @@ pub fn ser_create_association_input_input( ::aws_smithy_types::Number::NegInt((*var_31).into()), ); } - if let Some(var_32) = &input.target_maps { - let mut array_33 = object.key("TargetMaps").start_array(); - for item_34 in var_32 { + if let Some(var_32) = &input.duration { + object.key("Duration").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_32).into()), + ); + } + if let Some(var_33) = &input.target_maps { + let mut array_34 = object.key("TargetMaps").start_array(); + for item_35 in var_33 { { #[allow(unused_mut)] - let mut object_35 = array_33.value().start_object(); - for (key_36, value_37) in item_34 { + let mut object_36 = array_34.value().start_object(); + for (key_37, value_38) in item_35 { { - let mut array_38 = object_35.key(key_36.as_str()).start_array(); - for item_39 in value_37 { + let mut array_39 = object_36.key(key_37.as_str()).start_array(); + for item_40 in value_38 { { - array_38.value().string(item_39.as_str()); + array_39.value().string(item_40.as_str()); } } - array_38.finish(); + array_39.finish(); } } - object_35.finish(); + object_36.finish(); } } - array_33.finish(); + array_34.finish(); } - if let Some(var_40) = &input.tags { - let mut array_41 = object.key("Tags").start_array(); - for item_42 in var_40 { + if let Some(var_41) = &input.tags { + let mut array_42 = object.key("Tags").start_array(); + for item_43 in var_41 { { #[allow(unused_mut)] - let mut object_43 = array_41.value().start_object(); - crate::protocol_serde::shape_tag::ser_tag(&mut object_43, item_42)?; - object_43.finish(); + let mut object_44 = array_42.value().start_object(); + crate::protocol_serde::shape_tag::ser_tag(&mut object_44, item_43)?; + object_44.finish(); } } - array_41.finish(); + array_42.finish(); } - if let Some(var_44) = &input.alarm_configuration { + if let Some(var_45) = &input.alarm_configuration { #[allow(unused_mut)] - let mut object_45 = object.key("AlarmConfiguration").start_object(); - crate::protocol_serde::shape_alarm_configuration::ser_alarm_configuration(&mut object_45, var_44)?; - object_45.finish(); + let mut object_46 = object.key("AlarmConfiguration").start_object(); + crate::protocol_serde::shape_alarm_configuration::ser_alarm_configuration(&mut object_46, var_45)?; + object_46.finish(); } Ok(()) } diff --git a/sdk/ssm/src/protocol_serde/shape_update_association_input.rs b/sdk/ssm/src/protocol_serde/shape_update_association_input.rs index 113c70a4ba95..fbabcabeebb1 100644 --- a/sdk/ssm/src/protocol_serde/shape_update_association_input.rs +++ b/sdk/ssm/src/protocol_serde/shape_update_association_input.rs @@ -100,33 +100,39 @@ pub fn ser_update_association_input_input( ::aws_smithy_types::Number::NegInt((*var_32).into()), ); } - if let Some(var_33) = &input.target_maps { - let mut array_34 = object.key("TargetMaps").start_array(); - for item_35 in var_33 { + if let Some(var_33) = &input.duration { + object.key("Duration").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_33).into()), + ); + } + if let Some(var_34) = &input.target_maps { + let mut array_35 = object.key("TargetMaps").start_array(); + for item_36 in var_34 { { #[allow(unused_mut)] - let mut object_36 = array_34.value().start_object(); - for (key_37, value_38) in item_35 { + let mut object_37 = array_35.value().start_object(); + for (key_38, value_39) in item_36 { { - let mut array_39 = object_36.key(key_37.as_str()).start_array(); - for item_40 in value_38 { + let mut array_40 = object_37.key(key_38.as_str()).start_array(); + for item_41 in value_39 { { - array_39.value().string(item_40.as_str()); + array_40.value().string(item_41.as_str()); } } - array_39.finish(); + array_40.finish(); } } - object_36.finish(); + object_37.finish(); } } - array_34.finish(); + array_35.finish(); } - if let Some(var_41) = &input.alarm_configuration { + if let Some(var_42) = &input.alarm_configuration { #[allow(unused_mut)] - let mut object_42 = object.key("AlarmConfiguration").start_object(); - crate::protocol_serde::shape_alarm_configuration::ser_alarm_configuration(&mut object_42, var_41)?; - object_42.finish(); + let mut object_43 = object.key("AlarmConfiguration").start_object(); + crate::protocol_serde::shape_alarm_configuration::ser_alarm_configuration(&mut object_43, var_42)?; + object_43.finish(); } Ok(()) } diff --git a/sdk/ssm/src/types/_association.rs b/sdk/ssm/src/types/_association.rs index 3efa828e1e08..164e9814378f 100644 --- a/sdk/ssm/src/types/_association.rs +++ b/sdk/ssm/src/types/_association.rs @@ -28,6 +28,8 @@ pub struct Association { pub association_name: ::std::option::Option<::std::string::String>, ///

      Number of days to wait after the scheduled day to run an association.

      pub schedule_offset: ::std::option::Option, + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub duration: ::std::option::Option, ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      pub target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, @@ -81,6 +83,10 @@ impl Association { pub fn schedule_offset(&self) -> ::std::option::Option { self.schedule_offset } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn duration(&self) -> ::std::option::Option { + self.duration + } ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_maps.is_none()`. @@ -110,6 +116,7 @@ pub struct AssociationBuilder { pub(crate) schedule_expression: ::std::option::Option<::std::string::String>, pub(crate) association_name: ::std::option::Option<::std::string::String>, pub(crate) schedule_offset: ::std::option::Option, + pub(crate) duration: ::std::option::Option, pub(crate) target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, } @@ -280,6 +287,20 @@ impl AssociationBuilder { pub fn get_schedule_offset(&self) -> &::std::option::Option { &self.schedule_offset } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn duration(mut self, input: i32) -> Self { + self.duration = ::std::option::Option::Some(input); + self + } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn set_duration(mut self, input: ::std::option::Option) -> Self { + self.duration = input; + self + } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn get_duration(&self) -> &::std::option::Option { + &self.duration + } /// Appends an item to `target_maps`. /// /// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps). @@ -319,6 +340,7 @@ impl AssociationBuilder { schedule_expression: self.schedule_expression, association_name: self.association_name, schedule_offset: self.schedule_offset, + duration: self.duration, target_maps: self.target_maps, } } diff --git a/sdk/ssm/src/types/_association_description.rs b/sdk/ssm/src/types/_association_description.rs index accdd13a5b04..d8e7685a56d5 100644 --- a/sdk/ssm/src/types/_association_description.rs +++ b/sdk/ssm/src/types/_association_description.rs @@ -58,6 +58,8 @@ pub struct AssociationDescription { pub target_locations: ::std::option::Option<::std::vec::Vec>, ///

      Number of days to wait after the scheduled day to run an association.

      pub schedule_offset: ::std::option::Option, + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub duration: ::std::option::Option, ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      pub target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, @@ -177,6 +179,10 @@ impl AssociationDescription { pub fn schedule_offset(&self) -> ::std::option::Option { self.schedule_offset } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn duration(&self) -> ::std::option::Option { + self.duration + } ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_maps.is_none()`. @@ -222,6 +228,7 @@ impl ::std::fmt::Debug for AssociationDescription { formatter.field("calendar_names", &self.calendar_names); formatter.field("target_locations", &self.target_locations); formatter.field("schedule_offset", &self.schedule_offset); + formatter.field("duration", &self.duration); formatter.field("target_maps", &self.target_maps); formatter.field("alarm_configuration", &self.alarm_configuration); formatter.field("triggered_alarms", &self.triggered_alarms); @@ -264,6 +271,7 @@ pub struct AssociationDescriptionBuilder { pub(crate) calendar_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>, pub(crate) target_locations: ::std::option::Option<::std::vec::Vec>, pub(crate) schedule_offset: ::std::option::Option, + pub(crate) duration: ::std::option::Option, pub(crate) target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, pub(crate) alarm_configuration: ::std::option::Option, @@ -661,6 +669,20 @@ impl AssociationDescriptionBuilder { pub fn get_schedule_offset(&self) -> &::std::option::Option { &self.schedule_offset } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn duration(mut self, input: i32) -> Self { + self.duration = ::std::option::Option::Some(input); + self + } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn set_duration(mut self, input: ::std::option::Option) -> Self { + self.duration = input; + self + } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn get_duration(&self) -> &::std::option::Option { + &self.duration + } /// Appends an item to `target_maps`. /// /// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps). @@ -748,6 +770,7 @@ impl AssociationDescriptionBuilder { calendar_names: self.calendar_names, target_locations: self.target_locations, schedule_offset: self.schedule_offset, + duration: self.duration, target_maps: self.target_maps, alarm_configuration: self.alarm_configuration, triggered_alarms: self.triggered_alarms, @@ -782,6 +805,7 @@ impl ::std::fmt::Debug for AssociationDescriptionBuilder { formatter.field("calendar_names", &self.calendar_names); formatter.field("target_locations", &self.target_locations); formatter.field("schedule_offset", &self.schedule_offset); + formatter.field("duration", &self.duration); formatter.field("target_maps", &self.target_maps); formatter.field("alarm_configuration", &self.alarm_configuration); formatter.field("triggered_alarms", &self.triggered_alarms); diff --git a/sdk/ssm/src/types/_association_version_info.rs b/sdk/ssm/src/types/_association_version_info.rs index 21cf29ed5cb7..6152b0398cd9 100644 --- a/sdk/ssm/src/types/_association_version_info.rs +++ b/sdk/ssm/src/types/_association_version_info.rs @@ -44,6 +44,8 @@ pub struct AssociationVersionInfo { pub target_locations: ::std::option::Option<::std::vec::Vec>, ///

      Number of days to wait after the scheduled day to run an association.

      pub schedule_offset: ::std::option::Option, + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub duration: ::std::option::Option, ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      pub target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, @@ -131,6 +133,10 @@ impl AssociationVersionInfo { pub fn schedule_offset(&self) -> ::std::option::Option { self.schedule_offset } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn duration(&self) -> ::std::option::Option { + self.duration + } ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_maps.is_none()`. @@ -159,6 +165,7 @@ impl ::std::fmt::Debug for AssociationVersionInfo { formatter.field("calendar_names", &self.calendar_names); formatter.field("target_locations", &self.target_locations); formatter.field("schedule_offset", &self.schedule_offset); + formatter.field("duration", &self.duration); formatter.field("target_maps", &self.target_maps); formatter.finish() } @@ -192,6 +199,7 @@ pub struct AssociationVersionInfoBuilder { pub(crate) calendar_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>, pub(crate) target_locations: ::std::option::Option<::std::vec::Vec>, pub(crate) schedule_offset: ::std::option::Option, + pub(crate) duration: ::std::option::Option, pub(crate) target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, } @@ -489,6 +497,20 @@ impl AssociationVersionInfoBuilder { pub fn get_schedule_offset(&self) -> &::std::option::Option { &self.schedule_offset } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn duration(mut self, input: i32) -> Self { + self.duration = ::std::option::Option::Some(input); + self + } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn set_duration(mut self, input: ::std::option::Option) -> Self { + self.duration = input; + self + } + ///

      The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.

      + pub fn get_duration(&self) -> &::std::option::Option { + &self.duration + } /// Appends an item to `target_maps`. /// /// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps). @@ -535,6 +557,7 @@ impl AssociationVersionInfoBuilder { calendar_names: self.calendar_names, target_locations: self.target_locations, schedule_offset: self.schedule_offset, + duration: self.duration, target_maps: self.target_maps, } } @@ -560,6 +583,7 @@ impl ::std::fmt::Debug for AssociationVersionInfoBuilder { formatter.field("calendar_names", &self.calendar_names); formatter.field("target_locations", &self.target_locations); formatter.field("schedule_offset", &self.schedule_offset); + formatter.field("duration", &self.duration); formatter.field("target_maps", &self.target_maps); formatter.finish() } diff --git a/sdk/ssm/src/types/_create_association_batch_request_entry.rs b/sdk/ssm/src/types/_create_association_batch_request_entry.rs index 3fc7f5374481..e1ab45a16e2b 100644 --- a/sdk/ssm/src/types/_create_association_batch_request_entry.rs +++ b/sdk/ssm/src/types/_create_association_batch_request_entry.rs @@ -50,6 +50,15 @@ pub struct CreateAssociationBatchRequestEntry { pub target_locations: ::std::option::Option<::std::vec::Vec>, ///

      Number of days to wait after the scheduled day to run an association.

      pub schedule_offset: ::std::option::Option, + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub duration: ::std::option::Option, ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      pub target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, @@ -144,6 +153,17 @@ impl CreateAssociationBatchRequestEntry { pub fn schedule_offset(&self) -> ::std::option::Option { self.schedule_offset } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub fn duration(&self) -> ::std::option::Option { + self.duration + } ///

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_maps.is_none()`. @@ -175,6 +195,7 @@ impl ::std::fmt::Debug for CreateAssociationBatchRequestEntry { formatter.field("calendar_names", &self.calendar_names); formatter.field("target_locations", &self.target_locations); formatter.field("schedule_offset", &self.schedule_offset); + formatter.field("duration", &self.duration); formatter.field("target_maps", &self.target_maps); formatter.field("alarm_configuration", &self.alarm_configuration); formatter.finish() @@ -208,6 +229,7 @@ pub struct CreateAssociationBatchRequestEntryBuilder { pub(crate) calendar_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>, pub(crate) target_locations: ::std::option::Option<::std::vec::Vec>, pub(crate) schedule_offset: ::std::option::Option, + pub(crate) duration: ::std::option::Option, pub(crate) target_maps: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>, pub(crate) alarm_configuration: ::std::option::Option, @@ -517,6 +539,41 @@ impl CreateAssociationBatchRequestEntryBuilder { pub fn get_schedule_offset(&self) -> &::std::option::Option { &self.schedule_offset } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub fn duration(mut self, input: i32) -> Self { + self.duration = ::std::option::Option::Some(input); + self + } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub fn set_duration(mut self, input: ::std::option::Option) -> Self { + self.duration = input; + self + } + ///

      The number of hours the association can run before it is canceled. Duration applies to associations that are currently running, and any pending and in progress commands on all targets. If a target was taken offline for the association to run, it is made available again immediately, without a reboot.

      + ///

      The Duration parameter applies only when both these conditions are true:

      + ///
        + ///
      • + ///

        The association for which you specify a duration is cancelable according to the parameters of the SSM command document or Automation runbook associated with this execution.

      • + ///
      • + ///

        The command specifies the ApplyOnlyAtCronInterval parameter, which means that the association doesn't run immediately after it is created, but only according to the specified schedule.

      • + ///
      + pub fn get_duration(&self) -> &::std::option::Option { + &self.duration + } /// Appends an item to `target_maps`. /// /// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps). @@ -583,6 +640,7 @@ impl CreateAssociationBatchRequestEntryBuilder { calendar_names: self.calendar_names, target_locations: self.target_locations, schedule_offset: self.schedule_offset, + duration: self.duration, target_maps: self.target_maps, alarm_configuration: self.alarm_configuration, }) @@ -608,6 +666,7 @@ impl ::std::fmt::Debug for CreateAssociationBatchRequestEntryBuilder { formatter.field("calendar_names", &self.calendar_names); formatter.field("target_locations", &self.target_locations); formatter.field("schedule_offset", &self.schedule_offset); + formatter.field("duration", &self.duration); formatter.field("target_maps", &self.target_maps); formatter.field("alarm_configuration", &self.alarm_configuration); formatter.finish() diff --git a/sdk/ssm/src/types/_document_identifier.rs b/sdk/ssm/src/types/_document_identifier.rs index eac2e951a5d2..9d0160702158 100644 --- a/sdk/ssm/src/types/_document_identifier.rs +++ b/sdk/ssm/src/types/_document_identifier.rs @@ -12,7 +12,7 @@ pub struct DocumentIdentifier { pub display_name: ::std::option::Option<::std::string::String>, ///

      The Amazon Web Services user that created the document.

      pub owner: ::std::option::Option<::std::string::String>, - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub version_name: ::std::option::Option<::std::string::String>, ///

      The operating system platform.

      pub platform_types: ::std::option::Option<::std::vec::Vec>, @@ -52,7 +52,7 @@ impl DocumentIdentifier { pub fn owner(&self) -> ::std::option::Option<&str> { self.owner.as_deref() } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(&self) -> ::std::option::Option<&str> { self.version_name.as_deref() } @@ -187,17 +187,17 @@ impl DocumentIdentifierBuilder { pub fn get_owner(&self) -> &::std::option::Option<::std::string::String> { &self.owner } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.version_name = ::std::option::Option::Some(input.into()); self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.version_name = input; self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> { &self.version_name } diff --git a/sdk/ssm/src/types/_document_requires.rs b/sdk/ssm/src/types/_document_requires.rs index fc68830af632..f318d3a64d79 100644 --- a/sdk/ssm/src/types/_document_requires.rs +++ b/sdk/ssm/src/types/_document_requires.rs @@ -10,7 +10,7 @@ pub struct DocumentRequires { pub version: ::std::option::Option<::std::string::String>, ///

      The document type of the required SSM document.

      pub require_type: ::std::option::Option<::std::string::String>, - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub version_name: ::std::option::Option<::std::string::String>, } impl DocumentRequires { @@ -27,7 +27,7 @@ impl DocumentRequires { pub fn require_type(&self) -> ::std::option::Option<&str> { self.require_type.as_deref() } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(&self) -> ::std::option::Option<&str> { self.version_name.as_deref() } @@ -92,17 +92,17 @@ impl DocumentRequiresBuilder { pub fn get_require_type(&self) -> &::std::option::Option<::std::string::String> { &self.require_type } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.version_name = ::std::option::Option::Some(input.into()); self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.version_name = input; self } - ///

      An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      An optional field specifying the version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> { &self.version_name } diff --git a/sdk/ssm/src/types/_document_version_info.rs b/sdk/ssm/src/types/_document_version_info.rs index 1014b0ad2f13..d89d14f27d51 100644 --- a/sdk/ssm/src/types/_document_version_info.rs +++ b/sdk/ssm/src/types/_document_version_info.rs @@ -10,7 +10,7 @@ pub struct DocumentVersionInfo { pub display_name: ::std::option::Option<::std::string::String>, ///

      The document version.

      pub document_version: ::std::option::Option<::std::string::String>, - ///

      The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub version_name: ::std::option::Option<::std::string::String>, ///

      The date the document was created.

      pub created_date: ::std::option::Option<::aws_smithy_types::DateTime>, @@ -38,7 +38,7 @@ impl DocumentVersionInfo { pub fn document_version(&self) -> ::std::option::Option<&str> { self.document_version.as_deref() } - ///

      The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(&self) -> ::std::option::Option<&str> { self.version_name.as_deref() } @@ -132,17 +132,17 @@ impl DocumentVersionInfoBuilder { pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> { &self.document_version } - ///

      The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.version_name = ::std::option::Option::Some(input.into()); self } - ///

      The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.version_name = input; self } - ///

      The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.

      + ///

      The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.

      pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> { &self.version_name } diff --git a/sdk/ssm/src/types/_parameter_history.rs b/sdk/ssm/src/types/_parameter_history.rs index 4d25ebfd7ddc..dcdd7bbe91a5 100644 --- a/sdk/ssm/src/types/_parameter_history.rs +++ b/sdk/ssm/src/types/_parameter_history.rs @@ -8,7 +8,7 @@ pub struct ParameterHistory { pub name: ::std::option::Option<::std::string::String>, ///

      The type of parameter used.

      pub r#type: ::std::option::Option, - ///

      The ID of the query key used for this parameter.

      + ///

      The alias of the Key Management Service (KMS) key used to encrypt the parameter. Applies to SecureString parameters only

      pub key_id: ::std::option::Option<::std::string::String>, ///

      Date the parameter was last changed or updated.

      pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>, @@ -42,7 +42,7 @@ impl ParameterHistory { pub fn r#type(&self) -> ::std::option::Option<&crate::types::ParameterType> { self.r#type.as_ref() } - ///

      The ID of the query key used for this parameter.

      + ///

      The alias of the Key Management Service (KMS) key used to encrypt the parameter. Applies to SecureString parameters only

      pub fn key_id(&self) -> ::std::option::Option<&str> { self.key_id.as_deref() } @@ -166,17 +166,17 @@ impl ParameterHistoryBuilder { pub fn get_type(&self) -> &::std::option::Option { &self.r#type } - ///

      The ID of the query key used for this parameter.

      + ///

      The alias of the Key Management Service (KMS) key used to encrypt the parameter. Applies to SecureString parameters only

      pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.key_id = ::std::option::Option::Some(input.into()); self } - ///

      The ID of the query key used for this parameter.

      + ///

      The alias of the Key Management Service (KMS) key used to encrypt the parameter. Applies to SecureString parameters only

      pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.key_id = input; self } - ///

      The ID of the query key used for this parameter.

      + ///

      The alias of the Key Management Service (KMS) key used to encrypt the parameter. Applies to SecureString parameters only

      pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.key_id } diff --git a/sdk/ssm/src/types/_parameter_metadata.rs b/sdk/ssm/src/types/_parameter_metadata.rs index b56336bee796..16e094f8ee2a 100644 --- a/sdk/ssm/src/types/_parameter_metadata.rs +++ b/sdk/ssm/src/types/_parameter_metadata.rs @@ -8,7 +8,7 @@ pub struct ParameterMetadata { pub name: ::std::option::Option<::std::string::String>, ///

      The type of parameter. Valid parameter types include the following: String, StringList, and SecureString.

      pub r#type: ::std::option::Option, - ///

      The ID of the query key used for this parameter.

      + ///

      The alias of the Key Management Service (KMS) key used to encrypt the parameter. Applies to SecureString parameters only.

      pub key_id: ::std::option::Option<::std::string::String>, ///

      Date the parameter was last changed or updated.

      pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>, @@ -37,7 +37,7 @@ impl ParameterMetadata { pub fn r#type(&self) -> ::std::option::Option<&crate::types::ParameterType> { self.r#type.as_ref() } - ///

      The ID of the query key used for this parameter.

      + ///

      The alias of the Key Management Service (KMS) key used to encrypt the parameter. Applies to SecureString parameters only.

      pub fn key_id(&self) -> ::std::option::Option<&str> { self.key_id.as_deref() } @@ -129,17 +129,17 @@ impl ParameterMetadataBuilder { pub fn get_type(&self) -> &::std::option::Option { &self.r#type } - ///

      The ID of the query key used for this parameter.

      + ///

      The alias of the Key Management Service (KMS) key used to encrypt the parameter. Applies to SecureString parameters only.

      pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.key_id = ::std::option::Option::Some(input.into()); self } - ///

      The ID of the query key used for this parameter.

      + ///

      The alias of the Key Management Service (KMS) key used to encrypt the parameter. Applies to SecureString parameters only.

      pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.key_id = input; self } - ///

      The ID of the query key used for this parameter.

      + ///

      The alias of the Key Management Service (KMS) key used to encrypt the parameter. Applies to SecureString parameters only.

      pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.key_id } diff --git a/sdk/ssm/src/types/_patch_compliance_data.rs b/sdk/ssm/src/types/_patch_compliance_data.rs index 5a301bc8e8f5..caa45cc34d27 100644 --- a/sdk/ssm/src/types/_patch_compliance_data.rs +++ b/sdk/ssm/src/types/_patch_compliance_data.rs @@ -17,7 +17,9 @@ pub struct PatchComplianceData { pub state: crate::types::PatchComplianceDataState, ///

      The date/time the patch was installed on the managed node. Not all operating systems provide this level of information.

      pub installed_time: ::aws_smithy_types::DateTime, - ///

      The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by the patch.

      + ///

      The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by the patch.

      + ///

      Currently, CVE ID values are reported only for patches with a status of Missing or Failed.

      + ///
      pub cve_ids: ::std::option::Option<::std::string::String>, } impl PatchComplianceData { @@ -50,7 +52,9 @@ impl PatchComplianceData { pub fn installed_time(&self) -> &::aws_smithy_types::DateTime { &self.installed_time } - ///

      The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by the patch.

      + ///

      The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by the patch.

      + ///

      Currently, CVE ID values are reported only for patches with a status of Missing or Failed.

      + ///
      pub fn cve_ids(&self) -> ::std::option::Option<&str> { self.cve_ids.as_deref() } @@ -168,17 +172,23 @@ impl PatchComplianceDataBuilder { pub fn get_installed_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { &self.installed_time } - ///

      The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by the patch.

      + ///

      The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by the patch.

      + ///

      Currently, CVE ID values are reported only for patches with a status of Missing or Failed.

      + ///
      pub fn cve_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.cve_ids = ::std::option::Option::Some(input.into()); self } - ///

      The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by the patch.

      + ///

      The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by the patch.

      + ///

      Currently, CVE ID values are reported only for patches with a status of Missing or Failed.

      + ///
      pub fn set_cve_ids(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.cve_ids = input; self } - ///

      The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by the patch.

      + ///

      The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by the patch.

      + ///

      Currently, CVE ID values are reported only for patches with a status of Missing or Failed.

      + ///
      pub fn get_cve_ids(&self) -> &::std::option::Option<::std::string::String> { &self.cve_ids } diff --git a/versions.toml b/versions.toml index 6fd450379569..3ad68293f313 100644 --- a/versions.toml +++ b/versions.toml @@ -364,9 +364,9 @@ model_hash = '3efd089f35a2a1b2bb697823c0e3438b63bb82f419d7aa21c622d872d14eef8f' [crates.aws-sdk-cloudformation] category = 'AwsSdk' -version = '1.13.0' -source_hash = '594dbe31dc5c17736dac8ffcb1d902f439b133a0e8c2beb452fd044c4e259b44' -model_hash = '7503c7e768812351d5d04830f4cf975aefcd91ecf7947d295f48880622ce71b9' +version = '1.14.0' +source_hash = '06fd26018ff464ac62a9267c21c1204036126d5180a9253a2d6f6383c91026a0' +model_hash = '3383973a41d8b83228f30c46bbe90a81dc6868142d8557cdb8ef97de9b446e09' [crates.aws-sdk-cloudfront] category = 'AwsSdk' @@ -796,9 +796,9 @@ model_hash = '1a7d5d6ed38bee6ff2a4358ef2d4c7fc4702054beb96a2b03d8b5353fa3a508c' [crates.aws-sdk-elasticloadbalancingv2] category = 'AwsSdk' -version = '1.12.0' -source_hash = '39cc1898c137c8b7482fda4b43fac8a94db67b5611bf00b2072af4c45e5e5212' -model_hash = '9a8d20b7ce19adffbc88ed2e2ee89852eceb014b75944518306ca1c10d65c56e' +version = '1.13.0' +source_hash = '26c916283609a26065816d04e184456468913915087c067241fc3b9f47d676a0' +model_hash = '8ef14f408bf94aef933753ed4fb131e5c446e9fb3c978d4094ee80319b8a85d4' [crates.aws-sdk-elasticsearch] category = 'AwsSdk' @@ -928,9 +928,9 @@ model_hash = '9b0cc2aaef022bb5d81b21663b13bf971d10c3d3ec0b09ffb034cb6f57391dbe' [crates.aws-sdk-glue] category = 'AwsSdk' -version = '1.14.0' -source_hash = '3c4a3e5d05f8010a091bd8b6c5c904a59eda5f9f884162325c33c60aef6b19dd' -model_hash = 'd73c4b6be19f65c2d83020eca22a324e624de725a630bccdb5715c970c0d8442' +version = '1.15.0' +source_hash = '51dd03139666a154df6a3e239c876eebdc23a8889149609611f92178df0d1ced' +model_hash = '7dc3b595f242d31ebd4ff95bb59fe4b43df905246d9649fb005536b5e71b0bf5' [crates.aws-sdk-grafana] category = 'AwsSdk' @@ -2062,9 +2062,9 @@ model_hash = 'f40d7c92d5abe756aae63a1b2d825a2177ec11cf0d574d51545a2271e22f7c57' [crates.aws-sdk-ssm] category = 'AwsSdk' -version = '1.12.0' -source_hash = '1d6919c6ff942160adccc13b1051125f7b451a5b4c27b46555eb849d9ccf7834' -model_hash = 'e74318143a931d4f9d3b029f6d99a39bb62531a0aa7668c45ef4b4ce0c2d442a' +version = '1.13.0' +source_hash = 'f42bf3508b44a23d70140b79f8c05cc5cee352412d52b96654cc1808dba0f3f2' +model_hash = '72f80b179283ad307fb9a49f6c009b83e692b283720db6b2d8a11e9d68f846f7' [crates.aws-sdk-ssmcontacts] category = 'AwsSdk' @@ -2413,10 +2413,8 @@ source_hash = 'f37dc1fbecec5502ed65bce4e9ef6ed8f12e782f0ab3c587b917ad3d858c0d96' category = 'AwsRuntime' version = '0.0.0' source_hash = '1253a0429ba1049db057a6db291aed48358550e0ec45cb10b48731db204c2ed6' - -[release] -tag = 'release-2024-01-30' - [release.crates] -aws-sdk-datazone = '1.13.0' -aws-sdk-route53 = '1.13.1' +aws-sdk-cloudformation = '1.14.0' +aws-sdk-elasticloadbalancingv2 = '1.13.0' +aws-sdk-glue = '1.15.0' +aws-sdk-ssm = '1.13.0'