From 5bd193dfea5e730e322beacaed7b1697c7c4f731 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Thu, 1 Aug 2024 18:29:54 +0000 Subject: [PATCH] Regenerated Clients --- .../04f2682b34664d03b84a14a9ebffde1b.json | 8 + .../290e1fb900bd4103b1efeb97de5f446a.json | 8 + .../2ad22b86c67241aa998aaf644a995a38.json | 8 + .../3386398ff7244455a6d11b429ccee3e3.json | 8 + .../3c66af4d05f24b52b6c46bab3d1b7420.json | 8 + .../41575353444b40ffbf474f4155544f00.json | 8 + .../65a1b183f5c04e9487edf450346ba5d7.json | 8 + .../c305360892fc40648c83c6e8251ded7c.json | 8 + .../d2609cebd1b8430b83c02e4ba43429cd.json | 8 + .../e47d48b333ba43e49592bf22ccb96d2a.json | 8 + .../attributevalue/go_module_metadata.go | 2 +- service/bedrock/api_op_CreateEvaluationJob.go | 4 +- service/bedrock/api_op_CreateModelCopyJob.go | 205 ++ .../api_op_CreateModelCustomizationJob.go | 3 +- ...api_op_CreateProvisionedModelThroughput.go | 12 +- service/bedrock/api_op_DeleteCustomModel.go | 3 +- ...api_op_DeleteProvisionedModelThroughput.go | 4 +- service/bedrock/api_op_GetCustomModel.go | 3 +- service/bedrock/api_op_GetEvaluationJob.go | 4 +- service/bedrock/api_op_GetModelCopyJob.go | 190 ++ .../api_op_GetModelCustomizationJob.go | 4 +- .../api_op_GetProvisionedModelThroughput.go | 5 +- service/bedrock/api_op_ListCustomModels.go | 26 +- .../bedrock/api_op_ListFoundationModels.go | 10 +- service/bedrock/api_op_ListModelCopyJobs.go | 278 ++ .../api_op_ListModelCustomizationJobs.go | 22 +- .../api_op_ListProvisionedModelThroughputs.go | 3 +- service/bedrock/api_op_ListTagsForResource.go | 3 +- .../api_op_StopModelCustomizationJob.go | 4 +- service/bedrock/api_op_TagResource.go | 4 +- service/bedrock/api_op_UntagResource.go | 4 +- ...api_op_UpdateProvisionedModelThroughput.go | 3 +- service/bedrock/deserializers.go | 1072 +++++- service/bedrock/generated.json | 3 + service/bedrock/serializers.go | 262 ++ .../api_op_CreateModelCopyJob.go.snap | 37 + .../snapshot/api_op_GetModelCopyJob.go.snap | 36 + .../snapshot/api_op_ListModelCopyJobs.go.snap | 35 + service/bedrock/snapshot_test.go | 72 + service/bedrock/types/enums.go | 21 + service/bedrock/types/types.go | 64 +- service/bedrock/validators.go | 86 + service/controlcatalog/api_op_GetControl.go | 198 ++ service/controlcatalog/api_op_ListControls.go | 240 ++ service/controlcatalog/deserializers.go | 631 +++- service/controlcatalog/generated.json | 3 + service/controlcatalog/serializers.go | 139 + .../snapshot/api_op_GetControl.go.snap | 36 + .../snapshot/api_op_ListControls.go.snap | 35 + service/controlcatalog/snapshot_test.go | 48 + service/controlcatalog/types/enums.go | 43 + service/controlcatalog/types/errors.go | 26 + service/controlcatalog/types/types.go | 54 + service/controlcatalog/validators.go | 46 + service/controltower/doc.go | 45 +- service/memorydb/api_op_DeleteCluster.go | 3 + .../rds/api_op_CopyDBClusterParameterGroup.go | 8 +- service/rds/api_op_CopyDBClusterSnapshot.go | 8 +- service/rds/api_op_CopyDBParameterGroup.go | 8 +- service/rds/api_op_CopyDBSnapshot.go | 8 +- service/rds/api_op_CopyOptionGroup.go | 8 +- .../rds/api_op_CreateCustomDBEngineVersion.go | 16 +- .../rds/api_op_CreateDBInstanceReadReplica.go | 8 +- service/rds/api_op_CreateDBProxyEndpoint.go | 8 +- service/rds/api_op_CreateDBShardGroup.go | 6 + service/rds/api_op_CreateDBSnapshot.go | 8 +- service/rds/api_op_CreateEventSubscription.go | 8 +- service/rds/api_op_CreateIntegration.go | 16 +- service/rds/api_op_CreateTenantDatabase.go | 8 +- .../rds/api_op_DeleteCustomDBEngineVersion.go | 8 +- service/rds/api_op_DeleteDBCluster.go | 21 +- service/rds/api_op_DeleteDBShardGroup.go | 3 + service/rds/api_op_DeleteIntegration.go | 8 +- .../rds/api_op_DescribeDBClusterParameters.go | 2 +- .../rds/api_op_ModifyCustomDBEngineVersion.go | 8 +- service/rds/api_op_ModifyDBShardGroup.go | 6 + service/rds/api_op_ModifyIntegration.go | 8 +- ..._op_PurchaseReservedDBInstancesOffering.go | 8 +- service/rds/api_op_RebootDBShardGroup.go | 3 + service/rds/api_op_RestoreDBClusterFromS3.go | 8 +- .../api_op_RestoreDBClusterToPointInTime.go | 8 +- .../api_op_RestoreDBInstanceFromDBSnapshot.go | 8 +- .../api_op_RestoreDBInstanceToPointInTime.go | 8 +- service/rds/deserializers.go | 85 + service/rds/serializers.go | 36 + service/rds/types/types.go | 87 +- service/sagemaker/deserializers.go | 118 + service/sagemaker/serializers.go | 50 + service/sagemaker/types/types.go | 36 + service/ssmquicksetup/LICENSE.txt | 202 ++ service/ssmquicksetup/api_client.go | 628 ++++ service/ssmquicksetup/api_client_test.go | 127 + .../api_op_CreateConfigurationManager.go | 156 + .../api_op_DeleteConfigurationManager.go | 137 + .../api_op_GetConfigurationManager.go | 167 + .../api_op_GetServiceSettings.go | 135 + .../api_op_ListConfigurationManagers.go | 247 ++ .../api_op_ListQuickSetupTypes.go | 133 + .../api_op_ListTagsForResource.go | 142 + service/ssmquicksetup/api_op_TagResource.go | 142 + service/ssmquicksetup/api_op_UntagResource.go | 142 + .../api_op_UpdateConfigurationDefinition.go | 154 + .../api_op_UpdateConfigurationManager.go | 143 + .../api_op_UpdateServiceSettings.go | 132 + service/ssmquicksetup/auth.go | 284 ++ service/ssmquicksetup/deserializers.go | 2875 +++++++++++++++++ service/ssmquicksetup/doc.go | 9 + service/ssmquicksetup/endpoints.go | 531 +++ .../ssmquicksetup/endpoints_config_test.go | 139 + service/ssmquicksetup/endpoints_test.go | 820 +++++ service/ssmquicksetup/generated.json | 44 + service/ssmquicksetup/go.mod | 16 + service/ssmquicksetup/go.sum | 2 + service/ssmquicksetup/go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 296 ++ .../internal/endpoints/endpoints_test.go | 11 + service/ssmquicksetup/options.go | 227 ++ service/ssmquicksetup/protocol_test.go | 3 + service/ssmquicksetup/serializers.go | 1050 ++++++ .../api_op_CreateConfigurationManager.go.snap | 36 + .../api_op_DeleteConfigurationManager.go.snap | 36 + .../api_op_GetConfigurationManager.go.snap | 36 + .../api_op_GetServiceSettings.go.snap | 35 + .../api_op_ListConfigurationManagers.go.snap | 36 + .../api_op_ListQuickSetupTypes.go.snap | 35 + .../api_op_ListTagsForResource.go.snap | 36 + .../snapshot/api_op_TagResource.go.snap | 36 + .../snapshot/api_op_UntagResource.go.snap | 36 + ...i_op_UpdateConfigurationDefinition.go.snap | 36 + .../api_op_UpdateConfigurationManager.go.snap | 36 + .../api_op_UpdateServiceSettings.go.snap | 35 + service/ssmquicksetup/snapshot_test.go | 350 ++ service/ssmquicksetup/types/enums.go | 57 + service/ssmquicksetup/types/errors.go | 166 + service/ssmquicksetup/types/types.go | 752 +++++ service/ssmquicksetup/validators.go | 447 +++ service/support/doc.go | 2 +- service/support/types/types.go | 11 +- 138 files changed, 15757 insertions(+), 305 deletions(-) create mode 100644 .changelog/04f2682b34664d03b84a14a9ebffde1b.json create mode 100644 .changelog/290e1fb900bd4103b1efeb97de5f446a.json create mode 100644 .changelog/2ad22b86c67241aa998aaf644a995a38.json create mode 100644 .changelog/3386398ff7244455a6d11b429ccee3e3.json create mode 100644 .changelog/3c66af4d05f24b52b6c46bab3d1b7420.json create mode 100644 .changelog/41575353444b40ffbf474f4155544f00.json create mode 100644 .changelog/65a1b183f5c04e9487edf450346ba5d7.json create mode 100644 .changelog/c305360892fc40648c83c6e8251ded7c.json create mode 100644 .changelog/d2609cebd1b8430b83c02e4ba43429cd.json create mode 100644 .changelog/e47d48b333ba43e49592bf22ccb96d2a.json create mode 100644 service/bedrock/api_op_CreateModelCopyJob.go create mode 100644 service/bedrock/api_op_GetModelCopyJob.go create mode 100644 service/bedrock/api_op_ListModelCopyJobs.go create mode 100644 service/bedrock/snapshot/api_op_CreateModelCopyJob.go.snap create mode 100644 service/bedrock/snapshot/api_op_GetModelCopyJob.go.snap create mode 100644 service/bedrock/snapshot/api_op_ListModelCopyJobs.go.snap create mode 100644 service/controlcatalog/api_op_GetControl.go create mode 100644 service/controlcatalog/api_op_ListControls.go create mode 100644 service/controlcatalog/snapshot/api_op_GetControl.go.snap create mode 100644 service/controlcatalog/snapshot/api_op_ListControls.go.snap create mode 100644 service/controlcatalog/types/enums.go create mode 100644 service/ssmquicksetup/LICENSE.txt create mode 100644 service/ssmquicksetup/api_client.go create mode 100644 service/ssmquicksetup/api_client_test.go create mode 100644 service/ssmquicksetup/api_op_CreateConfigurationManager.go create mode 100644 service/ssmquicksetup/api_op_DeleteConfigurationManager.go create mode 100644 service/ssmquicksetup/api_op_GetConfigurationManager.go create mode 100644 service/ssmquicksetup/api_op_GetServiceSettings.go create mode 100644 service/ssmquicksetup/api_op_ListConfigurationManagers.go create mode 100644 service/ssmquicksetup/api_op_ListQuickSetupTypes.go create mode 100644 service/ssmquicksetup/api_op_ListTagsForResource.go create mode 100644 service/ssmquicksetup/api_op_TagResource.go create mode 100644 service/ssmquicksetup/api_op_UntagResource.go create mode 100644 service/ssmquicksetup/api_op_UpdateConfigurationDefinition.go create mode 100644 service/ssmquicksetup/api_op_UpdateConfigurationManager.go create mode 100644 service/ssmquicksetup/api_op_UpdateServiceSettings.go create mode 100644 service/ssmquicksetup/auth.go create mode 100644 service/ssmquicksetup/deserializers.go create mode 100644 service/ssmquicksetup/doc.go create mode 100644 service/ssmquicksetup/endpoints.go create mode 100644 service/ssmquicksetup/endpoints_config_test.go create mode 100644 service/ssmquicksetup/endpoints_test.go create mode 100644 service/ssmquicksetup/generated.json create mode 100644 service/ssmquicksetup/go.mod create mode 100644 service/ssmquicksetup/go.sum create mode 100644 service/ssmquicksetup/go_module_metadata.go create mode 100644 service/ssmquicksetup/internal/endpoints/endpoints.go create mode 100644 service/ssmquicksetup/internal/endpoints/endpoints_test.go create mode 100644 service/ssmquicksetup/options.go create mode 100644 service/ssmquicksetup/protocol_test.go create mode 100644 service/ssmquicksetup/serializers.go create mode 100644 service/ssmquicksetup/snapshot/api_op_CreateConfigurationManager.go.snap create mode 100644 service/ssmquicksetup/snapshot/api_op_DeleteConfigurationManager.go.snap create mode 100644 service/ssmquicksetup/snapshot/api_op_GetConfigurationManager.go.snap create mode 100644 service/ssmquicksetup/snapshot/api_op_GetServiceSettings.go.snap create mode 100644 service/ssmquicksetup/snapshot/api_op_ListConfigurationManagers.go.snap create mode 100644 service/ssmquicksetup/snapshot/api_op_ListQuickSetupTypes.go.snap create mode 100644 service/ssmquicksetup/snapshot/api_op_ListTagsForResource.go.snap create mode 100644 service/ssmquicksetup/snapshot/api_op_TagResource.go.snap create mode 100644 service/ssmquicksetup/snapshot/api_op_UntagResource.go.snap create mode 100644 service/ssmquicksetup/snapshot/api_op_UpdateConfigurationDefinition.go.snap create mode 100644 service/ssmquicksetup/snapshot/api_op_UpdateConfigurationManager.go.snap create mode 100644 service/ssmquicksetup/snapshot/api_op_UpdateServiceSettings.go.snap create mode 100644 service/ssmquicksetup/snapshot_test.go create mode 100644 service/ssmquicksetup/types/enums.go create mode 100644 service/ssmquicksetup/types/errors.go create mode 100644 service/ssmquicksetup/types/types.go create mode 100644 service/ssmquicksetup/validators.go diff --git a/.changelog/04f2682b34664d03b84a14a9ebffde1b.json b/.changelog/04f2682b34664d03b84a14a9ebffde1b.json new file mode 100644 index 00000000000..4b7aca0bca0 --- /dev/null +++ b/.changelog/04f2682b34664d03b84a14a9ebffde1b.json @@ -0,0 +1,8 @@ +{ + "id": "04f2682b-3466-4d03-b84a-14a9ebffde1b", + "type": "documentation", + "description": "Doc only update for changes to deletion API.", + "modules": [ + "service/memorydb" + ] +} \ No newline at end of file diff --git a/.changelog/290e1fb900bd4103b1efeb97de5f446a.json b/.changelog/290e1fb900bd4103b1efeb97de5f446a.json new file mode 100644 index 00000000000..f51cb8af021 --- /dev/null +++ b/.changelog/290e1fb900bd4103b1efeb97de5f446a.json @@ -0,0 +1,8 @@ +{ + "id": "290e1fb9-00bd-4103-b1ef-eb97de5f446a", + "type": "feature", + "description": "This release adds support for Amazon EMR Serverless applications in SageMaker Studio for running data processing jobs.", + "modules": [ + "service/sagemaker" + ] +} \ No newline at end of file diff --git a/.changelog/2ad22b86c67241aa998aaf644a995a38.json b/.changelog/2ad22b86c67241aa998aaf644a995a38.json new file mode 100644 index 00000000000..b199747b5fe --- /dev/null +++ b/.changelog/2ad22b86c67241aa998aaf644a995a38.json @@ -0,0 +1,8 @@ +{ + "id": "2ad22b86-c672-41aa-998a-af644a995a38", + "type": "feature", + "description": "Add v2 smoke tests and smithy smokeTests trait for SDK testing.", + "modules": [ + "service/iam" + ] +} \ No newline at end of file diff --git a/.changelog/3386398ff7244455a6d11b429ccee3e3.json b/.changelog/3386398ff7244455a6d11b429ccee3e3.json new file mode 100644 index 00000000000..86f32b3f352 --- /dev/null +++ b/.changelog/3386398ff7244455a6d11b429ccee3e3.json @@ -0,0 +1,8 @@ +{ + "id": "3386398f-f724-4455-a6d1-1b429ccee3e3", + "type": "feature", + "description": "AWS Control Tower provides two new public APIs controlcatalog:ListControls and controlcatalog:GetControl under controlcatalog service namespace, which enable customers to programmatically retrieve control metadata of available controls.", + "modules": [ + "service/controlcatalog" + ] +} \ No newline at end of file diff --git a/.changelog/3c66af4d05f24b52b6c46bab3d1b7420.json b/.changelog/3c66af4d05f24b52b6c46bab3d1b7420.json new file mode 100644 index 00000000000..b06560b4944 --- /dev/null +++ b/.changelog/3c66af4d05f24b52b6c46bab3d1b7420.json @@ -0,0 +1,8 @@ +{ + "id": "3c66af4d-05f2-4b52-b6c4-6bab3d1b7420", + "type": "documentation", + "description": "Updated Control Tower service documentation for controlcatalog control ARN support with existing Control Tower public APIs", + "modules": [ + "service/controltower" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..38d25a11340 --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,8 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/ssmquicksetup" + ] +} \ No newline at end of file diff --git a/.changelog/65a1b183f5c04e9487edf450346ba5d7.json b/.changelog/65a1b183f5c04e9487edf450346ba5d7.json new file mode 100644 index 00000000000..eaeaa9aacf2 --- /dev/null +++ b/.changelog/65a1b183f5c04e9487edf450346ba5d7.json @@ -0,0 +1,8 @@ +{ + "id": "65a1b183-f5c0-4e94-87ed-f450346ba5d7", + "type": "feature", + "description": "API and Documentation for Bedrock Model Copy feature. This feature lets you share and copy a custom model from one region to another or one account to another.", + "modules": [ + "service/bedrock" + ] +} \ No newline at end of file diff --git a/.changelog/c305360892fc40648c83c6e8251ded7c.json b/.changelog/c305360892fc40648c83c6e8251ded7c.json new file mode 100644 index 00000000000..1ee6a09c49d --- /dev/null +++ b/.changelog/c305360892fc40648c83c6e8251ded7c.json @@ -0,0 +1,8 @@ +{ + "id": "c3053608-92fc-4064-8c83-c6e8251ded7c", + "type": "documentation", + "description": "Doc only updates to CaseDetails", + "modules": [ + "service/support" + ] +} \ No newline at end of file diff --git a/.changelog/d2609cebd1b8430b83c02e4ba43429cd.json b/.changelog/d2609cebd1b8430b83c02e4ba43429cd.json new file mode 100644 index 00000000000..8f43a67a37f --- /dev/null +++ b/.changelog/d2609cebd1b8430b83c02e4ba43429cd.json @@ -0,0 +1,8 @@ +{ + "id": "d2609ceb-d1b8-430b-83c0-2e4ba43429cd", + "type": "feature", + "description": "This release adds API support for the QuickSetup feature of AWS Systems Manager", + "modules": [ + "service/ssmquicksetup" + ] +} \ No newline at end of file diff --git a/.changelog/e47d48b333ba43e49592bf22ccb96d2a.json b/.changelog/e47d48b333ba43e49592bf22ccb96d2a.json new file mode 100644 index 00000000000..6551d47d512 --- /dev/null +++ b/.changelog/e47d48b333ba43e49592bf22ccb96d2a.json @@ -0,0 +1,8 @@ +{ + "id": "e47d48b3-33ba-43e4-9592-bf22ccb96d2a", + "type": "feature", + "description": "This release adds support for specifying optional MinACU parameter in CreateDBShardGroup and ModifyDBShardGroup API. DBShardGroup response will contain MinACU if specified.", + "modules": [ + "service/rds" + ] +} \ No newline at end of file diff --git a/feature/dynamodbstreams/attributevalue/go_module_metadata.go b/feature/dynamodbstreams/attributevalue/go_module_metadata.go index 4aa1d2664df..505e79ec5c4 100644 --- a/feature/dynamodbstreams/attributevalue/go_module_metadata.go +++ b/feature/dynamodbstreams/attributevalue/go_module_metadata.go @@ -3,4 +3,4 @@ package attributevalue // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.54" +const goModuleVersion = "1.14.10" diff --git a/service/bedrock/api_op_CreateEvaluationJob.go b/service/bedrock/api_op_CreateEvaluationJob.go index 2e3c2201d40..0c3599cb010 100644 --- a/service/bedrock/api_op_CreateEvaluationJob.go +++ b/service/bedrock/api_op_CreateEvaluationJob.go @@ -13,9 +13,9 @@ import ( // API operation for creating and managing Amazon Bedrock automatic model // evaluation jobs and model evaluation jobs that use human workers. To learn more -// about the requirements for creating a model evaluation job see, [Model evaluations]. +// about the requirements for creating a model evaluation job see, [Model evaluation]. // -// [Model evaluations]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation.html +// [Model evaluation]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation.html func (c *Client) CreateEvaluationJob(ctx context.Context, params *CreateEvaluationJobInput, optFns ...func(*Options)) (*CreateEvaluationJobOutput, error) { if params == nil { params = &CreateEvaluationJobInput{} diff --git a/service/bedrock/api_op_CreateModelCopyJob.go b/service/bedrock/api_op_CreateModelCopyJob.go new file mode 100644 index 00000000000..d2cefb0bb2e --- /dev/null +++ b/service/bedrock/api_op_CreateModelCopyJob.go @@ -0,0 +1,205 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrock + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrock/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Copies a model to another region so that it can be used there. For more +// information, see [Copy models to be used in other regions]in the [Amazon Bedrock User Guide]. +// +// [Copy models to be used in other regions]: https://docs.aws.amazon.com/bedrock/latest/userguide/copy-model.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html +func (c *Client) CreateModelCopyJob(ctx context.Context, params *CreateModelCopyJobInput, optFns ...func(*Options)) (*CreateModelCopyJobOutput, error) { + if params == nil { + params = &CreateModelCopyJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateModelCopyJob", params, optFns, c.addOperationCreateModelCopyJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateModelCopyJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateModelCopyJobInput struct { + + // The Amazon Resource Name (ARN) of the model to be copied. + // + // This member is required. + SourceModelArn *string + + // A name for the copied model. + // + // This member is required. + TargetModelName *string + + // A unique, case-sensitive identifier to ensure that the API request completes no + // more than one time. If this token matches a previous request, Amazon Bedrock + // ignores the request, but does not return an error. For more information, see [Ensuring idempotency]. + // + // [Ensuring idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html + ClientRequestToken *string + + // The ARN of the KMS key that you use to encrypt the model copy. + ModelKmsKeyId *string + + // Tags to associate with the target model. For more information, see [Tag resources] in the [Amazon Bedrock User Guide]. + // + // [Tag resources]: https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html + // [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html + TargetModelTags []types.Tag + + noSmithyDocumentSerde +} + +type CreateModelCopyJobOutput struct { + + // The Amazon Resource Name (ARN) of the model copy job. + // + // This member is required. + JobArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateModelCopyJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateModelCopyJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateModelCopyJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateModelCopyJob"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateModelCopyJobMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateModelCopyJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateModelCopyJob(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateModelCopyJob struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateModelCopyJob) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateModelCopyJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateModelCopyJobInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateModelCopyJobInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateModelCopyJobMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateModelCopyJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateModelCopyJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateModelCopyJob", + } +} diff --git a/service/bedrock/api_op_CreateModelCustomizationJob.go b/service/bedrock/api_op_CreateModelCustomizationJob.go index 217b4998019..45a4a4afba3 100644 --- a/service/bedrock/api_op_CreateModelCustomizationJob.go +++ b/service/bedrock/api_op_CreateModelCustomizationJob.go @@ -24,9 +24,10 @@ import ( // the base model and the training/validation data size. To monitor a job, use the // GetModelCustomizationJob operation to retrieve the job status. // -// For more information, see [Custom models] in the Amazon Bedrock User Guide. +// For more information, see [Custom models] in the [Amazon Bedrock User Guide]. // // [Custom models]: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html // [Prepare the datasets]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-prepare.html func (c *Client) CreateModelCustomizationJob(ctx context.Context, params *CreateModelCustomizationJobInput, optFns ...func(*Options)) (*CreateModelCustomizationJobOutput, error) { if params == nil { diff --git a/service/bedrock/api_op_CreateProvisionedModelThroughput.go b/service/bedrock/api_op_CreateProvisionedModelThroughput.go index 20d190adfbc..3dc61b26670 100644 --- a/service/bedrock/api_op_CreateProvisionedModelThroughput.go +++ b/service/bedrock/api_op_CreateProvisionedModelThroughput.go @@ -13,10 +13,11 @@ import ( // Creates dedicated throughput for a base or custom model with the model units // and for the duration that you specify. For pricing details, see [Amazon Bedrock Pricing]. For more -// information, see [Provisioned Throughput]in the Amazon Bedrock User Guide. +// information, see [Provisioned Throughput]in the [Amazon Bedrock User Guide]. // // [Amazon Bedrock Pricing]: http://aws.amazon.com/bedrock/pricing/ // [Provisioned Throughput]: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) CreateProvisionedModelThroughput(ctx context.Context, params *CreateProvisionedModelThroughputInput, optFns ...func(*Options)) (*CreateProvisionedModelThroughputOutput, error) { if params == nil { params = &CreateProvisionedModelThroughputInput{} @@ -36,9 +37,10 @@ type CreateProvisionedModelThroughputInput struct { // The Amazon Resource Name (ARN) or name of the model to associate with this // Provisioned Throughput. For a list of models for which you can purchase - // Provisioned Throughput, see [Amazon Bedrock model IDs for purchasing Provisioned Throughput]in the Amazon Bedrock User Guide. + // Provisioned Throughput, see [Amazon Bedrock model IDs for purchasing Provisioned Throughput]in the [Amazon Bedrock User Guide]. // // [Amazon Bedrock model IDs for purchasing Provisioned Throughput]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#prov-throughput-models + // [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html // // This member is required. ModelId *string @@ -50,13 +52,14 @@ type CreateProvisionedModelThroughputInput struct { // purchasing Provisioned Throughputs with commitment. You must first visit the [Amazon Web Services support center]to // request MUs. // - // For model unit quotas, see [Provisioned Throughput quotas] in the Amazon Bedrock User Guide. + // For model unit quotas, see [Provisioned Throughput quotas] in the [Amazon Bedrock User Guide]. // // For more information about what an MU specifies, contact your Amazon Web // Services account manager. // // [Amazon Web Services support center]: https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase // [Provisioned Throughput quotas]: https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html#prov-thru-quotas + // [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html // // This member is required. ModelUnits *int32 @@ -79,8 +82,9 @@ type CreateProvisionedModelThroughputInput struct { // no-commit Provisioned Throughput, omit this field. // // Custom models support all levels of commitment. To see which base models - // support no commitment, see [Supported regions and models for Provisioned Throughput]in the Amazon Bedrock User Guide + // support no commitment, see [Supported regions and models for Provisioned Throughput]in the [Amazon Bedrock User Guide] // + // [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html // [Supported regions and models for Provisioned Throughput]: https://docs.aws.amazon.com/bedrock/latest/userguide/pt-supported.html CommitmentDuration types.CommitmentDuration diff --git a/service/bedrock/api_op_DeleteCustomModel.go b/service/bedrock/api_op_DeleteCustomModel.go index a7912376de9..07a03d0829c 100644 --- a/service/bedrock/api_op_DeleteCustomModel.go +++ b/service/bedrock/api_op_DeleteCustomModel.go @@ -11,9 +11,10 @@ import ( ) // Deletes a custom model that you created earlier. For more information, see [Custom models] in -// the Amazon Bedrock User Guide. +// the [Amazon Bedrock User Guide]. // // [Custom models]: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) DeleteCustomModel(ctx context.Context, params *DeleteCustomModelInput, optFns ...func(*Options)) (*DeleteCustomModelOutput, error) { if params == nil { params = &DeleteCustomModelInput{} diff --git a/service/bedrock/api_op_DeleteProvisionedModelThroughput.go b/service/bedrock/api_op_DeleteProvisionedModelThroughput.go index a72e5c9e6cc..4fb750b2fdb 100644 --- a/service/bedrock/api_op_DeleteProvisionedModelThroughput.go +++ b/service/bedrock/api_op_DeleteProvisionedModelThroughput.go @@ -11,10 +11,10 @@ import ( ) // Deletes a Provisioned Throughput. You can't delete a Provisioned Throughput -// before the commitment term is over. For more information, see [Provisioned Throughput]in the Amazon -// Bedrock User Guide. +// before the commitment term is over. For more information, see [Provisioned Throughput]in the [Amazon Bedrock User Guide]. // // [Provisioned Throughput]: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) DeleteProvisionedModelThroughput(ctx context.Context, params *DeleteProvisionedModelThroughputInput, optFns ...func(*Options)) (*DeleteProvisionedModelThroughputOutput, error) { if params == nil { params = &DeleteProvisionedModelThroughputInput{} diff --git a/service/bedrock/api_op_GetCustomModel.go b/service/bedrock/api_op_GetCustomModel.go index 6ba0399e1a0..1c27f3c9321 100644 --- a/service/bedrock/api_op_GetCustomModel.go +++ b/service/bedrock/api_op_GetCustomModel.go @@ -13,9 +13,10 @@ import ( ) // Get the properties associated with a Amazon Bedrock custom model that you have -// created.For more information, see [Custom models]in the Amazon Bedrock User Guide. +// created.For more information, see [Custom models]in the [Amazon Bedrock User Guide]. // // [Custom models]: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) GetCustomModel(ctx context.Context, params *GetCustomModelInput, optFns ...func(*Options)) (*GetCustomModelOutput, error) { if params == nil { params = &GetCustomModelInput{} diff --git a/service/bedrock/api_op_GetEvaluationJob.go b/service/bedrock/api_op_GetEvaluationJob.go index a7d0f4a055a..e6f2675d4a8 100644 --- a/service/bedrock/api_op_GetEvaluationJob.go +++ b/service/bedrock/api_op_GetEvaluationJob.go @@ -13,9 +13,9 @@ import ( ) // Retrieves the properties associated with a model evaluation job, including the -// status of the job. For more information, see [Model evaluations]. +// status of the job. For more information, see [Model evaluation]. // -// [Model evaluations]: https://docs.aws.amazon.com/bedrock/latest/userguide/latest/userguide/model-evaluation.html +// [Model evaluation]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation.html func (c *Client) GetEvaluationJob(ctx context.Context, params *GetEvaluationJobInput, optFns ...func(*Options)) (*GetEvaluationJobOutput, error) { if params == nil { params = &GetEvaluationJobInput{} diff --git a/service/bedrock/api_op_GetModelCopyJob.go b/service/bedrock/api_op_GetModelCopyJob.go new file mode 100644 index 00000000000..2560a327f54 --- /dev/null +++ b/service/bedrock/api_op_GetModelCopyJob.go @@ -0,0 +1,190 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrock + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrock/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about a model copy job. For more information, see [Copy models to be used in other regions] in the [Amazon Bedrock User Guide] +// . +// +// [Copy models to be used in other regions]: https://docs.aws.amazon.com/bedrock/latest/userguide/copy-model.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html +func (c *Client) GetModelCopyJob(ctx context.Context, params *GetModelCopyJobInput, optFns ...func(*Options)) (*GetModelCopyJobOutput, error) { + if params == nil { + params = &GetModelCopyJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetModelCopyJob", params, optFns, c.addOperationGetModelCopyJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetModelCopyJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetModelCopyJobInput struct { + + // The Amazon Resource Name (ARN) of the model copy job. + // + // This member is required. + JobArn *string + + noSmithyDocumentSerde +} + +type GetModelCopyJobOutput struct { + + // The time at which the model copy job was created. + // + // This member is required. + CreationTime *time.Time + + // The Amazon Resource Name (ARN) of the model copy job. + // + // This member is required. + JobArn *string + + // The unique identifier of the account that the model being copied originated + // from. + // + // This member is required. + SourceAccountId *string + + // The Amazon Resource Name (ARN) of the original model being copied. + // + // This member is required. + SourceModelArn *string + + // The status of the model copy job. + // + // This member is required. + Status types.ModelCopyJobStatus + + // The Amazon Resource Name (ARN) of the copied model. + // + // This member is required. + TargetModelArn *string + + // An error message for why the model copy job failed. + FailureMessage *string + + // The name of the original model being copied. + SourceModelName *string + + // The Amazon Resource Name (ARN) of the KMS key encrypting the copied model. + TargetModelKmsKeyArn *string + + // The name of the copied model. + TargetModelName *string + + // The tags associated with the copied model. + TargetModelTags []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetModelCopyJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetModelCopyJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetModelCopyJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetModelCopyJob"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetModelCopyJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetModelCopyJob(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetModelCopyJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetModelCopyJob", + } +} diff --git a/service/bedrock/api_op_GetModelCustomizationJob.go b/service/bedrock/api_op_GetModelCustomizationJob.go index 535f5e2cdbc..15a6ec0a06b 100644 --- a/service/bedrock/api_op_GetModelCustomizationJob.go +++ b/service/bedrock/api_op_GetModelCustomizationJob.go @@ -13,10 +13,10 @@ import ( ) // Retrieves the properties associated with a model-customization job, including -// the status of the job. For more information, see [Custom models]in the Amazon Bedrock User -// Guide. +// the status of the job. For more information, see [Custom models]in the [Amazon Bedrock User Guide]. // // [Custom models]: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) GetModelCustomizationJob(ctx context.Context, params *GetModelCustomizationJobInput, optFns ...func(*Options)) (*GetModelCustomizationJobOutput, error) { if params == nil { params = &GetModelCustomizationJobInput{} diff --git a/service/bedrock/api_op_GetProvisionedModelThroughput.go b/service/bedrock/api_op_GetProvisionedModelThroughput.go index 41e0e140440..0380ea36652 100644 --- a/service/bedrock/api_op_GetProvisionedModelThroughput.go +++ b/service/bedrock/api_op_GetProvisionedModelThroughput.go @@ -12,10 +12,11 @@ import ( "time" ) -// Returns details for a Provisioned Throughput. For more information, see [Provisioned Throughput] in the -// Amazon Bedrock User Guide. +// Returns details for a Provisioned Throughput. For more information, see [Provisioned Throughput] in the [Amazon Bedrock User Guide] +// . // // [Provisioned Throughput]: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) GetProvisionedModelThroughput(ctx context.Context, params *GetProvisionedModelThroughputInput, optFns ...func(*Options)) (*GetProvisionedModelThroughputOutput, error) { if params == nil { params = &GetProvisionedModelThroughputInput{} diff --git a/service/bedrock/api_op_ListCustomModels.go b/service/bedrock/api_op_ListCustomModels.go index c8fceca93b1..461b62ff1e3 100644 --- a/service/bedrock/api_op_ListCustomModels.go +++ b/service/bedrock/api_op_ListCustomModels.go @@ -15,9 +15,10 @@ import ( // Returns a list of the custom models that you have created with the // CreateModelCustomizationJob operation. // -// For more information, see [Custom models] in the Amazon Bedrock User Guide. +// For more information, see [Custom models] in the [Amazon Bedrock User Guide]. // // [Custom models]: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) ListCustomModels(ctx context.Context, params *ListCustomModelsInput, optFns ...func(*Options)) (*ListCustomModelsOutput, error) { if params == nil { params = &ListCustomModelsInput{} @@ -49,14 +50,22 @@ type ListCustomModelsInput struct { // matches this parameter. FoundationModelArnEquals *string - // Maximum number of results to return in the response. + // Return custom models depending on if the current account owns them ( true ) or + // if they were shared with the current account ( false ). + IsOwned *bool + + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. MaxResults *int32 // Return custom models only if the job name contains these characters. NameContains *string - // Continuation token from the previous response, for Amazon Bedrock to list the - // next set of results. + // If the total number of results is greater than the maxResults value provided in + // the request, enter the token returned in the nextToken field in the response in + // this field to return the next batch of results. NextToken *string // The field to sort by in the returned list of models. @@ -73,7 +82,9 @@ type ListCustomModelsOutput struct { // Model summaries. ModelSummaries []types.CustomModelSummary - // Continuation token for the next request to list the next set of results. + // If the total number of results is greater than the maxResults value provided in + // the request, use this token when making another request in the nextToken field + // to return the next batch of results. NextToken *string // Metadata pertaining to the operation's result. @@ -166,7 +177,10 @@ func (c *Client) addOperationListCustomModelsMiddlewares(stack *middleware.Stack // ListCustomModelsPaginatorOptions is the paginator options for ListCustomModels type ListCustomModelsPaginatorOptions struct { - // Maximum number of results to return in the response. + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/bedrock/api_op_ListFoundationModels.go b/service/bedrock/api_op_ListFoundationModels.go index a0ac0498a3c..bcec57e3f16 100644 --- a/service/bedrock/api_op_ListFoundationModels.go +++ b/service/bedrock/api_op_ListFoundationModels.go @@ -12,10 +12,10 @@ import ( ) // Lists Amazon Bedrock foundation models that you can use. You can filter the -// results with the request parameters. For more information, see [Foundation models]in the Amazon -// Bedrock User Guide. +// results with the request parameters. For more information, see [Foundation models]in the [Amazon Bedrock User Guide]. // // [Foundation models]: https://docs.aws.amazon.com/bedrock/latest/userguide/foundation-models.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) ListFoundationModels(ctx context.Context, params *ListFoundationModelsInput, optFns ...func(*Options)) (*ListFoundationModelsOutput, error) { if params == nil { params = &ListFoundationModelsInput{} @@ -34,15 +34,17 @@ func (c *Client) ListFoundationModels(ctx context.Context, params *ListFoundatio type ListFoundationModelsInput struct { // Return models that support the customization type that you specify. For more - // information, see [Custom models]in the Amazon Bedrock User Guide. + // information, see [Custom models]in the [Amazon Bedrock User Guide]. // // [Custom models]: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html + // [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html ByCustomizationType types.ModelCustomization // Return models that support the inference type that you specify. For more - // information, see [Provisioned Throughput]in the Amazon Bedrock User Guide. + // information, see [Provisioned Throughput]in the [Amazon Bedrock User Guide]. // // [Provisioned Throughput]: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html + // [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html ByInferenceType types.InferenceType // Return models that support the output modality that you specify. diff --git a/service/bedrock/api_op_ListModelCopyJobs.go b/service/bedrock/api_op_ListModelCopyJobs.go new file mode 100644 index 00000000000..7301da4befc --- /dev/null +++ b/service/bedrock/api_op_ListModelCopyJobs.go @@ -0,0 +1,278 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrock + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/bedrock/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns a list of model copy jobs that you have submitted. You can filter the +// jobs to return based on one or more criteria. For more information, see [Copy models to be used in other regions]in the [Amazon Bedrock User Guide]. +// +// [Copy models to be used in other regions]: https://docs.aws.amazon.com/bedrock/latest/userguide/copy-model.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html +func (c *Client) ListModelCopyJobs(ctx context.Context, params *ListModelCopyJobsInput, optFns ...func(*Options)) (*ListModelCopyJobsOutput, error) { + if params == nil { + params = &ListModelCopyJobsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListModelCopyJobs", params, optFns, c.addOperationListModelCopyJobsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListModelCopyJobsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListModelCopyJobsInput struct { + + // Filters for model copy jobs created after the specified time. + CreationTimeAfter *time.Time + + // Filters for model copy jobs created before the specified time. + CreationTimeBefore *time.Time + + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + MaxResults *int32 + + // If the total number of results is greater than the maxResults value provided in + // the request, enter the token returned in the nextToken field in the response in + // this field to return the next batch of results. + NextToken *string + + // The field to sort by in the returned list of model copy jobs. + SortBy types.SortJobsBy + + // Specifies whether to sort the results in ascending or descending order. + SortOrder types.SortOrder + + // Filters for model copy jobs in which the account that the source model belongs + // to is equal to the value that you specify. + SourceAccountEquals *string + + // Filters for model copy jobs in which the Amazon Resource Name (ARN) of the + // source model to is equal to the value that you specify. + SourceModelArnEquals *string + + // Filters for model copy jobs whose status matches the value that you specify. + StatusEquals types.ModelCopyJobStatus + + // Filters for model copy jobs in which the name of the copied model contains the + // string that you specify. + TargetModelNameContains *string + + noSmithyDocumentSerde +} + +type ListModelCopyJobsOutput struct { + + // A list of information about each model copy job. + ModelCopyJobSummaries []types.ModelCopyJobSummary + + // If the total number of results is greater than the maxResults value provided in + // the request, use this token when making another request in the nextToken field + // to return the next batch of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListModelCopyJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListModelCopyJobs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListModelCopyJobs{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListModelCopyJobs"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListModelCopyJobs(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListModelCopyJobsPaginatorOptions is the paginator options for ListModelCopyJobs +type ListModelCopyJobsPaginatorOptions struct { + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListModelCopyJobsPaginator is a paginator for ListModelCopyJobs +type ListModelCopyJobsPaginator struct { + options ListModelCopyJobsPaginatorOptions + client ListModelCopyJobsAPIClient + params *ListModelCopyJobsInput + nextToken *string + firstPage bool +} + +// NewListModelCopyJobsPaginator returns a new ListModelCopyJobsPaginator +func NewListModelCopyJobsPaginator(client ListModelCopyJobsAPIClient, params *ListModelCopyJobsInput, optFns ...func(*ListModelCopyJobsPaginatorOptions)) *ListModelCopyJobsPaginator { + if params == nil { + params = &ListModelCopyJobsInput{} + } + + options := ListModelCopyJobsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListModelCopyJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListModelCopyJobsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListModelCopyJobs page. +func (p *ListModelCopyJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListModelCopyJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListModelCopyJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListModelCopyJobsAPIClient is a client that implements the ListModelCopyJobs +// operation. +type ListModelCopyJobsAPIClient interface { + ListModelCopyJobs(context.Context, *ListModelCopyJobsInput, ...func(*Options)) (*ListModelCopyJobsOutput, error) +} + +var _ ListModelCopyJobsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListModelCopyJobs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListModelCopyJobs", + } +} diff --git a/service/bedrock/api_op_ListModelCustomizationJobs.go b/service/bedrock/api_op_ListModelCustomizationJobs.go index bfe8d4f3894..e0f7e546f1b 100644 --- a/service/bedrock/api_op_ListModelCustomizationJobs.go +++ b/service/bedrock/api_op_ListModelCustomizationJobs.go @@ -15,9 +15,10 @@ import ( // Returns a list of model customization jobs that you have submitted. You can // filter the jobs to return based on one or more criteria. // -// For more information, see [Custom models] in the Amazon Bedrock User Guide. +// For more information, see [Custom models] in the [Amazon Bedrock User Guide]. // // [Custom models]: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) ListModelCustomizationJobs(ctx context.Context, params *ListModelCustomizationJobsInput, optFns ...func(*Options)) (*ListModelCustomizationJobsOutput, error) { if params == nil { params = &ListModelCustomizationJobsInput{} @@ -41,14 +42,18 @@ type ListModelCustomizationJobsInput struct { // Return customization jobs created before the specified time. CreationTimeBefore *time.Time - // Maximum number of results to return in the response. + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. MaxResults *int32 // Return customization jobs only if the job name contains these characters. NameContains *string - // Continuation token from the previous response, for Amazon Bedrock to list the - // next set of results. + // If the total number of results is greater than the maxResults value provided in + // the request, enter the token returned in the nextToken field in the response in + // this field to return the next batch of results. NextToken *string // The field to sort by in the returned list of jobs. @@ -68,7 +73,9 @@ type ListModelCustomizationJobsOutput struct { // Job summaries. ModelCustomizationJobSummaries []types.ModelCustomizationJobSummary - // Page continuation token to use in the next request. + // If the total number of results is greater than the maxResults value provided in + // the request, use this token when making another request in the nextToken field + // to return the next batch of results. NextToken *string // Metadata pertaining to the operation's result. @@ -162,7 +169,10 @@ func (c *Client) addOperationListModelCustomizationJobsMiddlewares(stack *middle // ListModelCustomizationJobsPaginatorOptions is the paginator options for // ListModelCustomizationJobs type ListModelCustomizationJobsPaginatorOptions struct { - // Maximum number of results to return in the response. + // The maximum number of results to return in the response. If the total number of + // results is greater than this value, use the token returned in the response in + // the nextToken field when making another request to return the next batch of + // results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/bedrock/api_op_ListProvisionedModelThroughputs.go b/service/bedrock/api_op_ListProvisionedModelThroughputs.go index 4d071c773be..4a9fbc0ad60 100644 --- a/service/bedrock/api_op_ListProvisionedModelThroughputs.go +++ b/service/bedrock/api_op_ListProvisionedModelThroughputs.go @@ -13,9 +13,10 @@ import ( ) // Lists the Provisioned Throughputs in the account. For more information, see [Provisioned Throughput] in -// the Amazon Bedrock User Guide. +// the [Amazon Bedrock User Guide]. // // [Provisioned Throughput]: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) ListProvisionedModelThroughputs(ctx context.Context, params *ListProvisionedModelThroughputsInput, optFns ...func(*Options)) (*ListProvisionedModelThroughputsOutput, error) { if params == nil { params = &ListProvisionedModelThroughputsInput{} diff --git a/service/bedrock/api_op_ListTagsForResource.go b/service/bedrock/api_op_ListTagsForResource.go index c9438baafa1..1a430e72de2 100644 --- a/service/bedrock/api_op_ListTagsForResource.go +++ b/service/bedrock/api_op_ListTagsForResource.go @@ -13,8 +13,9 @@ import ( // List the tags associated with the specified resource. // -// For more information, see [Tagging resources] in the Amazon Bedrock User Guide. +// For more information, see [Tagging resources] in the [Amazon Bedrock User Guide]. // +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html // [Tagging resources]: https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { diff --git a/service/bedrock/api_op_StopModelCustomizationJob.go b/service/bedrock/api_op_StopModelCustomizationJob.go index abd139013ac..8914b3831fa 100644 --- a/service/bedrock/api_op_StopModelCustomizationJob.go +++ b/service/bedrock/api_op_StopModelCustomizationJob.go @@ -10,10 +10,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Stops an active model customization job. For more information, see [Custom models] in the -// Amazon Bedrock User Guide. +// Stops an active model customization job. For more information, see [Custom models] in the [Amazon Bedrock User Guide]. // // [Custom models]: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) StopModelCustomizationJob(ctx context.Context, params *StopModelCustomizationJobInput, optFns ...func(*Options)) (*StopModelCustomizationJobOutput, error) { if params == nil { params = &StopModelCustomizationJobInput{} diff --git a/service/bedrock/api_op_TagResource.go b/service/bedrock/api_op_TagResource.go index 0b8de9c9a0e..2a79ef2144c 100644 --- a/service/bedrock/api_op_TagResource.go +++ b/service/bedrock/api_op_TagResource.go @@ -11,9 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Associate tags with a resource. For more information, see [Tagging resources] in the Amazon -// Bedrock User Guide. +// Associate tags with a resource. For more information, see [Tagging resources] in the [Amazon Bedrock User Guide]. // +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html // [Tagging resources]: https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { diff --git a/service/bedrock/api_op_UntagResource.go b/service/bedrock/api_op_UntagResource.go index e420d5e9232..2c00729dae0 100644 --- a/service/bedrock/api_op_UntagResource.go +++ b/service/bedrock/api_op_UntagResource.go @@ -10,9 +10,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Remove one or more tags from a resource. For more information, see [Tagging resources] in the -// Amazon Bedrock User Guide. +// Remove one or more tags from a resource. For more information, see [Tagging resources] in the [Amazon Bedrock User Guide]. // +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html // [Tagging resources]: https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { diff --git a/service/bedrock/api_op_UpdateProvisionedModelThroughput.go b/service/bedrock/api_op_UpdateProvisionedModelThroughput.go index 1f9557f41f9..f24efbf0d56 100644 --- a/service/bedrock/api_op_UpdateProvisionedModelThroughput.go +++ b/service/bedrock/api_op_UpdateProvisionedModelThroughput.go @@ -11,9 +11,10 @@ import ( ) // Updates the name or associated model for a Provisioned Throughput. For more -// information, see [Provisioned Throughput]in the Amazon Bedrock User Guide. +// information, see [Provisioned Throughput]in the [Amazon Bedrock User Guide]. // // [Provisioned Throughput]: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html +// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html func (c *Client) UpdateProvisionedModelThroughput(ctx context.Context, params *UpdateProvisionedModelThroughputInput, optFns ...func(*Options)) (*UpdateProvisionedModelThroughputOutput, error) { if params == nil { params = &UpdateProvisionedModelThroughputInput{} diff --git a/service/bedrock/deserializers.go b/service/bedrock/deserializers.go index 279bbe3ffd5..a7c286491b8 100644 --- a/service/bedrock/deserializers.go +++ b/service/bedrock/deserializers.go @@ -579,6 +579,166 @@ func awsRestjson1_deserializeOpDocumentCreateGuardrailVersionOutput(v **CreateGu return nil } +type awsRestjson1_deserializeOpCreateModelCopyJob struct { +} + +func (*awsRestjson1_deserializeOpCreateModelCopyJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateModelCopyJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateModelCopyJob(response, &metadata) + } + output := &CreateModelCopyJobOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCreateModelCopyJobOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateModelCopyJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateModelCopyJobOutput(v **CreateModelCopyJobOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateModelCopyJobOutput + if *v == nil { + sv = &CreateModelCopyJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "jobArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelCopyJobArn to be of type string, got %T instead", value) + } + sv.JobArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateModelCustomizationJob struct { } @@ -2281,14 +2441,14 @@ func awsRestjson1_deserializeOpDocumentGetGuardrailOutput(v **GetGuardrailOutput return nil } -type awsRestjson1_deserializeOpGetModelCustomizationJob struct { +type awsRestjson1_deserializeOpGetModelCopyJob struct { } -func (*awsRestjson1_deserializeOpGetModelCustomizationJob) ID() string { +func (*awsRestjson1_deserializeOpGetModelCopyJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetModelCustomizationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetModelCopyJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2302,9 +2462,9 @@ func (m *awsRestjson1_deserializeOpGetModelCustomizationJob) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetModelCustomizationJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetModelCopyJob(response, &metadata) } - output := &GetModelCustomizationJobOutput{} + output := &GetModelCopyJobOutput{} out.Result = output var buff [1024]byte @@ -2325,7 +2485,7 @@ func (m *awsRestjson1_deserializeOpGetModelCustomizationJob) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetModelCustomizationJobOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetModelCopyJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2338,7 +2498,7 @@ func (m *awsRestjson1_deserializeOpGetModelCustomizationJob) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetModelCustomizationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetModelCopyJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2404,7 +2564,7 @@ func awsRestjson1_deserializeOpErrorGetModelCustomizationJob(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentGetModelCustomizationJobOutput(v **GetModelCustomizationJobOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetModelCopyJobOutput(v **GetModelCopyJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2417,33 +2577,15 @@ func awsRestjson1_deserializeOpDocumentGetModelCustomizationJobOutput(v **GetMod return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetModelCustomizationJobOutput + var sv *GetModelCopyJobOutput if *v == nil { - sv = &GetModelCustomizationJobOutput{} + sv = &GetModelCopyJobOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "baseModelArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FoundationModelArn to be of type string, got %T instead", value) - } - sv.BaseModelArn = ptr.String(jtv) - } - - case "clientRequestToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected IdempotencyToken to be of type string, got %T instead", value) - } - sv.ClientRequestToken = ptr.String(jtv) - } - case "creationTime": if value != nil { jtv, ok := value.(string) @@ -2457,28 +2599,6 @@ func awsRestjson1_deserializeOpDocumentGetModelCustomizationJobOutput(v **GetMod sv.CreationTime = ptr.Time(t) } - case "customizationType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CustomizationType to be of type string, got %T instead", value) - } - sv.CustomizationType = types.CustomizationType(jtv) - } - - case "endTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.EndTime = ptr.Time(t) - } - case "failureMessage": if value != nil { jtv, ok := value.(string) @@ -2488,109 +2608,402 @@ func awsRestjson1_deserializeOpDocumentGetModelCustomizationJobOutput(v **GetMod sv.FailureMessage = ptr.String(jtv) } - case "hyperParameters": - if err := awsRestjson1_deserializeDocumentModelCustomizationHyperParameters(&sv.HyperParameters, value); err != nil { - return err - } - case "jobArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ModelCustomizationJobArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ModelCopyJobArn to be of type string, got %T instead", value) } sv.JobArn = ptr.String(jtv) } - case "jobName": + case "sourceAccountId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected JobName to be of type string, got %T instead", value) + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } - sv.JobName = ptr.String(jtv) + sv.SourceAccountId = ptr.String(jtv) } - case "lastModifiedTime": + case "sourceModelArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err + return fmt.Errorf("expected ModelArn to be of type string, got %T instead", value) } - sv.LastModifiedTime = ptr.Time(t) + sv.SourceModelArn = ptr.String(jtv) } - case "outputDataConfig": - if err := awsRestjson1_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { - return err - } - - case "outputModelArn": + case "sourceModelName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CustomModelArn to be of type string, got %T instead", value) + return fmt.Errorf("expected CustomModelName to be of type string, got %T instead", value) } - sv.OutputModelArn = ptr.String(jtv) + sv.SourceModelName = ptr.String(jtv) } - case "outputModelKmsKeyArn": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ModelCopyJobStatus to be of type string, got %T instead", value) } - sv.OutputModelKmsKeyArn = ptr.String(jtv) + sv.Status = types.ModelCopyJobStatus(jtv) } - case "outputModelName": + case "targetModelArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CustomModelName to be of type string, got %T instead", value) + return fmt.Errorf("expected CustomModelArn to be of type string, got %T instead", value) } - sv.OutputModelName = ptr.String(jtv) + sv.TargetModelArn = ptr.String(jtv) } - case "roleArn": + case "targetModelKmsKeyArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) } - sv.RoleArn = ptr.String(jtv) + sv.TargetModelKmsKeyArn = ptr.String(jtv) } - case "status": + case "targetModelName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ModelCustomizationJobStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected CustomModelName to be of type string, got %T instead", value) } - sv.Status = types.ModelCustomizationJobStatus(jtv) - } - - case "trainingDataConfig": - if err := awsRestjson1_deserializeDocumentTrainingDataConfig(&sv.TrainingDataConfig, value); err != nil { - return err + sv.TargetModelName = ptr.String(jtv) } - case "trainingMetrics": - if err := awsRestjson1_deserializeDocumentTrainingMetrics(&sv.TrainingMetrics, value); err != nil { + case "targetModelTags": + if err := awsRestjson1_deserializeDocumentTagList(&sv.TargetModelTags, value); err != nil { return err } - case "validationDataConfig": - if err := awsRestjson1_deserializeDocumentValidationDataConfig(&sv.ValidationDataConfig, value); err != nil { - return err - } + default: + _, _ = key, value - case "validationMetrics": - if err := awsRestjson1_deserializeDocumentValidationMetrics(&sv.ValidationMetrics, value); err != nil { + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetModelCustomizationJob struct { +} + +func (*awsRestjson1_deserializeOpGetModelCustomizationJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetModelCustomizationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetModelCustomizationJob(response, &metadata) + } + output := &GetModelCustomizationJobOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetModelCustomizationJobOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetModelCustomizationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetModelCustomizationJobOutput(v **GetModelCustomizationJobOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetModelCustomizationJobOutput + if *v == nil { + sv = &GetModelCustomizationJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "baseModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FoundationModelArn to be of type string, got %T instead", value) + } + sv.BaseModelArn = ptr.String(jtv) + } + + case "clientRequestToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdempotencyToken to be of type string, got %T instead", value) + } + sv.ClientRequestToken = ptr.String(jtv) + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "customizationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomizationType to be of type string, got %T instead", value) + } + sv.CustomizationType = types.CustomizationType(jtv) + } + + case "endTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.EndTime = ptr.Time(t) + } + + case "failureMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.FailureMessage = ptr.String(jtv) + } + + case "hyperParameters": + if err := awsRestjson1_deserializeDocumentModelCustomizationHyperParameters(&sv.HyperParameters, value); err != nil { + return err + } + + case "jobArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelCustomizationJobArn to be of type string, got %T instead", value) + } + sv.JobArn = ptr.String(jtv) + } + + case "jobName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobName to be of type string, got %T instead", value) + } + sv.JobName = ptr.String(jtv) + } + + case "lastModifiedTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(t) + } + + case "outputDataConfig": + if err := awsRestjson1_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { + return err + } + + case "outputModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomModelArn to be of type string, got %T instead", value) + } + sv.OutputModelArn = ptr.String(jtv) + } + + case "outputModelKmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.OutputModelKmsKeyArn = ptr.String(jtv) + } + + case "outputModelName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomModelName to be of type string, got %T instead", value) + } + sv.OutputModelName = ptr.String(jtv) + } + + case "roleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelCustomizationJobStatus to be of type string, got %T instead", value) + } + sv.Status = types.ModelCustomizationJobStatus(jtv) + } + + case "trainingDataConfig": + if err := awsRestjson1_deserializeDocumentTrainingDataConfig(&sv.TrainingDataConfig, value); err != nil { + return err + } + + case "trainingMetrics": + if err := awsRestjson1_deserializeDocumentTrainingMetrics(&sv.TrainingMetrics, value); err != nil { + return err + } + + case "validationDataConfig": + if err := awsRestjson1_deserializeDocumentValidationDataConfig(&sv.ValidationDataConfig, value); err != nil { + return err + } + + case "validationMetrics": + if err := awsRestjson1_deserializeDocumentValidationMetrics(&sv.ValidationMetrics, value); err != nil { return err } @@ -3034,13 +3447,178 @@ func awsRestjson1_deserializeOpDocumentGetProvisionedModelThroughputOutput(v **G sv.ProvisionedModelName = ptr.String(jtv) } - case "status": + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProvisionedModelStatus to be of type string, got %T instead", value) + } + sv.Status = types.ProvisionedModelStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListCustomModels struct { +} + +func (*awsRestjson1_deserializeOpListCustomModels) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListCustomModels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListCustomModels(response, &metadata) + } + output := &ListCustomModelsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListCustomModelsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListCustomModels(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListCustomModelsOutput(v **ListCustomModelsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListCustomModelsOutput + if *v == nil { + sv = &ListCustomModelsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "modelSummaries": + if err := awsRestjson1_deserializeDocumentCustomModelSummaryList(&sv.ModelSummaries, value); err != nil { + return err + } + + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ProvisionedModelStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } - sv.Status = types.ProvisionedModelStatus(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -3052,14 +3630,14 @@ func awsRestjson1_deserializeOpDocumentGetProvisionedModelThroughputOutput(v **G return nil } -type awsRestjson1_deserializeOpListCustomModels struct { +type awsRestjson1_deserializeOpListEvaluationJobs struct { } -func (*awsRestjson1_deserializeOpListCustomModels) ID() string { +func (*awsRestjson1_deserializeOpListEvaluationJobs) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCustomModels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListEvaluationJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3073,9 +3651,9 @@ func (m *awsRestjson1_deserializeOpListCustomModels) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCustomModels(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListEvaluationJobs(response, &metadata) } - output := &ListCustomModelsOutput{} + output := &ListEvaluationJobsOutput{} out.Result = output var buff [1024]byte @@ -3096,7 +3674,7 @@ func (m *awsRestjson1_deserializeOpListCustomModels) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCustomModelsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListEvaluationJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3109,7 +3687,7 @@ func (m *awsRestjson1_deserializeOpListCustomModels) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCustomModels(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListEvaluationJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3172,7 +3750,7 @@ func awsRestjson1_deserializeOpErrorListCustomModels(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListCustomModelsOutput(v **ListCustomModelsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListEvaluationJobsOutput(v **ListEvaluationJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3185,17 +3763,17 @@ func awsRestjson1_deserializeOpDocumentListCustomModelsOutput(v **ListCustomMode return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCustomModelsOutput + var sv *ListEvaluationJobsOutput if *v == nil { - sv = &ListCustomModelsOutput{} + sv = &ListEvaluationJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "modelSummaries": - if err := awsRestjson1_deserializeDocumentCustomModelSummaryList(&sv.ModelSummaries, value); err != nil { + case "jobSummaries": + if err := awsRestjson1_deserializeDocumentEvaluationSummaries(&sv.JobSummaries, value); err != nil { return err } @@ -3217,14 +3795,14 @@ func awsRestjson1_deserializeOpDocumentListCustomModelsOutput(v **ListCustomMode return nil } -type awsRestjson1_deserializeOpListEvaluationJobs struct { +type awsRestjson1_deserializeOpListFoundationModels struct { } -func (*awsRestjson1_deserializeOpListEvaluationJobs) ID() string { +func (*awsRestjson1_deserializeOpListFoundationModels) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListEvaluationJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListFoundationModels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3238,9 +3816,9 @@ func (m *awsRestjson1_deserializeOpListEvaluationJobs) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListEvaluationJobs(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListFoundationModels(response, &metadata) } - output := &ListEvaluationJobsOutput{} + output := &ListFoundationModelsOutput{} out.Result = output var buff [1024]byte @@ -3261,7 +3839,7 @@ func (m *awsRestjson1_deserializeOpListEvaluationJobs) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListEvaluationJobsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListFoundationModelsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3274,7 +3852,7 @@ func (m *awsRestjson1_deserializeOpListEvaluationJobs) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListEvaluationJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListFoundationModels(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3337,7 +3915,7 @@ func awsRestjson1_deserializeOpErrorListEvaluationJobs(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListEvaluationJobsOutput(v **ListEvaluationJobsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListFoundationModelsOutput(v **ListFoundationModelsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3350,29 +3928,20 @@ func awsRestjson1_deserializeOpDocumentListEvaluationJobsOutput(v **ListEvaluati return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListEvaluationJobsOutput + var sv *ListFoundationModelsOutput if *v == nil { - sv = &ListEvaluationJobsOutput{} + sv = &ListFoundationModelsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "jobSummaries": - if err := awsRestjson1_deserializeDocumentEvaluationSummaries(&sv.JobSummaries, value); err != nil { + case "modelSummaries": + if err := awsRestjson1_deserializeDocumentFoundationModelSummaryList(&sv.ModelSummaries, value); err != nil { return err } - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -3382,14 +3951,14 @@ func awsRestjson1_deserializeOpDocumentListEvaluationJobsOutput(v **ListEvaluati return nil } -type awsRestjson1_deserializeOpListFoundationModels struct { +type awsRestjson1_deserializeOpListGuardrails struct { } -func (*awsRestjson1_deserializeOpListFoundationModels) ID() string { +func (*awsRestjson1_deserializeOpListGuardrails) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListFoundationModels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListGuardrails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3403,9 +3972,9 @@ func (m *awsRestjson1_deserializeOpListFoundationModels) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListFoundationModels(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListGuardrails(response, &metadata) } - output := &ListFoundationModelsOutput{} + output := &ListGuardrailsOutput{} out.Result = output var buff [1024]byte @@ -3426,7 +3995,7 @@ func (m *awsRestjson1_deserializeOpListFoundationModels) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListFoundationModelsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListGuardrailsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3439,7 +4008,7 @@ func (m *awsRestjson1_deserializeOpListFoundationModels) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListFoundationModels(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListGuardrails(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3486,6 +4055,9 @@ func awsRestjson1_deserializeOpErrorListFoundationModels(response *smithyhttp.Re case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -3502,7 +4074,7 @@ func awsRestjson1_deserializeOpErrorListFoundationModels(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListFoundationModelsOutput(v **ListFoundationModelsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListGuardrailsOutput(v **ListGuardrailsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3515,20 +4087,29 @@ func awsRestjson1_deserializeOpDocumentListFoundationModelsOutput(v **ListFounda return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListFoundationModelsOutput + var sv *ListGuardrailsOutput if *v == nil { - sv = &ListFoundationModelsOutput{} + sv = &ListGuardrailsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "modelSummaries": - if err := awsRestjson1_deserializeDocumentFoundationModelSummaryList(&sv.ModelSummaries, value); err != nil { + case "guardrails": + if err := awsRestjson1_deserializeDocumentGuardrailSummaries(&sv.Guardrails, value); err != nil { return err } + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -3538,14 +4119,14 @@ func awsRestjson1_deserializeOpDocumentListFoundationModelsOutput(v **ListFounda return nil } -type awsRestjson1_deserializeOpListGuardrails struct { +type awsRestjson1_deserializeOpListModelCopyJobs struct { } -func (*awsRestjson1_deserializeOpListGuardrails) ID() string { +func (*awsRestjson1_deserializeOpListModelCopyJobs) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListGuardrails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListModelCopyJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3559,9 +4140,9 @@ func (m *awsRestjson1_deserializeOpListGuardrails) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListGuardrails(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListModelCopyJobs(response, &metadata) } - output := &ListGuardrailsOutput{} + output := &ListModelCopyJobsOutput{} out.Result = output var buff [1024]byte @@ -3582,7 +4163,7 @@ func (m *awsRestjson1_deserializeOpListGuardrails) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListGuardrailsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListModelCopyJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3595,7 +4176,7 @@ func (m *awsRestjson1_deserializeOpListGuardrails) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListGuardrails(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListModelCopyJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3661,7 +4242,7 @@ func awsRestjson1_deserializeOpErrorListGuardrails(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListGuardrailsOutput(v **ListGuardrailsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListModelCopyJobsOutput(v **ListModelCopyJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3674,17 +4255,17 @@ func awsRestjson1_deserializeOpDocumentListGuardrailsOutput(v **ListGuardrailsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListGuardrailsOutput + var sv *ListModelCopyJobsOutput if *v == nil { - sv = &ListGuardrailsOutput{} + sv = &ListModelCopyJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "guardrails": - if err := awsRestjson1_deserializeDocumentGuardrailSummaries(&sv.Guardrails, value); err != nil { + case "modelCopyJobSummaries": + if err := awsRestjson1_deserializeDocumentModelCopyJobSummaries(&sv.ModelCopyJobSummaries, value); err != nil { return err } @@ -5509,6 +6090,15 @@ func awsRestjson1_deserializeDocumentCustomModelSummary(v **types.CustomModelSum sv.ModelName = ptr.String(jtv) } + case "ownerAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.OwnerAccountId = ptr.String(jtv) + } + default: _, _ = key, value @@ -7919,6 +8509,170 @@ func awsRestjson1_deserializeDocumentLoggingConfig(v **types.LoggingConfig, valu return nil } +func awsRestjson1_deserializeDocumentModelCopyJobSummaries(v *[]types.ModelCopyJobSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ModelCopyJobSummary + if *v == nil { + cv = []types.ModelCopyJobSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ModelCopyJobSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentModelCopyJobSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentModelCopyJobSummary(v **types.ModelCopyJobSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ModelCopyJobSummary + if *v == nil { + sv = &types.ModelCopyJobSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "failureMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.FailureMessage = ptr.String(jtv) + } + + case "jobArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelCopyJobArn to be of type string, got %T instead", value) + } + sv.JobArn = ptr.String(jtv) + } + + case "sourceAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.SourceAccountId = ptr.String(jtv) + } + + case "sourceModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelArn to be of type string, got %T instead", value) + } + sv.SourceModelArn = ptr.String(jtv) + } + + case "sourceModelName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomModelName to be of type string, got %T instead", value) + } + sv.SourceModelName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelCopyJobStatus to be of type string, got %T instead", value) + } + sv.Status = types.ModelCopyJobStatus(jtv) + } + + case "targetModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomModelArn to be of type string, got %T instead", value) + } + sv.TargetModelArn = ptr.String(jtv) + } + + case "targetModelKmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.TargetModelKmsKeyArn = ptr.String(jtv) + } + + case "targetModelName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomModelName to be of type string, got %T instead", value) + } + sv.TargetModelName = ptr.String(jtv) + } + + case "targetModelTags": + if err := awsRestjson1_deserializeDocumentTagList(&sv.TargetModelTags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentModelCustomizationHyperParameters(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/bedrock/generated.json b/service/bedrock/generated.json index 284f81d0b08..291385387c7 100644 --- a/service/bedrock/generated.json +++ b/service/bedrock/generated.json @@ -11,6 +11,7 @@ "api_op_CreateEvaluationJob.go", "api_op_CreateGuardrail.go", "api_op_CreateGuardrailVersion.go", + "api_op_CreateModelCopyJob.go", "api_op_CreateModelCustomizationJob.go", "api_op_CreateProvisionedModelThroughput.go", "api_op_DeleteCustomModel.go", @@ -21,6 +22,7 @@ "api_op_GetEvaluationJob.go", "api_op_GetFoundationModel.go", "api_op_GetGuardrail.go", + "api_op_GetModelCopyJob.go", "api_op_GetModelCustomizationJob.go", "api_op_GetModelInvocationLoggingConfiguration.go", "api_op_GetProvisionedModelThroughput.go", @@ -28,6 +30,7 @@ "api_op_ListEvaluationJobs.go", "api_op_ListFoundationModels.go", "api_op_ListGuardrails.go", + "api_op_ListModelCopyJobs.go", "api_op_ListModelCustomizationJobs.go", "api_op_ListProvisionedModelThroughputs.go", "api_op_ListTagsForResource.go", diff --git a/service/bedrock/serializers.go b/service/bedrock/serializers.go index 01fc932e49b..36c0958c2e7 100644 --- a/service/bedrock/serializers.go +++ b/service/bedrock/serializers.go @@ -374,6 +374,103 @@ func awsRestjson1_serializeOpDocumentCreateGuardrailVersionInput(v *CreateGuardr return nil } +type awsRestjson1_serializeOpCreateModelCopyJob struct { +} + +func (*awsRestjson1_serializeOpCreateModelCopyJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateModelCopyJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateModelCopyJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/model-copy-jobs") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateModelCopyJobInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateModelCopyJobInput(v *CreateModelCopyJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateModelCopyJobInput(v *CreateModelCopyJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("clientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.ModelKmsKeyId != nil { + ok := object.Key("modelKmsKeyId") + ok.String(*v.ModelKmsKeyId) + } + + if v.SourceModelArn != nil { + ok := object.Key("sourceModelArn") + ok.String(*v.SourceModelArn) + } + + if v.TargetModelName != nil { + ok := object.Key("targetModelName") + ok.String(*v.TargetModelName) + } + + if v.TargetModelTags != nil { + ok := object.Key("targetModelTags") + if err := awsRestjson1_serializeDocumentTagList(v.TargetModelTags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateModelCustomizationJob struct { } @@ -1145,6 +1242,71 @@ func awsRestjson1_serializeOpHttpBindingsGetGuardrailInput(v *GetGuardrailInput, return nil } +type awsRestjson1_serializeOpGetModelCopyJob struct { +} + +func (*awsRestjson1_serializeOpGetModelCopyJob) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetModelCopyJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetModelCopyJobInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/model-copy-jobs/{jobArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetModelCopyJobInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetModelCopyJobInput(v *GetModelCopyJobInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.JobArn == nil || len(*v.JobArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member jobArn must not be empty")} + } + if v.JobArn != nil { + if err := encoder.SetURI("jobArn").String(*v.JobArn); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetModelCustomizationJob struct { } @@ -1396,6 +1558,10 @@ func awsRestjson1_serializeOpHttpBindingsListCustomModelsInput(v *ListCustomMode encoder.SetQuery("foundationModelArnEquals").String(*v.FoundationModelArnEquals) } + if v.IsOwned != nil { + encoder.SetQuery("isOwned").Boolean(*v.IsOwned) + } + if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } @@ -1647,6 +1813,102 @@ func awsRestjson1_serializeOpHttpBindingsListGuardrailsInput(v *ListGuardrailsIn return nil } +type awsRestjson1_serializeOpListModelCopyJobs struct { +} + +func (*awsRestjson1_serializeOpListModelCopyJobs) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListModelCopyJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListModelCopyJobsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/model-copy-jobs") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListModelCopyJobsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListModelCopyJobsInput(v *ListModelCopyJobsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CreationTimeAfter != nil { + encoder.SetQuery("creationTimeAfter").String(smithytime.FormatDateTime(*v.CreationTimeAfter)) + } + + if v.CreationTimeBefore != nil { + encoder.SetQuery("creationTimeBefore").String(smithytime.FormatDateTime(*v.CreationTimeBefore)) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.SortBy) > 0 { + encoder.SetQuery("sortBy").String(string(v.SortBy)) + } + + if len(v.SortOrder) > 0 { + encoder.SetQuery("sortOrder").String(string(v.SortOrder)) + } + + if v.SourceAccountEquals != nil { + encoder.SetQuery("sourceAccountEquals").String(*v.SourceAccountEquals) + } + + if v.SourceModelArnEquals != nil { + encoder.SetQuery("sourceModelArnEquals").String(*v.SourceModelArnEquals) + } + + if len(v.StatusEquals) > 0 { + encoder.SetQuery("statusEquals").String(string(v.StatusEquals)) + } + + if v.TargetModelNameContains != nil { + encoder.SetQuery("outputModelNameContains").String(*v.TargetModelNameContains) + } + + return nil +} + type awsRestjson1_serializeOpListModelCustomizationJobs struct { } diff --git a/service/bedrock/snapshot/api_op_CreateModelCopyJob.go.snap b/service/bedrock/snapshot/api_op_CreateModelCopyJob.go.snap new file mode 100644 index 00000000000..1872e9c45b0 --- /dev/null +++ b/service/bedrock/snapshot/api_op_CreateModelCopyJob.go.snap @@ -0,0 +1,37 @@ +CreateModelCopyJob + Initialize stack step + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrock/snapshot/api_op_GetModelCopyJob.go.snap b/service/bedrock/snapshot/api_op_GetModelCopyJob.go.snap new file mode 100644 index 00000000000..5c165feeaf0 --- /dev/null +++ b/service/bedrock/snapshot/api_op_GetModelCopyJob.go.snap @@ -0,0 +1,36 @@ +GetModelCopyJob + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrock/snapshot/api_op_ListModelCopyJobs.go.snap b/service/bedrock/snapshot/api_op_ListModelCopyJobs.go.snap new file mode 100644 index 00000000000..6526fe9bc6f --- /dev/null +++ b/service/bedrock/snapshot/api_op_ListModelCopyJobs.go.snap @@ -0,0 +1,35 @@ +ListModelCopyJobs + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/bedrock/snapshot_test.go b/service/bedrock/snapshot_test.go index 424c9b704e8..e15b0bee07c 100644 --- a/service/bedrock/snapshot_test.go +++ b/service/bedrock/snapshot_test.go @@ -98,6 +98,18 @@ func TestCheckSnapshot_CreateGuardrailVersion(t *testing.T) { } } +func TestCheckSnapshot_CreateModelCopyJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateModelCopyJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateModelCopyJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateModelCustomizationJob(t *testing.T) { svc := New(Options{}) _, err := svc.CreateModelCustomizationJob(context.Background(), nil, func(o *Options) { @@ -218,6 +230,18 @@ func TestCheckSnapshot_GetGuardrail(t *testing.T) { } } +func TestCheckSnapshot_GetModelCopyJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetModelCopyJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetModelCopyJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetModelCustomizationJob(t *testing.T) { svc := New(Options{}) _, err := svc.GetModelCustomizationJob(context.Background(), nil, func(o *Options) { @@ -302,6 +326,18 @@ func TestCheckSnapshot_ListGuardrails(t *testing.T) { } } +func TestCheckSnapshot_ListModelCopyJobs(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListModelCopyJobs(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListModelCopyJobs") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListModelCustomizationJobs(t *testing.T) { svc := New(Options{}) _, err := svc.ListModelCustomizationJobs(context.Background(), nil, func(o *Options) { @@ -457,6 +493,18 @@ func TestUpdateSnapshot_CreateGuardrailVersion(t *testing.T) { } } +func TestUpdateSnapshot_CreateModelCopyJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateModelCopyJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateModelCopyJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateModelCustomizationJob(t *testing.T) { svc := New(Options{}) _, err := svc.CreateModelCustomizationJob(context.Background(), nil, func(o *Options) { @@ -577,6 +625,18 @@ func TestUpdateSnapshot_GetGuardrail(t *testing.T) { } } +func TestUpdateSnapshot_GetModelCopyJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetModelCopyJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetModelCopyJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetModelCustomizationJob(t *testing.T) { svc := New(Options{}) _, err := svc.GetModelCustomizationJob(context.Background(), nil, func(o *Options) { @@ -661,6 +721,18 @@ func TestUpdateSnapshot_ListGuardrails(t *testing.T) { } } +func TestUpdateSnapshot_ListModelCopyJobs(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListModelCopyJobs(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListModelCopyJobs") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListModelCustomizationJobs(t *testing.T) { svc := New(Options{}) _, err := svc.ListModelCustomizationJobs(context.Background(), nil, func(o *Options) { diff --git a/service/bedrock/types/enums.go b/service/bedrock/types/enums.go index bb7e517c5f5..74dd395f36f 100644 --- a/service/bedrock/types/enums.go +++ b/service/bedrock/types/enums.go @@ -401,6 +401,27 @@ func (InferenceType) Values() []InferenceType { } } +type ModelCopyJobStatus string + +// Enum values for ModelCopyJobStatus +const ( + ModelCopyJobStatusInProgress ModelCopyJobStatus = "InProgress" + ModelCopyJobStatusCompleted ModelCopyJobStatus = "Completed" + ModelCopyJobStatusFailed ModelCopyJobStatus = "Failed" +) + +// Values returns all known values for ModelCopyJobStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ModelCopyJobStatus) Values() []ModelCopyJobStatus { + return []ModelCopyJobStatus{ + "InProgress", + "Completed", + "Failed", + } +} + type ModelCustomization string // Enum values for ModelCustomization diff --git a/service/bedrock/types/types.go b/service/bedrock/types/types.go index 52cd0fc0d2e..a8939bd6ceb 100644 --- a/service/bedrock/types/types.go +++ b/service/bedrock/types/types.go @@ -73,6 +73,9 @@ type CustomModelSummary struct { // [Custom models]: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html CustomizationType CustomizationType + // The unique identifier of the account that owns the model. + OwnerAccountId *string + noSmithyDocumentSerde } @@ -615,7 +618,7 @@ type GuardrailPiiEntity struct { // This member is required. Action GuardrailSensitiveInformationAction - // The type of PII entity. For example, Social Security Number. + // The type of PII entity. For exampvle, Social Security Number. // // This member is required. Type GuardrailPiiEntityType @@ -1184,6 +1187,65 @@ type LoggingConfig struct { noSmithyDocumentSerde } +// Contains details about each model copy job. +// +// This data type is used in the following API operations: +// +// [ListModelCopyJobs response] +// +// [ListModelCopyJobs response]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListModelCopyJobs.html#API_ListModelCopyJobs_ResponseSyntax +type ModelCopyJobSummary struct { + + // The time that the model copy job was created. + // + // This member is required. + CreationTime *time.Time + + // The Amazon Resoource Name (ARN) of the model copy job. + // + // This member is required. + JobArn *string + + // The unique identifier of the account that the model being copied originated + // from. + // + // This member is required. + SourceAccountId *string + + // The Amazon Resource Name (ARN) of the original model being copied. + // + // This member is required. + SourceModelArn *string + + // The status of the model copy job. + // + // This member is required. + Status ModelCopyJobStatus + + // The Amazon Resource Name (ARN) of the copied model. + // + // This member is required. + TargetModelArn *string + + // If a model fails to be copied, a message describing why the job failed is + // included here. + FailureMessage *string + + // The name of the original model being copied. + SourceModelName *string + + // The Amazon Resource Name (ARN) of the KMS key used to encrypt the copied model. + TargetModelKmsKeyArn *string + + // The name of the copied model. + TargetModelName *string + + // Tags associated with the copied model. + TargetModelTags []Tag + + noSmithyDocumentSerde +} + // Information about one customization job type ModelCustomizationJobSummary struct { diff --git a/service/bedrock/validators.go b/service/bedrock/validators.go index 522ab18e947..efe5976413b 100644 --- a/service/bedrock/validators.go +++ b/service/bedrock/validators.go @@ -70,6 +70,26 @@ func (m *validateOpCreateGuardrailVersion) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpCreateModelCopyJob struct { +} + +func (*validateOpCreateModelCopyJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateModelCopyJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateModelCopyJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateModelCopyJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateModelCustomizationJob struct { } @@ -250,6 +270,26 @@ func (m *validateOpGetGuardrail) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpGetModelCopyJob struct { +} + +func (*validateOpGetModelCopyJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetModelCopyJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetModelCopyJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetModelCopyJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetModelCustomizationJob struct { } @@ -462,6 +502,10 @@ func addOpCreateGuardrailVersionValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpCreateGuardrailVersion{}, middleware.After) } +func addOpCreateModelCopyJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateModelCopyJob{}, middleware.After) +} + func addOpCreateModelCustomizationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateModelCustomizationJob{}, middleware.After) } @@ -498,6 +542,10 @@ func addOpGetGuardrailValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetGuardrail{}, middleware.After) } +func addOpGetModelCopyJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetModelCopyJob{}, middleware.After) +} + func addOpGetModelCustomizationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetModelCustomizationJob{}, middleware.After) } @@ -1458,6 +1506,29 @@ func validateOpCreateGuardrailVersionInput(v *CreateGuardrailVersionInput) error } } +func validateOpCreateModelCopyJobInput(v *CreateModelCopyJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateModelCopyJobInput"} + if v.SourceModelArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceModelArn")) + } + if v.TargetModelName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetModelName")) + } + if v.TargetModelTags != nil { + if err := validateTagList(v.TargetModelTags); err != nil { + invalidParams.AddNested("TargetModelTags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateModelCustomizationJobInput(v *CreateModelCustomizationJobInput) error { if v == nil { return nil @@ -1650,6 +1721,21 @@ func validateOpGetGuardrailInput(v *GetGuardrailInput) error { } } +func validateOpGetModelCopyJobInput(v *GetModelCopyJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetModelCopyJobInput"} + if v.JobArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("JobArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetModelCustomizationJobInput(v *GetModelCustomizationJobInput) error { if v == nil { return nil diff --git a/service/controlcatalog/api_op_GetControl.go b/service/controlcatalog/api_op_GetControl.go new file mode 100644 index 00000000000..fa594ddba78 --- /dev/null +++ b/service/controlcatalog/api_op_GetControl.go @@ -0,0 +1,198 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controlcatalog + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/controlcatalog/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns details about a specific control, most notably a list of Amazon Web +// Services Regions where this control is supported. Input a value for the +// ControlArn parameter, in ARN form. GetControl accepts controltower or +// controlcatalog control ARNs as input. Returns a controlcatalog ARN format. +// +// In the API response, controls that have the value GLOBAL in the Scope field do +// not show the DeployableRegions field, because it does not apply. Controls that +// have the value REGIONAL in the Scope field return a value for the +// DeployableRegions field, as shown in the example. +func (c *Client) GetControl(ctx context.Context, params *GetControlInput, optFns ...func(*Options)) (*GetControlOutput, error) { + if params == nil { + params = &GetControlInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetControl", params, optFns, c.addOperationGetControlMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetControlOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetControlInput struct { + + // The Amazon Resource Name (ARN) of the control. It has one of the following + // formats: + // + // Global format + // + // arn:{PARTITION}:controlcatalog:::control/{CONTROL_CATALOG_OPAQUE_ID} + // + // Or Regional format + // + // arn:{PARTITION}:controltower:{REGION}::control/{CONTROL_TOWER_OPAQUE_ID} + // + // Here is a more general pattern that covers Amazon Web Services Control Tower + // and Control Catalog ARNs: + // + // ^arn:(aws(?:[-a-z]*)?):(controlcatalog|controltower):[a-zA-Z0-9-]*::control/[0-9a-zA-Z_\\-]+$ + // + // This member is required. + ControlArn *string + + noSmithyDocumentSerde +} + +type GetControlOutput struct { + + // The Amazon Resource Name (ARN) of the control. + // + // This member is required. + Arn *string + + // A term that identifies the control's functional behavior. One of Preventive , + // Deteictive , Proactive + // + // This member is required. + Behavior types.ControlBehavior + + // A description of what the control does. + // + // This member is required. + Description *string + + // The display name of the control. + // + // This member is required. + Name *string + + // Returns information about the control, including the scope of the control, if + // enabled, and the Regions in which the control currently is available for + // deployment. + // + // If you are applying controls through an Amazon Web Services Control Tower + // landing zone environment, remember that the values returned in the + // RegionConfiguration API operation are not related to the governed Regions in + // your landing zone. For example, if you are governing Regions A , B ,and C while + // the control is available in Regions A , B , C , and D , you'd see a response + // with DeployableRegions of A , B , C , and D for a control with REGIONAL scope, + // even though you may not intend to deploy the control in Region D , because you + // do not govern it through your landing zone. + // + // This member is required. + RegionConfiguration *types.RegionConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetControlMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetControl{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetControl{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetControl"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetControlValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetControl(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetControl(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetControl", + } +} diff --git a/service/controlcatalog/api_op_ListControls.go b/service/controlcatalog/api_op_ListControls.go new file mode 100644 index 00000000000..2ceccfe7708 --- /dev/null +++ b/service/controlcatalog/api_op_ListControls.go @@ -0,0 +1,240 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controlcatalog + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/controlcatalog/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a paginated list of all available controls in the Amazon Web Services +// Control Catalog library. Allows you to discover available controls. The list of +// controls is given as structures of type controlSummary. The ARN is returned in +// the global controlcatalog format, as shown in the examples. +func (c *Client) ListControls(ctx context.Context, params *ListControlsInput, optFns ...func(*Options)) (*ListControlsOutput, error) { + if params == nil { + params = &ListControlsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListControls", params, optFns, c.addOperationListControlsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListControlsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListControlsInput struct { + + // The maximum number of results on a page or for an API request call. + MaxResults *int32 + + // The pagination token that's used to fetch the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListControlsOutput struct { + + // Returns a list of controls, given as structures of type controlSummary. + // + // This member is required. + Controls []types.ControlSummary + + // The pagination token that's used to fetch the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListControlsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListControls{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListControls{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListControls"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListControls(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListControlsPaginatorOptions is the paginator options for ListControls +type ListControlsPaginatorOptions struct { + // The maximum number of results on a page or for an API request call. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListControlsPaginator is a paginator for ListControls +type ListControlsPaginator struct { + options ListControlsPaginatorOptions + client ListControlsAPIClient + params *ListControlsInput + nextToken *string + firstPage bool +} + +// NewListControlsPaginator returns a new ListControlsPaginator +func NewListControlsPaginator(client ListControlsAPIClient, params *ListControlsInput, optFns ...func(*ListControlsPaginatorOptions)) *ListControlsPaginator { + if params == nil { + params = &ListControlsInput{} + } + + options := ListControlsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListControlsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListControlsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListControls page. +func (p *ListControlsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListControlsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListControls(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListControlsAPIClient is a client that implements the ListControls operation. +type ListControlsAPIClient interface { + ListControls(context.Context, *ListControlsInput, ...func(*Options)) (*ListControlsOutput, error) +} + +var _ ListControlsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListControls(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListControls", + } +} diff --git a/service/controlcatalog/deserializers.go b/service/controlcatalog/deserializers.go index 7ba94b630cd..7cc3618e7df 100644 --- a/service/controlcatalog/deserializers.go +++ b/service/controlcatalog/deserializers.go @@ -28,14 +28,374 @@ func deserializeS3Expires(v string) (*time.Time, error) { return &t, nil } +type awsRestjson1_deserializeOpGetControl struct { +} + +func (*awsRestjson1_deserializeOpGetControl) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetControl(response, &metadata) + } + output := &GetControlOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetControlOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetControlOutput(v **GetControlOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetControlOutput + if *v == nil { + sv = &GetControlOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ControlArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Behavior": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ControlBehavior to be of type string, got %T instead", value) + } + sv.Behavior = types.ControlBehavior(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "RegionConfiguration": + if err := awsRestjson1_deserializeDocumentRegionConfiguration(&sv.RegionConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListCommonControls struct { } -func (*awsRestjson1_deserializeOpListCommonControls) ID() string { +func (*awsRestjson1_deserializeOpListCommonControls) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListCommonControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListCommonControls(response, &metadata) + } + output := &ListCommonControlsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListCommonControlsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListCommonControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListCommonControlsOutput(v **ListCommonControlsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListCommonControlsOutput + if *v == nil { + sv = &ListCommonControlsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CommonControls": + if err := awsRestjson1_deserializeDocumentCommonControlSummaryList(&sv.CommonControls, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListControls struct { +} + +func (*awsRestjson1_deserializeOpListControls) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCommonControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -49,9 +409,9 @@ func (m *awsRestjson1_deserializeOpListCommonControls) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCommonControls(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListControls(response, &metadata) } - output := &ListCommonControlsOutput{} + output := &ListControlsOutput{} out.Result = output var buff [1024]byte @@ -72,7 +432,7 @@ func (m *awsRestjson1_deserializeOpListCommonControls) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCommonControlsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListControlsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -85,7 +445,7 @@ func (m *awsRestjson1_deserializeOpListCommonControls) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCommonControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -148,7 +508,7 @@ func awsRestjson1_deserializeOpErrorListCommonControls(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListCommonControlsOutput(v **ListCommonControlsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListControlsOutput(v **ListControlsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -161,17 +521,17 @@ func awsRestjson1_deserializeOpDocumentListCommonControlsOutput(v **ListCommonCo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCommonControlsOutput + var sv *ListControlsOutput if *v == nil { - sv = &ListCommonControlsOutput{} + sv = &ListControlsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CommonControls": - if err := awsRestjson1_deserializeDocumentCommonControlSummaryList(&sv.CommonControls, value); err != nil { + case "Controls": + if err := awsRestjson1_deserializeDocumentControls(&sv.Controls, value); err != nil { return err } @@ -595,6 +955,42 @@ func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.R return output } +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ThrottlingException{} var buff [1024]byte @@ -939,6 +1335,134 @@ func awsRestjson1_deserializeDocumentCommonControlSummaryList(v *[]types.CommonC return nil } +func awsRestjson1_deserializeDocumentControls(v *[]types.ControlSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ControlSummary + if *v == nil { + cv = []types.ControlSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ControlSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentControlSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentControlSummary(v **types.ControlSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ControlSummary + if *v == nil { + sv = &types.ControlSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ControlArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeployableRegions(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionCode to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentDomainSummary(v **types.DomainSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1232,6 +1756,91 @@ func awsRestjson1_deserializeDocumentObjectiveSummaryList(v *[]types.ObjectiveSu return nil } +func awsRestjson1_deserializeDocumentRegionConfiguration(v **types.RegionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RegionConfiguration + if *v == nil { + sv = &types.RegionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DeployableRegions": + if err := awsRestjson1_deserializeDocumentDeployableRegions(&sv.DeployableRegions, value); err != nil { + return err + } + + case "Scope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ControlScope to be of type string, got %T instead", value) + } + sv.Scope = types.ControlScope(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/controlcatalog/generated.json b/service/controlcatalog/generated.json index 64cb12d2285..fe7155669e0 100644 --- a/service/controlcatalog/generated.json +++ b/service/controlcatalog/generated.json @@ -8,7 +8,9 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_GetControl.go", "api_op_ListCommonControls.go", + "api_op_ListControls.go", "api_op_ListDomains.go", "api_op_ListObjectives.go", "auth.go", @@ -24,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "types/enums.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/controlcatalog/serializers.go b/service/controlcatalog/serializers.go index b283c3bac3b..9e3c21d71ae 100644 --- a/service/controlcatalog/serializers.go +++ b/service/controlcatalog/serializers.go @@ -14,6 +14,81 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +type awsRestjson1_serializeOpGetControl struct { +} + +func (*awsRestjson1_serializeOpGetControl) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetControl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetControlInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/get-control") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetControlInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetControlInput(v *GetControlInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetControlInput(v *GetControlInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ControlArn != nil { + ok := object.Key("ControlArn") + ok.String(*v.ControlArn) + } + + return nil +} + type awsRestjson1_serializeOpListCommonControls struct { } @@ -103,6 +178,70 @@ func awsRestjson1_serializeOpDocumentListCommonControlsInput(v *ListCommonContro return nil } +type awsRestjson1_serializeOpListControls struct { +} + +func (*awsRestjson1_serializeOpListControls) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListControlsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-controls") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListControlsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListControlsInput(v *ListControlsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListDomains struct { } diff --git a/service/controlcatalog/snapshot/api_op_GetControl.go.snap b/service/controlcatalog/snapshot/api_op_GetControl.go.snap new file mode 100644 index 00000000000..55f29173ac7 --- /dev/null +++ b/service/controlcatalog/snapshot/api_op_GetControl.go.snap @@ -0,0 +1,36 @@ +GetControl + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/controlcatalog/snapshot/api_op_ListControls.go.snap b/service/controlcatalog/snapshot/api_op_ListControls.go.snap new file mode 100644 index 00000000000..82ee003b7e9 --- /dev/null +++ b/service/controlcatalog/snapshot/api_op_ListControls.go.snap @@ -0,0 +1,35 @@ +ListControls + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/controlcatalog/snapshot_test.go b/service/controlcatalog/snapshot_test.go index 6f64fe8c919..b54dd3227ea 100644 --- a/service/controlcatalog/snapshot_test.go +++ b/service/controlcatalog/snapshot_test.go @@ -62,6 +62,18 @@ func testSnapshot(stack *middleware.Stack, operation string) error { } return snapshotOK{} } +func TestCheckSnapshot_GetControl(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetControl(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetControl") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListCommonControls(t *testing.T) { svc := New(Options{}) _, err := svc.ListCommonControls(context.Background(), nil, func(o *Options) { @@ -74,6 +86,18 @@ func TestCheckSnapshot_ListCommonControls(t *testing.T) { } } +func TestCheckSnapshot_ListControls(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListControls(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListControls") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListDomains(t *testing.T) { svc := New(Options{}) _, err := svc.ListDomains(context.Background(), nil, func(o *Options) { @@ -97,6 +121,18 @@ func TestCheckSnapshot_ListObjectives(t *testing.T) { t.Fatal(err) } } +func TestUpdateSnapshot_GetControl(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetControl(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetControl") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListCommonControls(t *testing.T) { svc := New(Options{}) _, err := svc.ListCommonControls(context.Background(), nil, func(o *Options) { @@ -109,6 +145,18 @@ func TestUpdateSnapshot_ListCommonControls(t *testing.T) { } } +func TestUpdateSnapshot_ListControls(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListControls(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListControls") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListDomains(t *testing.T) { svc := New(Options{}) _, err := svc.ListDomains(context.Background(), nil, func(o *Options) { diff --git a/service/controlcatalog/types/enums.go b/service/controlcatalog/types/enums.go new file mode 100644 index 00000000000..0abd4b15a1c --- /dev/null +++ b/service/controlcatalog/types/enums.go @@ -0,0 +1,43 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type ControlBehavior string + +// Enum values for ControlBehavior +const ( + ControlBehaviorPreventive ControlBehavior = "PREVENTIVE" + ControlBehaviorProactive ControlBehavior = "PROACTIVE" + ControlBehaviorDetective ControlBehavior = "DETECTIVE" +) + +// Values returns all known values for ControlBehavior. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ControlBehavior) Values() []ControlBehavior { + return []ControlBehavior{ + "PREVENTIVE", + "PROACTIVE", + "DETECTIVE", + } +} + +type ControlScope string + +// Enum values for ControlScope +const ( + ControlScopeGlobal ControlScope = "GLOBAL" + ControlScopeRegional ControlScope = "REGIONAL" +) + +// Values returns all known values for ControlScope. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ControlScope) Values() []ControlScope { + return []ControlScope{ + "GLOBAL", + "REGIONAL", + } +} diff --git a/service/controlcatalog/types/errors.go b/service/controlcatalog/types/errors.go index c55abca39be..4392935193b 100644 --- a/service/controlcatalog/types/errors.go +++ b/service/controlcatalog/types/errors.go @@ -60,6 +60,32 @@ func (e *InternalServerException) ErrorCode() string { } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// The requested resource does not exist. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The request was denied due to request throttling. type ThrottlingException struct { Message *string diff --git a/service/controlcatalog/types/types.go b/service/controlcatalog/types/types.go index 183882a5616..e9cb4659d48 100644 --- a/service/controlcatalog/types/types.go +++ b/service/controlcatalog/types/types.go @@ -84,6 +84,28 @@ type CommonControlSummary struct { noSmithyDocumentSerde } +// Overview of information about a control. +type ControlSummary struct { + + // The Amazon Resource Name (ARN) of the control. + // + // This member is required. + Arn *string + + // A description of the control, as it may appear in the console. Describes the + // functionality of the control. + // + // This member is required. + Description *string + + // The display name of the control. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + // The domain resource that's being used as a filter. type DomainResourceFilter struct { @@ -181,4 +203,36 @@ type ObjectiveSummary struct { noSmithyDocumentSerde } +// Returns information about the control, including the scope of the control, if +// enabled, and the Regions in which the control currently is available for +// deployment. +// +// If you are applying controls through an Amazon Web Services Control Tower +// landing zone environment, remember that the values returned in the +// RegionConfiguration API operation are not related to the governed Regions in +// your landing zone. For example, if you are governing Regions A , B ,and C while +// the control is available in Regions A , B , C , and D , you'd see a response +// with DeployableRegions of A , B , C , and D for a control with REGIONAL scope, +// even though you may not intend to deploy the control in Region D , because you +// do not govern it through your landing zone. +type RegionConfiguration struct { + + // The coverage of the control, if deployed. Scope is an enumerated type, with + // value Regional , or Global . A control with Global scope is effective in all + // Amazon Web Services Regions, regardless of the Region from which it is enabled, + // or to which it is deployed. A control implemented by an SCP is usually Global in + // scope. A control with Regional scope has operations that are restricted + // specifically to the Region from which it is enabled and to which it is deployed. + // Controls implemented by Config rules and CloudFormation hooks usually are + // Regional in scope. Security Hub controls usually are Regional in scope. + // + // This member is required. + Scope ControlScope + + // Regions in which the control is available to be deployed. + DeployableRegions []string + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/controlcatalog/validators.go b/service/controlcatalog/validators.go index 705692c01f3..74f48b14184 100644 --- a/service/controlcatalog/validators.go +++ b/service/controlcatalog/validators.go @@ -1,3 +1,49 @@ // Code generated by smithy-go-codegen DO NOT EDIT. package controlcatalog + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpGetControl struct { +} + +func (*validateOpGetControl) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetControl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetControlInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetControlInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpGetControlValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetControl{}, middleware.After) +} + +func validateOpGetControlInput(v *GetControlInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetControlInput"} + if v.ControlArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ControlArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/controltower/doc.go b/service/controltower/doc.go index 95edf97ad39..2266407d65f 100644 --- a/service/controltower/doc.go +++ b/service/controltower/doc.go @@ -33,6 +33,8 @@ // // [ListLandingZones] // +// [ListLandingZoneOperations] +// // [ResetLandingZone] // // [UpdateLandingZone] @@ -89,20 +91,36 @@ // view the controlIdentifier in the console on the Control details page, as well // as in the documentation. // -// The controlIdentifier is unique in each Amazon Web Services Region for each -// control. You can find the controlIdentifier for each Region and control in the [Tables of control metadata] -// or the [Control availability by Region tables]in the Amazon Web Services Control Tower Controls Reference Guide. +// # About identifiers for Amazon Web Services Control Tower +// +// The Amazon Web Services Control Tower controlIdentifier is unique in each +// Amazon Web Services Region for each control. You can find the controlIdentifier +// for each Region and control in the [Tables of control metadata]or the [Control availability by Region tables] in the Amazon Web Services Control +// Tower Controls Reference Guide. // // A quick-reference list of control identifers for the Amazon Web Services // Control Tower legacy Strongly recommended and Elective controls is given in [Resource identifiers for APIs and controls]in // the [Amazon Web Services Control Tower Controls Reference Guide]. Remember that Mandatory controls cannot be added or removed. // -// ARN format: arn:aws:controltower:{REGION}::control/{CONTROL_NAME} +// Some controls have two identifiers +// +// - ARN format for Amazon Web Services Control Tower: +// arn:aws:controltower:{REGION}::control/{CONTROL_TOWER_OPAQUE_ID} // // Example: // // arn:aws:controltower:us-west-2::control/AWS-GR_AUTOSCALING_LAUNCH_CONFIG_PUBLIC_IP_DISABLED // +// - ARN format for Amazon Web Services Control Catalog: +// arn:{PARTITION}:controlcatalog:::control/{CONTROL_CATALOG_OPAQUE_ID} +// +// You can find the {CONTROL_CATALOG_OPAQUE_ID} in the [Amazon Web Services Control Tower Controls Reference Guide], or in the Amazon Web +// Services Control Tower console, on the Control details page. +// +// The Amazon Web Services Control Tower APIs for enabled controls, such as +// GetEnabledControl and ListEnabledControls always return an ARN of the same type +// given when the control was enabled. +// // To get the targetIdentifier : // // The targetIdentifier is the ARN for an OU. @@ -136,6 +154,22 @@ // The individual API operations for baselines are detailed in this document, the [API reference manual] // , in the "Actions" section. For usage examples, see [Baseline API input and output examples with CLI]. // +// About Amazon Web Services Control Catalog identifiers +// +// - The EnableControl and DisableControl API operations can be called by +// specifying either the Amazon Web Services Control Tower identifer or the Amazon +// Web Services Control Catalog identifier. The API response returns the same type +// of identifier that you specified when calling the API. +// +// - If you use an Amazon Web Services Control Tower identifier to call the +// EnableControl API, and then call EnableControl again with an Amazon Web +// Services Control Catalog identifier, Amazon Web Services Control Tower returns +// an error message stating that the control is already enabled. Similar behavior +// applies to the DisableControl API operation. +// +// - Mandatory controls and the landing-zone-level Region deny control have +// Amazon Web Services Control Tower identifiers only. +// // # Details and examples // // [Control API input and output examples with CLI] @@ -180,7 +214,7 @@ // [ListBaselines]: https://docs.aws.amazon.com/controltower/latest/APIReference/API_ListBaselines.html // [ListEnabledBaselines]: https://docs.aws.amazon.com/controltower/latest/APIReference/API_ListEnabledBaselines.html // [ResetLandingZone]: https://docs.aws.amazon.com/controltower/latest/APIReference/API_ResetLandingZone.html -// [Amazon Web Services Control Tower Controls Reference Guide]: https://docs.aws.amazon.com/controltower/latest/controlreference/control-identifiers.html +// [Amazon Web Services Control Tower Controls Reference Guide]: https://docs.aws.amazon.com/controltower/latest/controlreference/all-global-identifiers.html // [GetLandingZoneOperation]: https://docs.aws.amazon.com/controltower/latest/APIReference/API_GetLandingZoneOperation.html // [GetBaseline]: https://docs.aws.amazon.com/controltower/latest/APIReference/API_GetBaseline.html // [Control API input and output examples with CLI]: https://docs.aws.amazon.com/controltower/latest/controlreference/control-api-examples-short.html @@ -201,6 +235,7 @@ // [UpdateEnabledControl]: https://docs.aws.amazon.com/controltower/latest/APIReference/API_UpdateEnabledControl.html // [ListTagsForResource]: https://docs.aws.amazon.com/controltower/latest/APIReference/API_ListTagsForResource.html // [UpdateLandingZone]: https://docs.aws.amazon.com/controltower/latest/APIReference/API_UpdateLandingZone.html +// [ListLandingZoneOperations]: https://docs.aws.amazon.com/controltower/latest/APIReference/API_ListLandingZoneOperations.html // [Creating Amazon Web Services Control Tower resources with Amazon Web Services CloudFormation]: https://docs.aws.amazon.com/controltower/latest/userguide/creating-resources-with-cloudformation.html // [TagResource]: https://docs.aws.amazon.com/controltower/latest/APIReference/API_TagResource.html // [Amazon Web Services Control Tower supports APIs for OU registration and configuration with baselines]: https://docs.aws.amazon.com/controltower/latest/userguide/2024-all.html#baseline-apis diff --git a/service/memorydb/api_op_DeleteCluster.go b/service/memorydb/api_op_DeleteCluster.go index 5d51dc85a59..a2e5f034039 100644 --- a/service/memorydb/api_op_DeleteCluster.go +++ b/service/memorydb/api_op_DeleteCluster.go @@ -12,6 +12,9 @@ import ( ) // Deletes a cluster. It also deletes all associated nodes and node endpoints +// +// CreateSnapshot permission is required to create a final snapshot. Without this +// permission, the API call will fail with an Access Denied exception. func (c *Client) DeleteCluster(ctx context.Context, params *DeleteClusterInput, optFns ...func(*Options)) (*DeleteClusterOutput, error) { if params == nil { params = &DeleteClusterInput{} diff --git a/service/rds/api_op_CopyDBClusterParameterGroup.go b/service/rds/api_op_CopyDBClusterParameterGroup.go index a5e7c2deed8..10f54f29e26 100644 --- a/service/rds/api_op_CopyDBClusterParameterGroup.go +++ b/service/rds/api_op_CopyDBClusterParameterGroup.go @@ -68,9 +68,13 @@ type CopyDBClusterParameterGroupInput struct { // This member is required. TargetDBClusterParameterGroupIdentifier *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag noSmithyDocumentSerde diff --git a/service/rds/api_op_CopyDBClusterSnapshot.go b/service/rds/api_op_CopyDBClusterSnapshot.go index c40a72d5ae3..8581da9f2c9 100644 --- a/service/rds/api_op_CopyDBClusterSnapshot.go +++ b/service/rds/api_op_CopyDBClusterSnapshot.go @@ -188,9 +188,13 @@ type CopyDBClusterSnapshotInput struct { // region, if the PresignURL member is empty set. SourceRegion *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // Used by the SDK's PresignURL autofill customization to specify the region the diff --git a/service/rds/api_op_CopyDBParameterGroup.go b/service/rds/api_op_CopyDBParameterGroup.go index d5e7b6a88df..379e4ad1049 100644 --- a/service/rds/api_op_CopyDBParameterGroup.go +++ b/service/rds/api_op_CopyDBParameterGroup.go @@ -67,9 +67,13 @@ type CopyDBParameterGroupInput struct { // This member is required. TargetDBParameterGroupIdentifier *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag noSmithyDocumentSerde diff --git a/service/rds/api_op_CopyDBSnapshot.go b/service/rds/api_op_CopyDBSnapshot.go index 3abc2d73794..2519c2f65c2 100644 --- a/service/rds/api_op_CopyDBSnapshot.go +++ b/service/rds/api_op_CopyDBSnapshot.go @@ -190,9 +190,13 @@ type CopyDBSnapshotInput struct { // region, if the PresignURL member is empty set. SourceRegion *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // The external custom Availability Zone (CAZ) identifier for the target CAZ. diff --git a/service/rds/api_op_CopyOptionGroup.go b/service/rds/api_op_CopyOptionGroup.go index e3848f87499..fa9aee16b5a 100644 --- a/service/rds/api_op_CopyOptionGroup.go +++ b/service/rds/api_op_CopyOptionGroup.go @@ -60,9 +60,13 @@ type CopyOptionGroupInput struct { // This member is required. TargetOptionGroupIdentifier *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag noSmithyDocumentSerde diff --git a/service/rds/api_op_CreateCustomDBEngineVersion.go b/service/rds/api_op_CreateCustomDBEngineVersion.go index 9b498b651c9..2a6cd68605f 100644 --- a/service/rds/api_op_CreateCustomDBEngineVersion.go +++ b/service/rds/api_op_CreateCustomDBEngineVersion.go @@ -114,9 +114,13 @@ type CreateCustomDBEngineVersionInput struct { // specify SourceCustomDbEngineVersionIdentifier . SourceCustomDbEngineVersionIdentifier *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // Specifies whether to use the latest service-provided Amazon Machine Image (AMI) @@ -270,9 +274,13 @@ type CreateCustomDBEngineVersionOutput struct { // Indicates whether the database engine version supports read replicas. SupportsReadReplica *bool - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html TagList []types.Tag // A list of engine versions that this database engine version can be upgraded to. diff --git a/service/rds/api_op_CreateDBInstanceReadReplica.go b/service/rds/api_op_CreateDBInstanceReadReplica.go index 767bf676bfd..3cd295ba89f 100644 --- a/service/rds/api_op_CreateDBInstanceReadReplica.go +++ b/service/rds/api_op_CreateDBInstanceReadReplica.go @@ -594,9 +594,13 @@ type CreateDBInstanceReadReplicaInput struct { // Default: io1 if the Iops parameter is specified. Otherwise, gp2 . StorageType *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // Whether to upgrade the storage file system configuration on the read replica. diff --git a/service/rds/api_op_CreateDBProxyEndpoint.go b/service/rds/api_op_CreateDBProxyEndpoint.go index caeeafb2d44..25b6554efa0 100644 --- a/service/rds/api_op_CreateDBProxyEndpoint.go +++ b/service/rds/api_op_CreateDBProxyEndpoint.go @@ -48,9 +48,13 @@ type CreateDBProxyEndpointInput struct { // This member is required. VpcSubnetIds []string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // The role of the DB proxy endpoint. The role determines whether the endpoint can diff --git a/service/rds/api_op_CreateDBShardGroup.go b/service/rds/api_op_CreateDBShardGroup.go index d91d7a06859..57de8429e72 100644 --- a/service/rds/api_op_CreateDBShardGroup.go +++ b/service/rds/api_op_CreateDBShardGroup.go @@ -59,6 +59,9 @@ type CreateDBShardGroupInput struct { // AZs for each physical shard. ComputeRedundancy *int32 + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + // Specifies whether the DB shard group is publicly accessible. // // When the DB shard group is publicly accessible, its Domain Name System (DNS) @@ -127,6 +130,9 @@ type CreateDBShardGroupOutput struct { // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). MaxACU *float64 + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + // Indicates whether the DB shard group is publicly accessible. // // When the DB shard group is publicly accessible, its Domain Name System (DNS) diff --git a/service/rds/api_op_CreateDBSnapshot.go b/service/rds/api_op_CreateDBSnapshot.go index 077903d6720..8c724d5f885 100644 --- a/service/rds/api_op_CreateDBSnapshot.go +++ b/service/rds/api_op_CreateDBSnapshot.go @@ -56,9 +56,13 @@ type CreateDBSnapshotInput struct { // This member is required. DBSnapshotIdentifier *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag noSmithyDocumentSerde diff --git a/service/rds/api_op_CreateEventSubscription.go b/service/rds/api_op_CreateEventSubscription.go index ca910b8cead..8061c47d8fb 100644 --- a/service/rds/api_op_CreateEventSubscription.go +++ b/service/rds/api_op_CreateEventSubscription.go @@ -126,9 +126,13 @@ type CreateEventSubscriptionInput struct { // custom-engine-version | blue-green-deployment SourceType *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag noSmithyDocumentSerde diff --git a/service/rds/api_op_CreateIntegration.go b/service/rds/api_op_CreateIntegration.go index 461706a7dff..64de36ef21e 100644 --- a/service/rds/api_op_CreateIntegration.go +++ b/service/rds/api_op_CreateIntegration.go @@ -70,9 +70,13 @@ type CreateIntegrationInput struct { // an encryption key, RDS uses a default Amazon Web Services owned key. KMSKeyId *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag noSmithyDocumentSerde @@ -117,9 +121,13 @@ type CreateIntegrationOutput struct { // The current status of the integration. Status types.IntegrationStatus - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // The ARN of the Redshift data warehouse used as the target for replication. diff --git a/service/rds/api_op_CreateTenantDatabase.go b/service/rds/api_op_CreateTenantDatabase.go index b0410dae7d6..6881625c0ff 100644 --- a/service/rds/api_op_CreateTenantDatabase.go +++ b/service/rds/api_op_CreateTenantDatabase.go @@ -78,9 +78,13 @@ type CreateTenantDatabaseInput struct { // The NCHAR value for the tenant database. NcharCharacterSetName *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag noSmithyDocumentSerde diff --git a/service/rds/api_op_DeleteCustomDBEngineVersion.go b/service/rds/api_op_DeleteCustomDBEngineVersion.go index 405482e4a24..98264ced494 100644 --- a/service/rds/api_op_DeleteCustomDBEngineVersion.go +++ b/service/rds/api_op_DeleteCustomDBEngineVersion.go @@ -216,9 +216,13 @@ type DeleteCustomDBEngineVersionOutput struct { // Indicates whether the database engine version supports read replicas. SupportsReadReplica *bool - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html TagList []types.Tag // A list of engine versions that this database engine version can be upgraded to. diff --git a/service/rds/api_op_DeleteDBCluster.go b/service/rds/api_op_DeleteDBCluster.go index 97e6b8637d0..3ca68dda83f 100644 --- a/service/rds/api_op_DeleteDBCluster.go +++ b/service/rds/api_op_DeleteDBCluster.go @@ -55,18 +55,13 @@ type DeleteDBClusterInput struct { // Specifies whether to remove automated backups immediately after the DB cluster // is deleted. This parameter isn't case-sensitive. The default is to remove // automated backups immediately after the DB cluster is deleted. - // - // You must delete automated backups for Amazon RDS Multi-AZ DB clusters. For more - // information about managing automated backups for RDS Multi-AZ DB clusters, see [Managing automated backups]. - // - // [Managing automated backups]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ManagingAutomatedBackups.html DeleteAutomatedBackups *bool // The DB cluster snapshot identifier of the new DB cluster snapshot created when // SkipFinalSnapshot is disabled. // - // Specifying this parameter and also skipping the creation of a final DB cluster - // snapshot with the SkipFinalShapshot parameter results in an error. + // If you specify this parameter and also skip the creation of a final DB cluster + // snapshot with the SkipFinalShapshot parameter, the request results in an error. // // Constraints: // @@ -78,13 +73,13 @@ type DeleteDBClusterInput struct { FinalDBSnapshotIdentifier *string // Specifies whether to skip the creation of a final DB cluster snapshot before - // the DB cluster is deleted. If skip is specified, no DB cluster snapshot is - // created. If skip isn't specified, a DB cluster snapshot is created before the DB - // cluster is deleted. By default, skip isn't specified, and the DB cluster - // snapshot is created. By default, this parameter is disabled. + // RDS deletes the DB cluster. If you set this value to true , RDS doesn't create a + // final DB cluster snapshot. If you set this value to false or don't specify it, + // RDS creates a DB cluster snapshot before it deletes the DB cluster. By default, + // this parameter is disabled, so RDS creates a final DB cluster snapshot. // - // You must specify a FinalDBSnapshotIdentifier parameter if SkipFinalSnapshot is - // disabled. + // If SkipFinalSnapshot is disabled, you must specify a value for the + // FinalDBSnapshotIdentifier parameter. SkipFinalSnapshot *bool noSmithyDocumentSerde diff --git a/service/rds/api_op_DeleteDBShardGroup.go b/service/rds/api_op_DeleteDBShardGroup.go index 6ff7de51bf4..733fc260234 100644 --- a/service/rds/api_op_DeleteDBShardGroup.go +++ b/service/rds/api_op_DeleteDBShardGroup.go @@ -67,6 +67,9 @@ type DeleteDBShardGroupOutput struct { // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). MaxACU *float64 + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + // Indicates whether the DB shard group is publicly accessible. // // When the DB shard group is publicly accessible, its Domain Name System (DNS) diff --git a/service/rds/api_op_DeleteIntegration.go b/service/rds/api_op_DeleteIntegration.go index 201a03c127b..bc94bfb743e 100644 --- a/service/rds/api_op_DeleteIntegration.go +++ b/service/rds/api_op_DeleteIntegration.go @@ -77,9 +77,13 @@ type DeleteIntegrationOutput struct { // The current status of the integration. Status types.IntegrationStatus - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // The ARN of the Redshift data warehouse used as the target for replication. diff --git a/service/rds/api_op_DescribeDBClusterParameters.go b/service/rds/api_op_DescribeDBClusterParameters.go index be44f10d363..c0786c7d8a8 100644 --- a/service/rds/api_op_DescribeDBClusterParameters.go +++ b/service/rds/api_op_DescribeDBClusterParameters.go @@ -67,7 +67,7 @@ type DescribeDBClusterParametersInput struct { // // Valid Values: // - // - user + // - customer // // - engine // diff --git a/service/rds/api_op_ModifyCustomDBEngineVersion.go b/service/rds/api_op_ModifyCustomDBEngineVersion.go index e9a9e214f6c..04253a60be6 100644 --- a/service/rds/api_op_ModifyCustomDBEngineVersion.go +++ b/service/rds/api_op_ModifyCustomDBEngineVersion.go @@ -227,9 +227,13 @@ type ModifyCustomDBEngineVersionOutput struct { // Indicates whether the database engine version supports read replicas. SupportsReadReplica *bool - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html TagList []types.Tag // A list of engine versions that this database engine version can be upgraded to. diff --git a/service/rds/api_op_ModifyDBShardGroup.go b/service/rds/api_op_ModifyDBShardGroup.go index 776a477a7aa..6192dbfb3ec 100644 --- a/service/rds/api_op_ModifyDBShardGroup.go +++ b/service/rds/api_op_ModifyDBShardGroup.go @@ -38,6 +38,9 @@ type ModifyDBShardGroupInput struct { // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). MaxACU *float64 + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + noSmithyDocumentSerde } @@ -72,6 +75,9 @@ type ModifyDBShardGroupOutput struct { // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). MaxACU *float64 + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + // Indicates whether the DB shard group is publicly accessible. // // When the DB shard group is publicly accessible, its Domain Name System (DNS) diff --git a/service/rds/api_op_ModifyIntegration.go b/service/rds/api_op_ModifyIntegration.go index e10165eb9e9..e213699196b 100644 --- a/service/rds/api_op_ModifyIntegration.go +++ b/service/rds/api_op_ModifyIntegration.go @@ -92,9 +92,13 @@ type ModifyIntegrationOutput struct { // The current status of the integration. Status types.IntegrationStatus - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // The ARN of the Redshift data warehouse used as the target for replication. diff --git a/service/rds/api_op_PurchaseReservedDBInstancesOffering.go b/service/rds/api_op_PurchaseReservedDBInstancesOffering.go index 7d3b8f7a14e..89a76b912fe 100644 --- a/service/rds/api_op_PurchaseReservedDBInstancesOffering.go +++ b/service/rds/api_op_PurchaseReservedDBInstancesOffering.go @@ -46,9 +46,13 @@ type PurchaseReservedDBInstancesOfferingInput struct { // Example: myreservationID ReservedDBInstanceId *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag noSmithyDocumentSerde diff --git a/service/rds/api_op_RebootDBShardGroup.go b/service/rds/api_op_RebootDBShardGroup.go index f6ded15288d..e1258a5ae07 100644 --- a/service/rds/api_op_RebootDBShardGroup.go +++ b/service/rds/api_op_RebootDBShardGroup.go @@ -71,6 +71,9 @@ type RebootDBShardGroupOutput struct { // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). MaxACU *float64 + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + // Indicates whether the DB shard group is publicly accessible. // // When the DB shard group is publicly accessible, its Domain Name System (DNS) diff --git a/service/rds/api_op_RestoreDBClusterFromS3.go b/service/rds/api_op_RestoreDBClusterFromS3.go index dce9e0aaec3..32e24930f3d 100644 --- a/service/rds/api_op_RestoreDBClusterFromS3.go +++ b/service/rds/api_op_RestoreDBClusterFromS3.go @@ -396,9 +396,13 @@ type RestoreDBClusterFromS3Input struct { // Valid for: Aurora DB clusters only StorageType *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // A list of EC2 VPC security groups to associate with the restored DB cluster. diff --git a/service/rds/api_op_RestoreDBClusterToPointInTime.go b/service/rds/api_op_RestoreDBClusterToPointInTime.go index 68a150386e8..a145c246c1e 100644 --- a/service/rds/api_op_RestoreDBClusterToPointInTime.go +++ b/service/rds/api_op_RestoreDBClusterToPointInTime.go @@ -412,9 +412,13 @@ type RestoreDBClusterToPointInTimeInput struct { // Valid for: Aurora DB clusters and Multi-AZ DB clusters StorageType *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // Specifies whether to restore the DB cluster to the latest restorable backup diff --git a/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go b/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go index 818f37372ba..2c1c22aa389 100644 --- a/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go +++ b/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go @@ -514,9 +514,13 @@ type RestoreDBInstanceFromDBSnapshotInput struct { // Default: io1 if the Iops parameter is specified, otherwise gp2 StorageType *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // The ARN from the key store with which to associate the instance for TDE diff --git a/service/rds/api_op_RestoreDBInstanceToPointInTime.go b/service/rds/api_op_RestoreDBInstanceToPointInTime.go index 36c9686fc0b..fe1d32bbc8b 100644 --- a/service/rds/api_op_RestoreDBInstanceToPointInTime.go +++ b/service/rds/api_op_RestoreDBInstanceToPointInTime.go @@ -520,9 +520,13 @@ type RestoreDBInstanceToPointInTimeInput struct { // Iops parameter. StorageType *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []types.Tag // The ARN from the key store with which to associate the instance for TDE diff --git a/service/rds/deserializers.go b/service/rds/deserializers.go index feaa0f3e20b..d5b0f635dc8 100644 --- a/service/rds/deserializers.go +++ b/service/rds/deserializers.go @@ -37277,6 +37277,23 @@ func awsAwsquery_deserializeDocumentDBShardGroup(v **types.DBShardGroup, decoder sv.MaxACU = ptr.Float64(f64) } + case strings.EqualFold("MinACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinACU = ptr.Float64(f64) + } + case strings.EqualFold("PubliclyAccessible", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -56693,6 +56710,23 @@ func awsAwsquery_deserializeOpDocumentCreateDBShardGroupOutput(v **CreateDBShard sv.MaxACU = ptr.Float64(f64) } + case strings.EqualFold("MinACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinACU = ptr.Float64(f64) + } + case strings.EqualFold("PubliclyAccessible", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -58191,6 +58225,23 @@ func awsAwsquery_deserializeOpDocumentDeleteDBShardGroupOutput(v **DeleteDBShard sv.MaxACU = ptr.Float64(f64) } + case strings.EqualFold("MinACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinACU = ptr.Float64(f64) + } + case strings.EqualFold("PubliclyAccessible", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -62700,6 +62751,23 @@ func awsAwsquery_deserializeOpDocumentModifyDBShardGroupOutput(v **ModifyDBShard sv.MaxACU = ptr.Float64(f64) } + case strings.EqualFold("MinACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinACU = ptr.Float64(f64) + } + case strings.EqualFold("PubliclyAccessible", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -63530,6 +63598,23 @@ func awsAwsquery_deserializeOpDocumentRebootDBShardGroupOutput(v **RebootDBShard sv.MaxACU = ptr.Float64(f64) } + case strings.EqualFold("MinACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinACU = ptr.Float64(f64) + } + case strings.EqualFold("PubliclyAccessible", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/rds/serializers.go b/service/rds/serializers.go index d0760fce416..dcc6567b820 100644 --- a/service/rds/serializers.go +++ b/service/rds/serializers.go @@ -12696,6 +12696,24 @@ func awsAwsquery_serializeOpDocumentCreateDBShardGroupInput(v *CreateDBShardGrou } } + if v.MinACU != nil { + objectKey := object.Key("MinACU") + switch { + case math.IsNaN(*v.MinACU): + objectKey.String("NaN") + + case math.IsInf(*v.MinACU, 1): + objectKey.String("Infinity") + + case math.IsInf(*v.MinACU, -1): + objectKey.String("-Infinity") + + default: + objectKey.Double(*v.MinACU) + + } + } + if v.PubliclyAccessible != nil { objectKey := object.Key("PubliclyAccessible") objectKey.Boolean(*v.PubliclyAccessible) @@ -15884,6 +15902,24 @@ func awsAwsquery_serializeOpDocumentModifyDBShardGroupInput(v *ModifyDBShardGrou } } + if v.MinACU != nil { + objectKey := object.Key("MinACU") + switch { + case math.IsNaN(*v.MinACU): + objectKey.String("NaN") + + case math.IsInf(*v.MinACU, 1): + objectKey.String("Infinity") + + case math.IsInf(*v.MinACU, -1): + objectKey.String("-Infinity") + + default: + objectKey.Double(*v.MinACU) + + } + } + return nil } diff --git a/service/rds/types/types.go b/service/rds/types/types.go index cdab9f53769..c7499839b1b 100644 --- a/service/rds/types/types.go +++ b/service/rds/types/types.go @@ -191,9 +191,13 @@ type BlueGreenDeployment struct { // The details about each source and target resource in the blue/green deployment. SwitchoverDetails []SwitchoverDetail - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html TagList []Tag // The target database for the blue/green deployment. @@ -938,9 +942,13 @@ type DBCluster struct { // The storage type associated with the DB cluster. StorageType *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html TagList []Tag // The list of VPC security groups that the DB cluster belongs to. @@ -1339,9 +1347,13 @@ type DBClusterSnapshot struct { // This setting is only for Aurora DB clusters. StorageType *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html TagList []Tag // The VPC ID associated with the DB cluster snapshot. @@ -1554,9 +1566,13 @@ type DBEngineVersion struct { // Indicates whether the database engine version supports read replicas. SupportsReadReplica *bool - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html TagList []Tag // A list of engine versions that this database engine version can be upgraded to. @@ -1998,9 +2014,13 @@ type DBInstance struct { // The storage type associated with the DB instance. StorageType *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html TagList []Tag // The ARN from the key store with which the instance is associated for TDE @@ -2666,6 +2686,9 @@ type DBShardGroup struct { // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). MaxACU *float64 + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + // Indicates whether the DB shard group is publicly accessible. // // When the DB shard group is publicly accessible, its Domain Name System (DNS) @@ -2819,9 +2842,13 @@ type DBSnapshot struct { // Specifies the storage type associated with DB snapshot. StorageType *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html TagList []Tag // The ARN from the key store with which to associate the instance for TDE @@ -2913,9 +2940,13 @@ type DBSnapshotTenantDatabase struct { // The type of DB snapshot. SnapshotType *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html TagList []Tag // The name of the tenant database. @@ -3481,9 +3512,13 @@ type Integration struct { // The current status of the integration. Status IntegrationStatus - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html Tags []Tag // The ARN of the Redshift data warehouse used as the target for replication. @@ -3672,7 +3707,7 @@ type Option struct { noSmithyDocumentSerde } -// A list of all available options +// A list of all available options for an option group. type OptionConfiguration struct { // The configuration of options to include in a group. @@ -3680,7 +3715,7 @@ type OptionConfiguration struct { // This member is required. OptionName *string - // A list of DBSecurityGroupMembership name strings used for this option. + // A list of DB security groups used for this option. DBSecurityGroupMemberships []string // The option settings to include in an option group. @@ -3692,7 +3727,7 @@ type OptionConfiguration struct { // The optional port for the option. Port *int32 - // A list of VpcSecurityGroupMembership name strings used for this option. + // A list of VPC security group names used for this option. VpcSecurityGroupMemberships []string noSmithyDocumentSerde @@ -4911,11 +4946,11 @@ type SwitchoverDetail struct { // Metadata assigned to an Amazon RDS resource consisting of a key-value pair. // -// For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS Resources] in the Amazon +// For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon // Aurora User Guide. // -// [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html -// [Tagging Amazon Aurora and Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html +// [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html +// [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html type Tag struct { // A key is the required name of the tag. The string value can be from 1 to 128 @@ -4983,9 +5018,13 @@ type TenantDatabase struct { // The status of the tenant database. Status *string - // A list of tags. For more information, see [Tagging Amazon RDS Resources] in the Amazon RDS User Guide. + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. // - // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html TagList []Tag // The database name of the tenant database. diff --git a/service/sagemaker/deserializers.go b/service/sagemaker/deserializers.go index b14dcf5f623..4a47a8561cd 100644 --- a/service/sagemaker/deserializers.go +++ b/service/sagemaker/deserializers.go @@ -36703,6 +36703,42 @@ func awsAwsjson11_deserializeDocumentAssociationSummary(v **types.AssociationSum return nil } +func awsAwsjson11_deserializeDocumentAssumableRoleArns(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentAsyncInferenceClientConfig(v **types.AsyncInferenceClientConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -47718,6 +47754,47 @@ func awsAwsjson11_deserializeDocumentEFSFileSystemConfig(v **types.EFSFileSystem return nil } +func awsAwsjson11_deserializeDocumentEmrSettings(v **types.EmrSettings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EmrSettings + if *v == nil { + sv = &types.EmrSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AssumableRoleArns": + if err := awsAwsjson11_deserializeDocumentAssumableRoleArns(&sv.AssumableRoleArns, value); err != nil { + return err + } + + case "ExecutionRoleArns": + if err := awsAwsjson11_deserializeDocumentExecutionRoleArns(&sv.ExecutionRoleArns, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentEMRStepMetadata(v **types.EMRStepMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -48845,6 +48922,42 @@ func awsAwsjson11_deserializeDocumentEnvironmentParameters(v *[]types.Environmen return nil } +func awsAwsjson11_deserializeDocumentExecutionRoleArns(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentExperiment(v **types.Experiment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -56099,6 +56212,11 @@ func awsAwsjson11_deserializeDocumentJupyterLabAppSettings(v **types.JupyterLabA return err } + case "EmrSettings": + if err := awsAwsjson11_deserializeDocumentEmrSettings(&sv.EmrSettings, value); err != nil { + return err + } + case "LifecycleConfigArns": if err := awsAwsjson11_deserializeDocumentLifecycleConfigArns(&sv.LifecycleConfigArns, value); err != nil { return err diff --git a/service/sagemaker/serializers.go b/service/sagemaker/serializers.go index 5aed8d05b0b..b60b69f0530 100644 --- a/service/sagemaker/serializers.go +++ b/service/sagemaker/serializers.go @@ -18857,6 +18857,17 @@ func awsAwsjson11_serializeDocumentArtifactSourceTypes(v []types.ArtifactSourceT return nil } +func awsAwsjson11_serializeDocumentAssumableRoleArns(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentAsyncInferenceClientConfig(v *types.AsyncInferenceClientConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -21873,6 +21884,27 @@ func awsAwsjson11_serializeDocumentEFSFileSystemConfig(v *types.EFSFileSystemCon return nil } +func awsAwsjson11_serializeDocumentEmrSettings(v *types.EmrSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssumableRoleArns != nil { + ok := object.Key("AssumableRoleArns") + if err := awsAwsjson11_serializeDocumentAssumableRoleArns(v.AssumableRoleArns, ok); err != nil { + return err + } + } + + if v.ExecutionRoleArns != nil { + ok := object.Key("ExecutionRoleArns") + if err := awsAwsjson11_serializeDocumentExecutionRoleArns(v.ExecutionRoleArns, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentEndpointInfo(v *types.EndpointInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -22042,6 +22074,17 @@ func awsAwsjson11_serializeDocumentEnvironmentParameterRanges(v *types.Environme return nil } +func awsAwsjson11_serializeDocumentExecutionRoleArns(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentExperimentConfig(v *types.ExperimentConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -23726,6 +23769,13 @@ func awsAwsjson11_serializeDocumentJupyterLabAppSettings(v *types.JupyterLabAppS } } + if v.EmrSettings != nil { + ok := object.Key("EmrSettings") + if err := awsAwsjson11_serializeDocumentEmrSettings(v.EmrSettings, ok); err != nil { + return err + } + } + if v.LifecycleConfigArns != nil { ok := object.Key("LifecycleConfigArns") if err := awsAwsjson11_serializeDocumentLifecycleConfigArns(v.LifecycleConfigArns, ok); err != nil { diff --git a/service/sagemaker/types/types.go b/service/sagemaker/types/types.go index aae94cb7fce..515e68dcc21 100644 --- a/service/sagemaker/types/types.go +++ b/service/sagemaker/types/types.go @@ -5255,6 +5255,35 @@ type EFSFileSystemConfig struct { noSmithyDocumentSerde } +// The configuration parameters that specify the IAM roles assumed by the +// execution role of SageMaker (assumable roles) and the cluster instances or job +// execution environments (execution roles or runtime roles) to manage and access +// resources required for running Amazon EMR clusters or Amazon EMR Serverless +// applications. +type EmrSettings struct { + + // An array of Amazon Resource Names (ARNs) of the IAM roles that the execution + // role of SageMaker can assume for performing operations or tasks related to + // Amazon EMR clusters or Amazon EMR Serverless applications. These roles define + // the permissions and access policies required when performing Amazon EMR-related + // operations, such as listing, connecting to, or terminating Amazon EMR clusters + // or Amazon EMR Serverless applications. They are typically used in cross-account + // access scenarios, where the Amazon EMR resources (clusters or serverless + // applications) are located in a different Amazon Web Services account than the + // SageMaker domain. + AssumableRoleArns []string + + // An array of Amazon Resource Names (ARNs) of the IAM roles used by the Amazon + // EMR cluster instances or job execution environments to access other Amazon Web + // Services services and resources needed during the runtime of your Amazon EMR or + // Amazon EMR Serverless workloads, such as Amazon S3 for data access, Amazon + // CloudWatch for logging, or other Amazon Web Services services based on the + // particular workload requirements. + ExecutionRoleArns []string + + noSmithyDocumentSerde +} + // The configurations and outcomes of an Amazon EMR step execution. type EMRStepMetadata struct { @@ -9416,6 +9445,13 @@ type JupyterLabAppSettings struct { // instance type that the version runs on. DefaultResourceSpec *ResourceSpec + // The configuration parameters that specify the IAM roles assumed by the + // execution role of SageMaker (assumable roles) and the cluster instances or job + // execution environments (execution roles or runtime roles) to manage and access + // resources required for running Amazon EMR clusters or Amazon EMR Serverless + // applications. + EmrSettings *EmrSettings + // The Amazon Resource Name (ARN) of the lifecycle configurations attached to the // user profile or domain. To remove a lifecycle config, you must set // LifecycleConfigArns to an empty list. diff --git a/service/ssmquicksetup/LICENSE.txt b/service/ssmquicksetup/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/ssmquicksetup/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/ssmquicksetup/api_client.go b/service/ssmquicksetup/api_client.go new file mode 100644 index 00000000000..114551c736c --- /dev/null +++ b/service/ssmquicksetup/api_client.go @@ -0,0 +1,628 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "SSM QuickSetup" +const ServiceAPIVersion = "2018-05-10" + +// Client provides the API client to make operations call for AWS Systems Manager +// QuickSetup. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + AccountIDEndpointMode: cfg.AccountIDEndpointMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ssmquicksetup", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func checkAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) error { + switch mode { + case aws.AccountIDEndpointModeUnset: + case aws.AccountIDEndpointModePreferred: + case aws.AccountIDEndpointModeDisabled: + case aws.AccountIDEndpointModeRequired: + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); !ok { + return fmt.Errorf("accountID is required but not set") + } else if ca.Credentials.AccountID == "" { + return fmt.Errorf("accountID is required but not set") + } + // default check in case invalid mode is configured through request config + default: + return fmt.Errorf("invalid accountID endpoint mode %s, must be preferred/required/disabled", mode) + } + + return nil +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/service/ssmquicksetup/api_client_test.go b/service/ssmquicksetup/api_client_test.go new file mode 100644 index 00000000000..e4f287ed1a4 --- /dev/null +++ b/service/ssmquicksetup/api_client_test.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }, func(o *Options) { + if o.Retryer == nil { + t.Errorf("retryer must not be nil in functional options") + } + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/ssmquicksetup/api_op_CreateConfigurationManager.go b/service/ssmquicksetup/api_op_CreateConfigurationManager.go new file mode 100644 index 00000000000..de735851548 --- /dev/null +++ b/service/ssmquicksetup/api_op_CreateConfigurationManager.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a Quick Setup configuration manager resource. This object is a +// collection of desired state configurations for multiple configuration +// definitions and summaries describing the deployments of those definitions. +func (c *Client) CreateConfigurationManager(ctx context.Context, params *CreateConfigurationManagerInput, optFns ...func(*Options)) (*CreateConfigurationManagerOutput, error) { + if params == nil { + params = &CreateConfigurationManagerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateConfigurationManager", params, optFns, c.addOperationCreateConfigurationManagerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateConfigurationManagerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateConfigurationManagerInput struct { + + // The definition of the Quick Setup configuration that the configuration manager + // deploys. + // + // This member is required. + ConfigurationDefinitions []types.ConfigurationDefinitionInput + + // A description of the configuration manager. + Description *string + + // A name for the configuration manager. + Name *string + + // Key-value pairs of metadata to assign to the configuration manager. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateConfigurationManagerOutput struct { + + // The ARN for the newly created configuration manager. + // + // This member is required. + ManagerArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateConfigurationManagerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateConfigurationManager{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateConfigurationManager{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateConfigurationManager"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateConfigurationManagerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateConfigurationManager(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateConfigurationManager(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateConfigurationManager", + } +} diff --git a/service/ssmquicksetup/api_op_DeleteConfigurationManager.go b/service/ssmquicksetup/api_op_DeleteConfigurationManager.go new file mode 100644 index 00000000000..ef06f7f1df6 --- /dev/null +++ b/service/ssmquicksetup/api_op_DeleteConfigurationManager.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a configuration manager. +func (c *Client) DeleteConfigurationManager(ctx context.Context, params *DeleteConfigurationManagerInput, optFns ...func(*Options)) (*DeleteConfigurationManagerOutput, error) { + if params == nil { + params = &DeleteConfigurationManagerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteConfigurationManager", params, optFns, c.addOperationDeleteConfigurationManagerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteConfigurationManagerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteConfigurationManagerInput struct { + + // The ID of the configuration manager. + // + // This member is required. + ManagerArn *string + + noSmithyDocumentSerde +} + +type DeleteConfigurationManagerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteConfigurationManagerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteConfigurationManager{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteConfigurationManager{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteConfigurationManager"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteConfigurationManagerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteConfigurationManager(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteConfigurationManager(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteConfigurationManager", + } +} diff --git a/service/ssmquicksetup/api_op_GetConfigurationManager.go b/service/ssmquicksetup/api_op_GetConfigurationManager.go new file mode 100644 index 00000000000..60584ce07de --- /dev/null +++ b/service/ssmquicksetup/api_op_GetConfigurationManager.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns a configuration manager. +func (c *Client) GetConfigurationManager(ctx context.Context, params *GetConfigurationManagerInput, optFns ...func(*Options)) (*GetConfigurationManagerOutput, error) { + if params == nil { + params = &GetConfigurationManagerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetConfigurationManager", params, optFns, c.addOperationGetConfigurationManagerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetConfigurationManagerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetConfigurationManagerInput struct { + + // The ARN of the configuration manager. + // + // This member is required. + ManagerArn *string + + noSmithyDocumentSerde +} + +type GetConfigurationManagerOutput struct { + + // The ARN of the configuration manager. + // + // This member is required. + ManagerArn *string + + // The configuration definitions association with the configuration manager. + ConfigurationDefinitions []types.ConfigurationDefinition + + // The datetime stamp when the configuration manager was created. + CreatedAt *time.Time + + // The description of the configuration manager. + Description *string + + // The datetime stamp when the configuration manager was last updated. + LastModifiedAt *time.Time + + // The name of the configuration manager. + Name *string + + // A summary of the state of the configuration manager. This includes deployment + // statuses, association statuses, drift statuses, health checks, and more. + StatusSummaries []types.StatusSummary + + // Key-value pairs of metadata to assign to the configuration manager. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetConfigurationManagerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetConfigurationManager{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetConfigurationManager{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetConfigurationManager"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetConfigurationManagerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetConfigurationManager(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetConfigurationManager(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetConfigurationManager", + } +} diff --git a/service/ssmquicksetup/api_op_GetServiceSettings.go b/service/ssmquicksetup/api_op_GetServiceSettings.go new file mode 100644 index 00000000000..b861f3826f1 --- /dev/null +++ b/service/ssmquicksetup/api_op_GetServiceSettings.go @@ -0,0 +1,135 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns settings configured for Quick Setup in the requesting Amazon Web +// Services account and Amazon Web Services Region. +func (c *Client) GetServiceSettings(ctx context.Context, params *GetServiceSettingsInput, optFns ...func(*Options)) (*GetServiceSettingsOutput, error) { + if params == nil { + params = &GetServiceSettingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetServiceSettings", params, optFns, c.addOperationGetServiceSettingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetServiceSettingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetServiceSettingsInput struct { + noSmithyDocumentSerde +} + +type GetServiceSettingsOutput struct { + + // Returns details about the settings for Quick Setup in the requesting Amazon Web + // Services account and Amazon Web Services Region. + ServiceSettings *types.ServiceSettings + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetServiceSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetServiceSettings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetServiceSettings{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetServiceSettings"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetServiceSettings(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetServiceSettings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetServiceSettings", + } +} diff --git a/service/ssmquicksetup/api_op_ListConfigurationManagers.go b/service/ssmquicksetup/api_op_ListConfigurationManagers.go new file mode 100644 index 00000000000..a4536344dd3 --- /dev/null +++ b/service/ssmquicksetup/api_op_ListConfigurationManagers.go @@ -0,0 +1,247 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns Quick Setup configuration managers. +func (c *Client) ListConfigurationManagers(ctx context.Context, params *ListConfigurationManagersInput, optFns ...func(*Options)) (*ListConfigurationManagersOutput, error) { + if params == nil { + params = &ListConfigurationManagersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListConfigurationManagers", params, optFns, c.addOperationListConfigurationManagersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListConfigurationManagersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListConfigurationManagersInput struct { + + // Filters the results returned by the request. + Filters []types.Filter + + // Specifies the maximum number of configuration managers that are returned by the + // request. + MaxItems *int32 + + // The token to use when requesting a specific set of items from a list. + StartingToken *string + + noSmithyDocumentSerde +} + +type ListConfigurationManagersOutput struct { + + // The configuration managers returned by the request. + ConfigurationManagersList []types.ConfigurationManagerSummary + + // The token to use when requesting the next set of configuration managers. If + // there are no additional operations to return, the string is empty. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListConfigurationManagersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListConfigurationManagers{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListConfigurationManagers{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListConfigurationManagers"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListConfigurationManagersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListConfigurationManagers(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListConfigurationManagersPaginatorOptions is the paginator options for +// ListConfigurationManagers +type ListConfigurationManagersPaginatorOptions struct { + // Specifies the maximum number of configuration managers that are returned by the + // request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListConfigurationManagersPaginator is a paginator for ListConfigurationManagers +type ListConfigurationManagersPaginator struct { + options ListConfigurationManagersPaginatorOptions + client ListConfigurationManagersAPIClient + params *ListConfigurationManagersInput + nextToken *string + firstPage bool +} + +// NewListConfigurationManagersPaginator returns a new +// ListConfigurationManagersPaginator +func NewListConfigurationManagersPaginator(client ListConfigurationManagersAPIClient, params *ListConfigurationManagersInput, optFns ...func(*ListConfigurationManagersPaginatorOptions)) *ListConfigurationManagersPaginator { + if params == nil { + params = &ListConfigurationManagersInput{} + } + + options := ListConfigurationManagersPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListConfigurationManagersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.StartingToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationManagersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListConfigurationManagers page. +func (p *ListConfigurationManagersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationManagersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.StartingToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListConfigurationManagers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListConfigurationManagersAPIClient is a client that implements the +// ListConfigurationManagers operation. +type ListConfigurationManagersAPIClient interface { + ListConfigurationManagers(context.Context, *ListConfigurationManagersInput, ...func(*Options)) (*ListConfigurationManagersOutput, error) +} + +var _ ListConfigurationManagersAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListConfigurationManagers(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListConfigurationManagers", + } +} diff --git a/service/ssmquicksetup/api_op_ListQuickSetupTypes.go b/service/ssmquicksetup/api_op_ListQuickSetupTypes.go new file mode 100644 index 00000000000..e197d4a8ea4 --- /dev/null +++ b/service/ssmquicksetup/api_op_ListQuickSetupTypes.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the available Quick Setup types. +func (c *Client) ListQuickSetupTypes(ctx context.Context, params *ListQuickSetupTypesInput, optFns ...func(*Options)) (*ListQuickSetupTypesOutput, error) { + if params == nil { + params = &ListQuickSetupTypesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListQuickSetupTypes", params, optFns, c.addOperationListQuickSetupTypesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListQuickSetupTypesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListQuickSetupTypesInput struct { + noSmithyDocumentSerde +} + +type ListQuickSetupTypesOutput struct { + + // An array of Quick Setup types. + QuickSetupTypeList []types.QuickSetupTypeOutput + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListQuickSetupTypesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListQuickSetupTypes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListQuickSetupTypes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListQuickSetupTypes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListQuickSetupTypes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListQuickSetupTypes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListQuickSetupTypes", + } +} diff --git a/service/ssmquicksetup/api_op_ListTagsForResource.go b/service/ssmquicksetup/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..ca0b25526dd --- /dev/null +++ b/service/ssmquicksetup/api_op_ListTagsForResource.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns tags assigned to the resource. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The ARN of the resource the tag is assigned to. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // Key-value pairs of metadata assigned to the resource. + Tags []types.TagEntry + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTagsForResource", + } +} diff --git a/service/ssmquicksetup/api_op_TagResource.go b/service/ssmquicksetup/api_op_TagResource.go new file mode 100644 index 00000000000..d9ed473febd --- /dev/null +++ b/service/ssmquicksetup/api_op_TagResource.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Assigns key-value pairs of metadata to Amazon Web Services resources. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The ARN of the resource to tag. + // + // This member is required. + ResourceArn *string + + // Key-value pairs of metadata to assign to the resource. + // + // This member is required. + Tags map[string]string + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TagResource", + } +} diff --git a/service/ssmquicksetup/api_op_UntagResource.go b/service/ssmquicksetup/api_op_UntagResource.go new file mode 100644 index 00000000000..0c84bf696f0 --- /dev/null +++ b/service/ssmquicksetup/api_op_UntagResource.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes tags from the specified resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The ARN of the resource to remove tags from. + // + // This member is required. + ResourceArn *string + + // The keys of the tags to remove from the resource. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UntagResource", + } +} diff --git a/service/ssmquicksetup/api_op_UpdateConfigurationDefinition.go b/service/ssmquicksetup/api_op_UpdateConfigurationDefinition.go new file mode 100644 index 00000000000..b792a09ee1b --- /dev/null +++ b/service/ssmquicksetup/api_op_UpdateConfigurationDefinition.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a Quick Setup configuration definition. +func (c *Client) UpdateConfigurationDefinition(ctx context.Context, params *UpdateConfigurationDefinitionInput, optFns ...func(*Options)) (*UpdateConfigurationDefinitionOutput, error) { + if params == nil { + params = &UpdateConfigurationDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateConfigurationDefinition", params, optFns, c.addOperationUpdateConfigurationDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateConfigurationDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateConfigurationDefinitionInput struct { + + // The ID of the configuration definition you want to update. + // + // This member is required. + Id *string + + // The ARN of the configuration manager associated with the definition to update. + // + // This member is required. + ManagerArn *string + + // The ARN of the IAM role used to administrate local configuration deployments. + LocalDeploymentAdministrationRoleArn *string + + // The name of the IAM role used to deploy local configurations. + LocalDeploymentExecutionRoleName *string + + // The parameters for the configuration definition type. + Parameters map[string]string + + // The version of the Quick Setup type to use. + TypeVersion *string + + noSmithyDocumentSerde +} + +type UpdateConfigurationDefinitionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateConfigurationDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateConfigurationDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateConfigurationDefinition{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateConfigurationDefinition"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateConfigurationDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConfigurationDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateConfigurationDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateConfigurationDefinition", + } +} diff --git a/service/ssmquicksetup/api_op_UpdateConfigurationManager.go b/service/ssmquicksetup/api_op_UpdateConfigurationManager.go new file mode 100644 index 00000000000..e2fb1854862 --- /dev/null +++ b/service/ssmquicksetup/api_op_UpdateConfigurationManager.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a Quick Setup configuration manager. +func (c *Client) UpdateConfigurationManager(ctx context.Context, params *UpdateConfigurationManagerInput, optFns ...func(*Options)) (*UpdateConfigurationManagerOutput, error) { + if params == nil { + params = &UpdateConfigurationManagerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateConfigurationManager", params, optFns, c.addOperationUpdateConfigurationManagerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateConfigurationManagerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateConfigurationManagerInput struct { + + // The ARN of the configuration manager. + // + // This member is required. + ManagerArn *string + + // A description of the configuration manager. + Description *string + + // A name for the configuration manager. + Name *string + + noSmithyDocumentSerde +} + +type UpdateConfigurationManagerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateConfigurationManagerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateConfigurationManager{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateConfigurationManager{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateConfigurationManager"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateConfigurationManagerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConfigurationManager(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateConfigurationManager(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateConfigurationManager", + } +} diff --git a/service/ssmquicksetup/api_op_UpdateServiceSettings.go b/service/ssmquicksetup/api_op_UpdateServiceSettings.go new file mode 100644 index 00000000000..6299bfb7900 --- /dev/null +++ b/service/ssmquicksetup/api_op_UpdateServiceSettings.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates settings configured for Quick Setup. +func (c *Client) UpdateServiceSettings(ctx context.Context, params *UpdateServiceSettingsInput, optFns ...func(*Options)) (*UpdateServiceSettingsOutput, error) { + if params == nil { + params = &UpdateServiceSettingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateServiceSettings", params, optFns, c.addOperationUpdateServiceSettingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateServiceSettingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateServiceSettingsInput struct { + + // The IAM role used to enable Explorer. + ExplorerEnablingRoleArn *string + + noSmithyDocumentSerde +} + +type UpdateServiceSettingsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateServiceSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateServiceSettings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateServiceSettings{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateServiceSettings"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateServiceSettings(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateServiceSettings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateServiceSettings", + } +} diff --git a/service/ssmquicksetup/auth.go b/service/ssmquicksetup/auth.go new file mode 100644 index 00000000000..4c86ebe819a --- /dev/null +++ b/service/ssmquicksetup/auth.go @@ -0,0 +1,284 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "ssm-quicksetup") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/service/ssmquicksetup/deserializers.go b/service/ssmquicksetup/deserializers.go new file mode 100644 index 00000000000..d9355e6001e --- /dev/null +++ b/service/ssmquicksetup/deserializers.go @@ -0,0 +1,2875 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "io/ioutil" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsRestjson1_deserializeOpCreateConfigurationManager struct { +} + +func (*awsRestjson1_deserializeOpCreateConfigurationManager) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateConfigurationManager) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateConfigurationManager(response, &metadata) + } + output := &CreateConfigurationManagerOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCreateConfigurationManagerOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateConfigurationManager(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateConfigurationManagerOutput(v **CreateConfigurationManagerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateConfigurationManagerOutput + if *v == nil { + sv = &CreateConfigurationManagerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ManagerArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ManagerArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteConfigurationManager struct { +} + +func (*awsRestjson1_deserializeOpDeleteConfigurationManager) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteConfigurationManager) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteConfigurationManager(response, &metadata) + } + output := &DeleteConfigurationManagerOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteConfigurationManager(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetConfigurationManager struct { +} + +func (*awsRestjson1_deserializeOpGetConfigurationManager) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetConfigurationManager) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetConfigurationManager(response, &metadata) + } + output := &GetConfigurationManagerOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetConfigurationManagerOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetConfigurationManager(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetConfigurationManagerOutput(v **GetConfigurationManagerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetConfigurationManagerOutput + if *v == nil { + sv = &GetConfigurationManagerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConfigurationDefinitions": + if err := awsRestjson1_deserializeDocumentConfigurationDefinitionsList(&sv.ConfigurationDefinitions, value); err != nil { + return err + } + + case "CreatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "LastModifiedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModifiedAt = ptr.Time(t) + } + + case "ManagerArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ManagerArn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "StatusSummaries": + if err := awsRestjson1_deserializeDocumentStatusSummariesList(&sv.StatusSummaries, value); err != nil { + return err + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetServiceSettings struct { +} + +func (*awsRestjson1_deserializeOpGetServiceSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetServiceSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetServiceSettings(response, &metadata) + } + output := &GetServiceSettingsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetServiceSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(v **GetServiceSettingsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetServiceSettingsOutput + if *v == nil { + sv = &GetServiceSettingsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ServiceSettings": + if err := awsRestjson1_deserializeDocumentServiceSettings(&sv.ServiceSettings, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListConfigurationManagers struct { +} + +func (*awsRestjson1_deserializeOpListConfigurationManagers) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListConfigurationManagers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListConfigurationManagers(response, &metadata) + } + output := &ListConfigurationManagersOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListConfigurationManagersOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListConfigurationManagers(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListConfigurationManagersOutput(v **ListConfigurationManagersOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListConfigurationManagersOutput + if *v == nil { + sv = &ListConfigurationManagersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConfigurationManagersList": + if err := awsRestjson1_deserializeDocumentConfigurationManagerList(&sv.ConfigurationManagersList, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListQuickSetupTypes struct { +} + +func (*awsRestjson1_deserializeOpListQuickSetupTypes) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListQuickSetupTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListQuickSetupTypes(response, &metadata) + } + output := &ListQuickSetupTypesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListQuickSetupTypesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListQuickSetupTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListQuickSetupTypesOutput(v **ListQuickSetupTypesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListQuickSetupTypesOutput + if *v == nil { + sv = &ListQuickSetupTypesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "QuickSetupTypeList": + if err := awsRestjson1_deserializeDocumentQuickSetupTypeList(&sv.QuickSetupTypeList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateConfigurationDefinition struct { +} + +func (*awsRestjson1_deserializeOpUpdateConfigurationDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateConfigurationDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateConfigurationDefinition(response, &metadata) + } + output := &UpdateConfigurationDefinitionOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateConfigurationDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateConfigurationManager struct { +} + +func (*awsRestjson1_deserializeOpUpdateConfigurationManager) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateConfigurationManager) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateConfigurationManager(response, &metadata) + } + output := &UpdateConfigurationManagerOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateConfigurationManager(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateServiceSettings struct { +} + +func (*awsRestjson1_deserializeOpUpdateServiceSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateServiceSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateServiceSettings(response, &metadata) + } + output := &UpdateServiceSettingsOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateServiceSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConfigurationDefinition(v **types.ConfigurationDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConfigurationDefinition + if *v == nil { + sv = &types.ConfigurationDefinition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LocalDeploymentAdministrationRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IAMRoleArn to be of type string, got %T instead", value) + } + sv.LocalDeploymentAdministrationRoleArn = ptr.String(jtv) + } + + case "LocalDeploymentExecutionRoleName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.LocalDeploymentExecutionRoleName = ptr.String(jtv) + } + + case "Parameters": + if err := awsRestjson1_deserializeDocumentConfigurationParametersMap(&sv.Parameters, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "TypeVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TypeVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConfigurationDefinitionsList(v *[]types.ConfigurationDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ConfigurationDefinition + if *v == nil { + cv = []types.ConfigurationDefinition{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ConfigurationDefinition + destAddr := &col + if err := awsRestjson1_deserializeDocumentConfigurationDefinition(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentConfigurationDefinitionSummariesList(v *[]types.ConfigurationDefinitionSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ConfigurationDefinitionSummary + if *v == nil { + cv = []types.ConfigurationDefinitionSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ConfigurationDefinitionSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentConfigurationDefinitionSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentConfigurationDefinitionSummary(v **types.ConfigurationDefinitionSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConfigurationDefinitionSummary + if *v == nil { + sv = &types.ConfigurationDefinitionSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FirstClassParameters": + if err := awsRestjson1_deserializeDocumentConfigurationParametersMap(&sv.FirstClassParameters, value); err != nil { + return err + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "TypeVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TypeVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConfigurationManagerList(v *[]types.ConfigurationManagerSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ConfigurationManagerSummary + if *v == nil { + cv = []types.ConfigurationManagerSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ConfigurationManagerSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentConfigurationManagerSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentConfigurationManagerSummary(v **types.ConfigurationManagerSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConfigurationManagerSummary + if *v == nil { + sv = &types.ConfigurationManagerSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConfigurationDefinitionSummaries": + if err := awsRestjson1_deserializeDocumentConfigurationDefinitionSummariesList(&sv.ConfigurationDefinitionSummaries, value); err != nil { + return err + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "ManagerArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ManagerArn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "StatusSummaries": + if err := awsRestjson1_deserializeDocumentStatusSummariesList(&sv.StatusSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConfigurationParametersMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQuickSetupTypeList(v *[]types.QuickSetupTypeOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.QuickSetupTypeOutput + if *v == nil { + cv = []types.QuickSetupTypeOutput{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.QuickSetupTypeOutput + destAddr := &col + if err := awsRestjson1_deserializeDocumentQuickSetupTypeOutput(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentQuickSetupTypeOutput(v **types.QuickSetupTypeOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.QuickSetupTypeOutput + if *v == nil { + sv = &types.QuickSetupTypeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LatestVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.LatestVersion = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceSettings(v **types.ServiceSettings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceSettings + if *v == nil { + sv = &types.ServiceSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExplorerEnablingRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IAMRoleArn to be of type string, got %T instead", value) + } + sv.ExplorerEnablingRoleArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentStatusDetails(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentStatusSummariesList(v *[]types.StatusSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.StatusSummary + if *v == nil { + cv = []types.StatusSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.StatusSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentStatusSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentStatusSummary(v **types.StatusSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.StatusSummary + if *v == nil { + sv = &types.StatusSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Status to be of type string, got %T instead", value) + } + sv.Status = types.Status(jtv) + } + + case "StatusDetails": + if err := awsRestjson1_deserializeDocumentStatusDetails(&sv.StatusDetails, value); err != nil { + return err + } + + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + case "StatusType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusType to be of type string, got %T instead", value) + } + sv.StatusType = types.StatusType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTagEntry(v **types.TagEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TagEntry + if *v == nil { + sv = &types.TagEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTags(v *[]types.TagEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.TagEntry + if *v == nil { + cv = []types.TagEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TagEntry + destAddr := &col + if err := awsRestjson1_deserializeDocumentTagEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTagsMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/ssmquicksetup/doc.go b/service/ssmquicksetup/doc.go new file mode 100644 index 00000000000..d1e775754fe --- /dev/null +++ b/service/ssmquicksetup/doc.go @@ -0,0 +1,9 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package ssmquicksetup provides the API client, operations, and parameter types +// for AWS Systems Manager QuickSetup. +// +// Quick Setup helps you quickly configure frequently used services and features +// with recommended best practices. Quick Setup simplifies setting up services, +// including Systems Manager, by automating common or recommended tasks. +package ssmquicksetup diff --git a/service/ssmquicksetup/endpoints.go b/service/ssmquicksetup/endpoints.go new file mode 100644 index 00000000000..a1d97fe825a --- /dev/null +++ b/service/ssmquicksetup/endpoints.go @@ -0,0 +1,531 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "ssm-quicksetup" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_SSM_QUICKSETUP") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSM QuickSetup", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://ssm-quicksetup-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://ssm-quicksetup-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://ssm-quicksetup.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://ssm-quicksetup.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = bindRegion(options.Region) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + if err := checkAccountID(getIdentity(ctx), m.options.AccountIDEndpointMode); err != nil { + return out, metadata, fmt.Errorf("invalid accountID set: %w", err) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/service/ssmquicksetup/endpoints_config_test.go b/service/ssmquicksetup/endpoints_config_test.go new file mode 100644 index 00000000000..954f0a14874 --- /dev/null +++ b/service/ssmquicksetup/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "os" + "reflect" + "testing" +) + +type mockConfigSource struct { + global string + service string + ignore bool +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + return m.ignore, m.ignore, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if m.service != "" { + return m.service, true, nil + } + return "", false, nil +} + +func TestResolveBaseEndpoint(t *testing.T) { + cases := map[string]struct { + envGlobal string + envService string + envIgnore bool + configGlobal string + configService string + configIgnore bool + clientEndpoint *string + expectURL *string + }{ + "env ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-ssm-quicksetup.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-ssm-quicksetup.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-ssm-quicksetup.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-ssm-quicksetup.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-ssm-quicksetup.dev", + expectURL: aws.String("https://env-ssm-quicksetup.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-ssm-quicksetup.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-ssm-quicksetup.dev", + configIgnore: true, + expectURL: nil, + }, + "config global": { + configGlobal: "http://config-global.dev", + expectURL: aws.String("http://config-global.dev"), + }, + "config service": { + configGlobal: "http://config-global.dev", + configService: "http://config-ssm-quicksetup.dev", + expectURL: aws.String("http://config-ssm-quicksetup.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-ssm-quicksetup.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-ssm-quicksetup.dev", + clientEndpoint: aws.String("https://client-ssm-quicksetup.dev"), + expectURL: aws.String("https://client-ssm-quicksetup.dev"), + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + os.Clearenv() + + awsConfig := aws.Config{} + ignore := c.envIgnore || c.configIgnore + + if c.configGlobal != "" && !ignore { + awsConfig.BaseEndpoint = aws.String(c.configGlobal) + } + + if c.envGlobal != "" { + t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) + if !ignore { + awsConfig.BaseEndpoint = aws.String(c.envGlobal) + } + } + + if c.envService != "" { + t.Setenv("AWS_ENDPOINT_URL_SSM_QUICKSETUP", c.envService) + } + + awsConfig.ConfigSources = []interface{}{ + mockConfigSource{ + global: c.envGlobal, + service: c.envService, + ignore: c.envIgnore, + }, + mockConfigSource{ + global: c.configGlobal, + service: c.configService, + ignore: c.configIgnore, + }, + } + + client := NewFromConfig(awsConfig, func(o *Options) { + if c.clientEndpoint != nil { + o.BaseEndpoint = c.clientEndpoint + } + }) + + if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { + t.Errorf("expect endpoint %v , got %v", e, a) + } + }) + } +} diff --git a/service/ssmquicksetup/endpoints_test.go b/service/ssmquicksetup/endpoints_test.go new file mode 100644 index 00000000000..2d2208ba415 --- /dev/null +++ b/service/ssmquicksetup/endpoints_test.go @@ -0,0 +1,820 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + "net/http" + "net/url" + "reflect" + "strings" + "testing" +) + +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup-fips.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup-fips.us-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup.us-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack enabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup-fips.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack disabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup-fips.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack enabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack disabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup-fips.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup-fips.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase11(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase12(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup-fips.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase15(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase16(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase17(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup-fips.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase18(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase19(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://ssm-quicksetup.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with region set and fips disabled and dualstack disabled +func TestEndpointCase20(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with region not set and fips disabled and dualstack disabled +func TestEndpointCase21(t *testing.T) { + var params = EndpointParameters{ + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with fips enabled and dualstack disabled +func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For custom endpoint with fips disabled and dualstack enabled +func TestEndpointCase23(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Missing region +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/ssmquicksetup/generated.json b/service/ssmquicksetup/generated.json new file mode 100644 index 00000000000..66961a82454 --- /dev/null +++ b/service/ssmquicksetup/generated.json @@ -0,0 +1,44 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_CreateConfigurationManager.go", + "api_op_DeleteConfigurationManager.go", + "api_op_GetConfigurationManager.go", + "api_op_GetServiceSettings.go", + "api_op_ListConfigurationManagers.go", + "api_op_ListQuickSetupTypes.go", + "api_op_ListTagsForResource.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateConfigurationDefinition.go", + "api_op_UpdateConfigurationManager.go", + "api_op_UpdateServiceSettings.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup", + "unstable": false +} diff --git a/service/ssmquicksetup/go.mod b/service/ssmquicksetup/go.mod new file mode 100644 index 00000000000..39a472826cb --- /dev/null +++ b/service/ssmquicksetup/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/ssmquicksetup + +go 1.20 + +require ( + github.com/aws/aws-sdk-go-v2 v1.30.3 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 + github.com/aws/smithy-go v1.20.3 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/ssmquicksetup/go.sum b/service/ssmquicksetup/go.sum new file mode 100644 index 00000000000..07970476de0 --- /dev/null +++ b/service/ssmquicksetup/go.sum @@ -0,0 +1,2 @@ +github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= +github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= diff --git a/service/ssmquicksetup/go_module_metadata.go b/service/ssmquicksetup/go_module_metadata.go new file mode 100644 index 00000000000..f786b99a3a8 --- /dev/null +++ b/service/ssmquicksetup/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package ssmquicksetup + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/ssmquicksetup/internal/endpoints/endpoints.go b/service/ssmquicksetup/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..68145ae4b23 --- /dev/null +++ b/service/ssmquicksetup/internal/endpoints/endpoints.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver SSM QuickSetup endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "ssm-quicksetup.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-quicksetup-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "ssm-quicksetup-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm-quicksetup.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "ssm-quicksetup.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-quicksetup-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "ssm-quicksetup-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm-quicksetup.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-quicksetup-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm-quicksetup.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-quicksetup-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm-quicksetup.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-quicksetup-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm-quicksetup.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-quicksetup-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm-quicksetup.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "ssm-quicksetup.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-quicksetup-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "ssm-quicksetup-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm-quicksetup.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/ssmquicksetup/internal/endpoints/endpoints_test.go b/service/ssmquicksetup/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/ssmquicksetup/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/ssmquicksetup/options.go b/service/ssmquicksetup/options.go new file mode 100644 index 00000000000..a2229151928 --- /dev/null +++ b/service/ssmquicksetup/options.go @@ -0,0 +1,227 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // Indicates how aws account ID is applied in endpoint2.0 routing + AccountIDEndpointMode aws.AccountIDEndpointMode + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/service/ssmquicksetup/protocol_test.go b/service/ssmquicksetup/protocol_test.go new file mode 100644 index 00000000000..dd45e791da5 --- /dev/null +++ b/service/ssmquicksetup/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup diff --git a/service/ssmquicksetup/serializers.go b/service/ssmquicksetup/serializers.go new file mode 100644 index 00000000000..757067df6a5 --- /dev/null +++ b/service/ssmquicksetup/serializers.go @@ -0,0 +1,1050 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpCreateConfigurationManager struct { +} + +func (*awsRestjson1_serializeOpCreateConfigurationManager) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateConfigurationManager) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateConfigurationManagerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/configurationManager") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateConfigurationManagerInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateConfigurationManagerInput(v *CreateConfigurationManagerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateConfigurationManagerInput(v *CreateConfigurationManagerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConfigurationDefinitions != nil { + ok := object.Key("ConfigurationDefinitions") + if err := awsRestjson1_serializeDocumentConfigurationDefinitionsInputList(v.ConfigurationDefinitions, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteConfigurationManager struct { +} + +func (*awsRestjson1_serializeOpDeleteConfigurationManager) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteConfigurationManager) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteConfigurationManagerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/configurationManager/{ManagerArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteConfigurationManagerInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteConfigurationManagerInput(v *DeleteConfigurationManagerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ManagerArn == nil || len(*v.ManagerArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ManagerArn must not be empty")} + } + if v.ManagerArn != nil { + if err := encoder.SetURI("ManagerArn").String(*v.ManagerArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetConfigurationManager struct { +} + +func (*awsRestjson1_serializeOpGetConfigurationManager) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetConfigurationManager) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetConfigurationManagerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/configurationManager/{ManagerArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetConfigurationManagerInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetConfigurationManagerInput(v *GetConfigurationManagerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ManagerArn == nil || len(*v.ManagerArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ManagerArn must not be empty")} + } + if v.ManagerArn != nil { + if err := encoder.SetURI("ManagerArn").String(*v.ManagerArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetServiceSettings struct { +} + +func (*awsRestjson1_serializeOpGetServiceSettings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetServiceSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetServiceSettingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/serviceSettings") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetServiceSettingsInput(v *GetServiceSettingsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpListConfigurationManagers struct { +} + +func (*awsRestjson1_serializeOpListConfigurationManagers) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListConfigurationManagers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListConfigurationManagersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/listConfigurationManagers") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListConfigurationManagersInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListConfigurationManagersInput(v *ListConfigurationManagersInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListConfigurationManagersInput(v *ListConfigurationManagersInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsRestjson1_serializeDocumentFiltersList(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxItems != nil { + ok := object.Key("MaxItems") + ok.Integer(*v.MaxItems) + } + + if v.StartingToken != nil { + ok := object.Key("StartingToken") + ok.String(*v.StartingToken) + } + + return nil +} + +type awsRestjson1_serializeOpListQuickSetupTypes struct { +} + +func (*awsRestjson1_serializeOpListQuickSetupTypes) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListQuickSetupTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListQuickSetupTypesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/listQuickSetupTypes") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListQuickSetupTypesInput(v *ListQuickSetupTypesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagsMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateConfigurationDefinition struct { +} + +func (*awsRestjson1_serializeOpUpdateConfigurationDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateConfigurationDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateConfigurationDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/configurationDefinition/{ManagerArn}/{Id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateConfigurationDefinitionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateConfigurationDefinitionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateConfigurationDefinitionInput(v *UpdateConfigurationDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + if v.ManagerArn == nil || len(*v.ManagerArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ManagerArn must not be empty")} + } + if v.ManagerArn != nil { + if err := encoder.SetURI("ManagerArn").String(*v.ManagerArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateConfigurationDefinitionInput(v *UpdateConfigurationDefinitionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LocalDeploymentAdministrationRoleArn != nil { + ok := object.Key("LocalDeploymentAdministrationRoleArn") + ok.String(*v.LocalDeploymentAdministrationRoleArn) + } + + if v.LocalDeploymentExecutionRoleName != nil { + ok := object.Key("LocalDeploymentExecutionRoleName") + ok.String(*v.LocalDeploymentExecutionRoleName) + } + + if v.Parameters != nil { + ok := object.Key("Parameters") + if err := awsRestjson1_serializeDocumentConfigurationParametersMap(v.Parameters, ok); err != nil { + return err + } + } + + if v.TypeVersion != nil { + ok := object.Key("TypeVersion") + ok.String(*v.TypeVersion) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateConfigurationManager struct { +} + +func (*awsRestjson1_serializeOpUpdateConfigurationManager) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateConfigurationManager) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateConfigurationManagerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/configurationManager/{ManagerArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateConfigurationManagerInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateConfigurationManagerInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateConfigurationManagerInput(v *UpdateConfigurationManagerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ManagerArn == nil || len(*v.ManagerArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ManagerArn must not be empty")} + } + if v.ManagerArn != nil { + if err := encoder.SetURI("ManagerArn").String(*v.ManagerArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateConfigurationManagerInput(v *UpdateConfigurationManagerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateServiceSettings struct { +} + +func (*awsRestjson1_serializeOpUpdateServiceSettings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateServiceSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateServiceSettingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/serviceSettings") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateServiceSettingsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateServiceSettingsInput(v *UpdateServiceSettingsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateServiceSettingsInput(v *UpdateServiceSettingsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExplorerEnablingRoleArn != nil { + ok := object.Key("ExplorerEnablingRoleArn") + ok.String(*v.ExplorerEnablingRoleArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentConfigurationDefinitionInput(v *types.ConfigurationDefinitionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LocalDeploymentAdministrationRoleArn != nil { + ok := object.Key("LocalDeploymentAdministrationRoleArn") + ok.String(*v.LocalDeploymentAdministrationRoleArn) + } + + if v.LocalDeploymentExecutionRoleName != nil { + ok := object.Key("LocalDeploymentExecutionRoleName") + ok.String(*v.LocalDeploymentExecutionRoleName) + } + + if v.Parameters != nil { + ok := object.Key("Parameters") + if err := awsRestjson1_serializeDocumentConfigurationParametersMap(v.Parameters, ok); err != nil { + return err + } + } + + if v.Type != nil { + ok := object.Key("Type") + ok.String(*v.Type) + } + + if v.TypeVersion != nil { + ok := object.Key("TypeVersion") + ok.String(*v.TypeVersion) + } + + return nil +} + +func awsRestjson1_serializeDocumentConfigurationDefinitionsInputList(v []types.ConfigurationDefinitionInput, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentConfigurationDefinitionInput(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentConfigurationParametersMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsRestjson1_serializeDocumentFilterValues(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentFiltersList(v []types.Filter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFilterValues(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentTagsMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} diff --git a/service/ssmquicksetup/snapshot/api_op_CreateConfigurationManager.go.snap b/service/ssmquicksetup/snapshot/api_op_CreateConfigurationManager.go.snap new file mode 100644 index 00000000000..1f275f9c768 --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_CreateConfigurationManager.go.snap @@ -0,0 +1,36 @@ +CreateConfigurationManager + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_DeleteConfigurationManager.go.snap b/service/ssmquicksetup/snapshot/api_op_DeleteConfigurationManager.go.snap new file mode 100644 index 00000000000..7fa5ee7fc01 --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_DeleteConfigurationManager.go.snap @@ -0,0 +1,36 @@ +DeleteConfigurationManager + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_GetConfigurationManager.go.snap b/service/ssmquicksetup/snapshot/api_op_GetConfigurationManager.go.snap new file mode 100644 index 00000000000..5df4b825b2e --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_GetConfigurationManager.go.snap @@ -0,0 +1,36 @@ +GetConfigurationManager + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_GetServiceSettings.go.snap b/service/ssmquicksetup/snapshot/api_op_GetServiceSettings.go.snap new file mode 100644 index 00000000000..e39bfcdb2f9 --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_GetServiceSettings.go.snap @@ -0,0 +1,35 @@ +GetServiceSettings + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_ListConfigurationManagers.go.snap b/service/ssmquicksetup/snapshot/api_op_ListConfigurationManagers.go.snap new file mode 100644 index 00000000000..2096ced807c --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_ListConfigurationManagers.go.snap @@ -0,0 +1,36 @@ +ListConfigurationManagers + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_ListQuickSetupTypes.go.snap b/service/ssmquicksetup/snapshot/api_op_ListQuickSetupTypes.go.snap new file mode 100644 index 00000000000..9e03843377a --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_ListQuickSetupTypes.go.snap @@ -0,0 +1,35 @@ +ListQuickSetupTypes + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_ListTagsForResource.go.snap b/service/ssmquicksetup/snapshot/api_op_ListTagsForResource.go.snap new file mode 100644 index 00000000000..2299517d18e --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_ListTagsForResource.go.snap @@ -0,0 +1,36 @@ +ListTagsForResource + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_TagResource.go.snap b/service/ssmquicksetup/snapshot/api_op_TagResource.go.snap new file mode 100644 index 00000000000..7f655ed1036 --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_TagResource.go.snap @@ -0,0 +1,36 @@ +TagResource + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_UntagResource.go.snap b/service/ssmquicksetup/snapshot/api_op_UntagResource.go.snap new file mode 100644 index 00000000000..45a9cb82fde --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_UntagResource.go.snap @@ -0,0 +1,36 @@ +UntagResource + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_UpdateConfigurationDefinition.go.snap b/service/ssmquicksetup/snapshot/api_op_UpdateConfigurationDefinition.go.snap new file mode 100644 index 00000000000..ea29baaa0ef --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_UpdateConfigurationDefinition.go.snap @@ -0,0 +1,36 @@ +UpdateConfigurationDefinition + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_UpdateConfigurationManager.go.snap b/service/ssmquicksetup/snapshot/api_op_UpdateConfigurationManager.go.snap new file mode 100644 index 00000000000..f40f1677f9e --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_UpdateConfigurationManager.go.snap @@ -0,0 +1,36 @@ +UpdateConfigurationManager + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_UpdateServiceSettings.go.snap b/service/ssmquicksetup/snapshot/api_op_UpdateServiceSettings.go.snap new file mode 100644 index 00000000000..528f980116a --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_UpdateServiceSettings.go.snap @@ -0,0 +1,35 @@ +UpdateServiceSettings + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot_test.go b/service/ssmquicksetup/snapshot_test.go new file mode 100644 index 00000000000..410e9697c17 --- /dev/null +++ b/service/ssmquicksetup/snapshot_test.go @@ -0,0 +1,350 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +//go:build snapshot + +package ssmquicksetup + +import ( + "context" + "errors" + "fmt" + "github.com/aws/smithy-go/middleware" + "io" + "io/fs" + "os" + "testing" +) + +const ssprefix = "snapshot" + +type snapshotOK struct{} + +func (snapshotOK) Error() string { return "error: success" } + +func createp(path string) (*os.File, error) { + if err := os.Mkdir(ssprefix, 0700); err != nil && !errors.Is(err, fs.ErrExist) { + return nil, err + } + return os.Create(path) +} + +func sspath(op string) string { + return fmt.Sprintf("%s/api_op_%s.go.snap", ssprefix, op) +} + +func updateSnapshot(stack *middleware.Stack, operation string) error { + f, err := createp(sspath(operation)) + if err != nil { + return err + } + defer f.Close() + if _, err := f.Write([]byte(stack.String())); err != nil { + return err + } + return snapshotOK{} +} + +func testSnapshot(stack *middleware.Stack, operation string) error { + f, err := os.Open(sspath(operation)) + if errors.Is(err, fs.ErrNotExist) { + return snapshotOK{} + } + if err != nil { + return err + } + defer f.Close() + expected, err := io.ReadAll(f) + if err != nil { + return err + } + if actual := stack.String(); actual != string(expected) { + return fmt.Errorf("%s != %s", expected, actual) + } + return snapshotOK{} +} +func TestCheckSnapshot_CreateConfigurationManager(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateConfigurationManager(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateConfigurationManager") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteConfigurationManager(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteConfigurationManager(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteConfigurationManager") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetConfigurationManager(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetConfigurationManager(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetConfigurationManager") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetServiceSettings(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetServiceSettings(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetServiceSettings") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListConfigurationManagers(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListConfigurationManagers(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListConfigurationManagers") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListQuickSetupTypes(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListQuickSetupTypes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListQuickSetupTypes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateConfigurationDefinition(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateConfigurationDefinition(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateConfigurationDefinition") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateConfigurationManager(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateConfigurationManager(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateConfigurationManager") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateServiceSettings(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateServiceSettings(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateServiceSettings") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} +func TestUpdateSnapshot_CreateConfigurationManager(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateConfigurationManager(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateConfigurationManager") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteConfigurationManager(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteConfigurationManager(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteConfigurationManager") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetConfigurationManager(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetConfigurationManager(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetConfigurationManager") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetServiceSettings(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetServiceSettings(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetServiceSettings") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListConfigurationManagers(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListConfigurationManagers(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListConfigurationManagers") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListQuickSetupTypes(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListQuickSetupTypes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListQuickSetupTypes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateConfigurationDefinition(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateConfigurationDefinition(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateConfigurationDefinition") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateConfigurationManager(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateConfigurationManager(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateConfigurationManager") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateServiceSettings(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateServiceSettings(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateServiceSettings") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/ssmquicksetup/types/enums.go b/service/ssmquicksetup/types/enums.go new file mode 100644 index 00000000000..2abb953ffc1 --- /dev/null +++ b/service/ssmquicksetup/types/enums.go @@ -0,0 +1,57 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type Status string + +// Enum values for Status +const ( + StatusInitializing Status = "INITIALIZING" + StatusDeploying Status = "DEPLOYING" + StatusSucceeded Status = "SUCCEEDED" + StatusDeleting Status = "DELETING" + StatusStopping Status = "STOPPING" + StatusFailed Status = "FAILED" + StatusStopped Status = "STOPPED" + StatusDeleteFailed Status = "DELETE_FAILED" + StatusStopFailed Status = "STOP_FAILED" + StatusNone Status = "NONE" +) + +// Values returns all known values for Status. Note that this can be expanded in +// the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (Status) Values() []Status { + return []Status{ + "INITIALIZING", + "DEPLOYING", + "SUCCEEDED", + "DELETING", + "STOPPING", + "FAILED", + "STOPPED", + "DELETE_FAILED", + "STOP_FAILED", + "NONE", + } +} + +type StatusType string + +// Enum values for StatusType +const ( + StatusTypeDeployment StatusType = "Deployment" + StatusTypeAsyncExecutions StatusType = "AsyncExecutions" +) + +// Values returns all known values for StatusType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (StatusType) Values() []StatusType { + return []StatusType{ + "Deployment", + "AsyncExecutions", + } +} diff --git a/service/ssmquicksetup/types/errors.go b/service/ssmquicksetup/types/errors.go new file mode 100644 index 00000000000..6b7f63e6338 --- /dev/null +++ b/service/ssmquicksetup/types/errors.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The requester has insufficient permissions to perform the operation. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Another request is being processed. Wait a few minutes and try again. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An error occurred on the server side. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The resource couldn't be found. Check the ID or name and try again. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request or operation exceeds the maximum allowed request rate per Amazon +// Web Services account and Amazon Web Services Region. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request is invalid. Verify the values provided for the request parameters +// are accurate. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/ssmquicksetup/types/types.go b/service/ssmquicksetup/types/types.go new file mode 100644 index 00000000000..ea7f0ab7ed4 --- /dev/null +++ b/service/ssmquicksetup/types/types.go @@ -0,0 +1,752 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// The definition of a Quick Setup configuration. +type ConfigurationDefinition struct { + + // A list of key-value pairs containing the required parameters for the + // configuration type. + // + // This member is required. + Parameters map[string]string + + // The type of the Quick Setup configuration. + // + // This member is required. + Type *string + + // The ID of the configuration definition. + Id *string + + // The ARN of the IAM role used to administrate local configuration deployments. + LocalDeploymentAdministrationRoleArn *string + + // The name of the IAM role used to deploy local configurations. + LocalDeploymentExecutionRoleName *string + + // The version of the Quick Setup type used. + TypeVersion *string + + noSmithyDocumentSerde +} + +// Defines the preferences and options for a configuration definition. +type ConfigurationDefinitionInput struct { + + // The parameters for the configuration definition type. Parameters for + // configuration definitions vary based the configuration type. The following + // tables outline the parameters for each configuration type. + // + // OpsCenter (Type: Amazon Web ServicesQuickSetupType-SSMOpsCenter) + // - DelegatedAccountId + // + // - Description: (Required) The ID of the delegated administrator account. + // + // - TargetOrganizationalUnits + // + // - Description: (Required) A comma separated list of organizational units + // (OUs) you want to deploy the configuration to. + // + // - TargetRegions + // + // - Description: (Required) A comma separated list of Amazon Web Services + // Regions you want to deploy the configuration to. + // + // Resource Scheduler (Type: Amazon Web ServicesQuickSetupType-Scheduler) + // - TargetTagKey + // + // - Description: (Required) The tag key assigned to the instances you want to + // target. + // + // - TargetTagValue + // + // - Description: (Required) The value of the tag key assigned to the instances + // you want to target. + // + // - ICalendarString + // + // - Description: (Required) An iCalendar formatted string containing the + // schedule you want Change Manager to use. + // + // - TargetAccounts + // + // - Description: (Optional) The ID of the Amazon Web Services account + // initiating the configuration deployment. You only need to provide a value for + // this parameter if you want to deploy the configuration locally. A value must be + // provided for either TargetAccounts or TargetOrganizationalUnits . + // + // - TargetOrganizationalUnits + // + // - Description: (Optional) A comma separated list of organizational units + // (OUs) you want to deploy the configuration to. + // + // - TargetRegions + // + // - Description: (Required) A comma separated list of Amazon Web Services + // Regions you want to deploy the configuration to. + // + // Default Host Management Configuration (Type: Amazon Web + // ServicesQuickSetupType-DHMC) + // - UpdateSSMAgent + // + // - Description: (Optional) A boolean value that determines whether the SSM + // Agent is updated on the target instances every 2 weeks. The default value is " + // true ". + // + // - TargetOrganizationalUnits + // + // - Description: (Required) A comma separated list of organizational units + // (OUs) you want to deploy the configuration to. + // + // - TargetRegions + // + // - Description: (Required) A comma separated list of Amazon Web Services + // Regions you want to deploy the configuration to. + // + // Resource Explorer (Type: Amazon Web ServicesQuickSetupType-ResourceExplorer) + // - SelectedAggregatorRegion + // + // - Description: (Required) The Amazon Web Services Region where you want to + // create the aggregator index. + // + // - ReplaceExistingAggregator + // + // - Description: (Required) A boolean value that determines whether to demote + // an existing aggregator if it is in a Region that differs from the value you + // specify for the SelectedAggregatorRegion . + // + // - TargetOrganizationalUnits + // + // - Description: (Required) A comma separated list of organizational units + // (OUs) you want to deploy the configuration to. + // + // - TargetRegions + // + // - Description: (Required) A comma separated list of Amazon Web Services + // Regions you want to deploy the configuration to. + // + // Change Manager (Type: Amazon Web ServicesQuickSetupType-SSMChangeMgr) + // - DelegatedAccountId + // + // - Description: (Required) The ID of the delegated administrator account. + // + // - JobFunction + // + // - Description: (Required) The name for the Change Manager job function. + // + // - PermissionType + // + // - Description: (Optional) Specifies whether you want to use default + // administrator permissions for the job function role, or provide a custom IAM + // policy. The valid values are CustomPermissions and AdminPermissions . The + // default value for the parameter is CustomerPermissions . + // + // - CustomPermissions + // + // - Description: (Optional) A JSON string containing the IAM policy you want + // your job function to use. You must provide a value for this parameter if you + // specify CustomPermissions for the PermissionType parameter. + // + // - TargetOrganizationalUnits + // + // - Description: (Required) A comma separated list of organizational units + // (OUs) you want to deploy the configuration to. + // + // - TargetRegions + // + // - Description: (Required) A comma separated list of Amazon Web Services + // Regions you want to deploy the configuration to. + // + // DevOps Guru (Type: Amazon Web ServicesQuickSetupType-DevOpsGuru) + // - AnalyseAllResources + // + // - Description: (Optional) A boolean value that determines whether DevOps Guru + // analyzes all CloudFormation stacks in the account. The default value is " false + // ". + // + // - EnableSnsNotifications + // + // - Description: (Optional) A boolean value that determines whether DevOps Guru + // sends notifications when an insight is created. The default value is " true ". + // + // - EnableSsmOpsItems + // + // - Description: (Optional) A boolean value that determines whether DevOps Guru + // creates an OpsCenter OpsItem when an insight is created. The default value is " + // true ". + // + // - EnableDriftRemediation + // + // - Description: (Optional) A boolean value that determines whether a drift + // remediation schedule is used. The default value is " false ". + // + // - RemediationSchedule + // + // - Description: (Optional) A rate expression that defines the schedule for + // drift remediation. The valid values are rate(30 days) , rate(14 days) , + // rate(1 days) , and none . The default value is " none ". + // + // - TargetAccounts + // + // - Description: (Optional) The ID of the Amazon Web Services account + // initiating the configuration deployment. You only need to provide a value for + // this parameter if you want to deploy the configuration locally. A value must be + // provided for either TargetAccounts or TargetOrganizationalUnits . + // + // - TargetOrganizationalUnits + // + // - Description: (Optional) A comma separated list of organizational units + // (OUs) you want to deploy the configuration to. + // + // - TargetRegions + // + // - Description: (Required) A comma separated list of Amazon Web Services + // Regions you want to deploy the configuration to. + // + // Conformance Packs (Type: Amazon Web ServicesQuickSetupType-CFGCPacks) + // - DelegatedAccountId + // + // - Description: (Optional) The ID of the delegated administrator account. This + // parameter is required for Organization deployments. + // + // - RemediationSchedule + // + // - Description: (Optional) A rate expression that defines the schedule for + // drift remediation. The valid values are rate(30 days) , rate(14 days) , + // rate(2 days) , and none . The default value is " none ". + // + // - CPackNames + // + // - Description: (Required) A comma separated list of Config conformance packs. + // + // - TargetAccounts + // + // - Description: (Optional) The ID of the Amazon Web Services account + // initiating the configuration deployment. You only need to provide a value for + // this parameter if you want to deploy the configuration locally. A value must be + // provided for either TargetAccounts or TargetOrganizationalUnits . + // + // - TargetOrganizationalUnits + // + // - Description: (Optional) The ID of the root of your Organization. This + // configuration type doesn't currently support choosing specific OUs. The + // configuration will be deployed to all the OUs in the Organization. + // + // - TargetRegions + // + // - Description: (Required) A comma separated list of Amazon Web Services + // Regions you want to deploy the configuration to. + // + // Config Recording (Type: Amazon Web ServicesQuickSetupType-CFGRecording) + // - RecordAllResources + // + // - Description: (Optional) A boolean value that determines whether all + // supported resources are recorded. The default value is " true ". + // + // - ResourceTypesToRecord + // + // - Description: (Optional) A comma separated list of resource types you want + // to record. + // + // - RecordGlobalResourceTypes + // + // - Description: (Optional) A boolean value that determines whether global + // resources are recorded with all resource configurations. The default value is " + // false ". + // + // - GlobalResourceTypesRegion + // + // - Description: (Optional) Determines the Amazon Web Services Region where + // global resources are recorded. + // + // - UseCustomBucket + // + // - Description: (Optional) A boolean value that determines whether a custom + // Amazon S3 bucket is used for delivery. The default value is " false ". + // + // - DeliveryBucketName + // + // - Description: (Optional) The name of the Amazon S3 bucket you want Config to + // deliver configuration snapshots and configuration history files to. + // + // - DeliveryBucketPrefix + // + // - Description: (Optional) The key prefix you want to use in the custom Amazon + // S3 bucket. + // + // - NotificationOptions + // + // - Description: (Optional) Determines the notification configuration for the + // recorder. The valid values are NoStreaming , UseExistingTopic , and + // CreateTopic . The default value is NoStreaming . + // + // - CustomDeliveryTopicAccountId + // + // - Description: (Optional) The ID of the Amazon Web Services account where the + // Amazon SNS topic you want to use for notifications resides. You must specify a + // value for this parameter if you use the UseExistingTopic notification option. + // + // - CustomDeliveryTopicName + // + // - Description: (Optional) The name of the Amazon SNS topic you want to use + // for notifications. You must specify a value for this parameter if you use the + // UseExistingTopic notification option. + // + // - RemediationSchedule + // + // - Description: (Optional) A rate expression that defines the schedule for + // drift remediation. The valid values are rate(30 days) , rate(7 days) , rate(1 + // days) , and none . The default value is " none ". + // + // - TargetAccounts + // + // - Description: (Optional) The ID of the Amazon Web Services account + // initiating the configuration deployment. You only need to provide a value for + // this parameter if you want to deploy the configuration locally. A value must be + // provided for either TargetAccounts or TargetOrganizationalUnits . + // + // - TargetOrganizationalUnits + // + // - Description: (Optional) The ID of the root of your Organization. This + // configuration type doesn't currently support choosing specific OUs. The + // configuration will be deployed to all the OUs in the Organization. + // + // - TargetRegions + // + // - Description: (Required) A comma separated list of Amazon Web Services + // Regions you want to deploy the configuration to. + // + // Host Management (Type: Amazon Web ServicesQuickSetupType-SSMHostMgmt) + // - UpdateSSMAgent + // + // - Description: (Optional) A boolean value that determines whether the SSM + // Agent is updated on the target instances every 2 weeks. The default value is " + // true ". + // + // - UpdateEc2LaunchAgent + // + // - Description: (Optional) A boolean value that determines whether the EC2 + // Launch agent is updated on the target instances every month. The default value + // is " false ". + // + // - CollectInventory + // + // - Description: (Optional) A boolean value that determines whether the EC2 + // Launch agent is updated on the target instances every month. The default value + // is " true ". + // + // - ScanInstances + // + // - Description: (Optional) A boolean value that determines whether the target + // instances are scanned daily for available patches. The default value is " true + // ". + // + // - InstallCloudWatchAgent + // + // - Description: (Optional) A boolean value that determines whether the Amazon + // CloudWatch agent is installed on the target instances. The default value is " + // false ". + // + // - UpdateCloudWatchAgent + // + // - Description: (Optional) A boolean value that determines whether the Amazon + // CloudWatch agent is updated on the target instances every month. The default + // value is " false ". + // + // - IsPolicyAttachAllowed + // + // - Description: (Optional) A boolean value that determines whether Quick Setup + // attaches policies to instances profiles already associated with the target + // instances. The default value is " false ". + // + // - TargetType + // + // - Description: (Optional) Determines how instances are targeted for local + // account deployments. Don't specify a value for this parameter if you're + // deploying to OUs. The valid values are * , InstanceIds , ResourceGroups , and + // Tags . Use * to target all instances in the account. + // + // - TargetInstances + // + // - Description: (Optional) A comma separated list of instance IDs. You must + // provide a value for this parameter if you specify InstanceIds for the + // TargetType parameter. + // + // - TargetTagKey + // + // - Description: (Optional) The tag key assigned to the instances you want to + // target. You must provide a value for this parameter if you specify Tags for + // the TargetType parameter. + // + // - TargetTagValue + // + // - Description: (Optional) The value of the tag key assigned to the instances + // you want to target. You must provide a value for this parameter if you specify + // Tags for the TargetType parameter. + // + // - ResourceGroupName + // + // - Description: (Optional) The name of the resource group associated with the + // instances you want to target. You must provide a value for this parameter if you + // specify ResourceGroups for the TargetType parameter. + // + // - TargetAccounts + // + // - Description: (Optional) The ID of the Amazon Web Services account + // initiating the configuration deployment. You only need to provide a value for + // this parameter if you want to deploy the configuration locally. A value must be + // provided for either TargetAccounts or TargetOrganizationalUnits . + // + // - TargetOrganizationalUnits + // + // - Description: (Optional) A comma separated list of organizational units + // (OUs) you want to deploy the configuration to. + // + // - TargetRegions + // + // - Description: (Required) A comma separated list of Amazon Web Services + // Regions you want to deploy the configuration to. + // + // Distributor (Type: Amazon Web ServicesQuickSetupType-Distributor) + // - PackagesToInstall + // + // - Description: (Required) A comma separated list of packages you want to + // install on the target instances. The valid values are AWSEFSTools , AWSCWAgent + // , and AWSEC2LaunchAgent . + // + // - RemediationSchedule + // + // - Description: (Optional) A rate expression that defines the schedule for + // drift remediation. The valid values are rate(30 days) , rate(14 days) , + // rate(2 days) , and none . The default value is " rate(30 days) ". + // + // - IsPolicyAttachAllowed + // + // - Description: (Optional) A boolean value that determines whether Quick Setup + // attaches policies to instances profiles already associated with the target + // instances. The default value is " false ". + // + // - TargetType + // + // - Description: (Optional) Determines how instances are targeted for local + // account deployments. Don't specify a value for this parameter if you're + // deploying to OUs. The valid values are * , InstanceIds , ResourceGroups , and + // Tags . Use * to target all instances in the account. + // + // - TargetInstances + // + // - Description: (Optional) A comma separated list of instance IDs. You must + // provide a value for this parameter if you specify InstanceIds for the + // TargetType parameter. + // + // - TargetTagKey + // + // - Description: (Required) The tag key assigned to the instances you want to + // target. You must provide a value for this parameter if you specify Tags for + // the TargetType parameter. + // + // - TargetTagValue + // + // - Description: (Required) The value of the tag key assigned to the instances + // you want to target. You must provide a value for this parameter if you specify + // Tags for the TargetType parameter. + // + // - ResourceGroupName + // + // - Description: (Required) The name of the resource group associated with the + // instances you want to target. You must provide a value for this parameter if you + // specify ResourceGroups for the TargetType parameter. + // + // - TargetAccounts + // + // - Description: (Optional) The ID of the Amazon Web Services account + // initiating the configuration deployment. You only need to provide a value for + // this parameter if you want to deploy the configuration locally. A value must be + // provided for either TargetAccounts or TargetOrganizationalUnits . + // + // - TargetOrganizationalUnits + // + // - Description: (Optional) A comma separated list of organizational units + // (OUs) you want to deploy the configuration to. + // + // - TargetRegions + // + // - Description: (Required) A comma separated list of Amazon Web Services + // Regions you want to deploy the configuration to. + // + // Patch Policy (Type: Amazon Web ServicesQuickSetupType-PatchPolicy) + // - PatchPolicyName + // + // - Description: (Required) A name for the patch policy. The value you provide + // is applied to target Amazon EC2 instances as a tag. + // + // - SelectedPatchBaselines + // + // - Description: (Required) An array of JSON objects containing the information + // for the patch baselines to include in your patch policy. + // + // - PatchBaselineUseDefault + // + // - Description: (Optional) A boolean value that determines whether the + // selected patch baselines are all Amazon Web Services provided. + // + // - ConfigurationOptionsPatchOperation + // + // - Description: (Optional) Determines whether target instances scan for + // available patches, or scan and install available patches. The valid values are + // Scan and ScanAndInstall . The default value for the parameter is Scan . + // + // - ConfigurationOptionsScanValue + // + // - Description: (Optional) A cron expression that is used as the schedule for + // when instances scan for available patches. + // + // - ConfigurationOptionsInstallValue + // + // - Description: (Optional) A cron expression that is used as the schedule for + // when instances install available patches. + // + // - ConfigurationOptionsScanNextInterval + // + // - Description: (Optional) A boolean value that determines whether instances + // should scan for available patches at the next cron interval. The default value + // is " false ". + // + // - ConfigurationOptionsInstallNextInterval + // + // - Description: (Optional) A boolean value that determines whether instances + // should scan for available patches at the next cron interval. The default value + // is " false ". + // + // - RebootOption + // + // - Description: (Optional) A boolean value that determines whether instances + // are rebooted after patches are installed. The default value is " false ". + // + // - IsPolicyAttachAllowed + // + // - Description: (Optional) A boolean value that determines whether Quick Setup + // attaches policies to instances profiles already associated with the target + // instances. The default value is " false ". + // + // - OutputLogEnableS3 + // + // - Description: (Optional) A boolean value that determines whether command + // output logs are sent to Amazon S3. + // + // - OutputS3Location + // + // - Description: (Optional) A JSON string containing information about the + // Amazon S3 bucket where you want to store the output details of the request. + // + // - OutputS3BucketRegion + // + // - Description: (Optional) The Amazon Web Services Region where the Amazon S3 + // bucket you want Config to deliver command output to is located. + // + // - OutputS3BucketName + // + // - Description: (Optional) The name of the Amazon S3 bucket you want Config to + // deliver command output to. + // + // - OutputS3KeyPrefix + // + // - Description: (Optional) The key prefix you want to use in the custom Amazon + // S3 bucket. + // + // - TargetType + // + // - Description: (Optional) Determines how instances are targeted for local + // account deployments. Don't specify a value for this parameter if you're + // deploying to OUs. The valid values are * , InstanceIds , ResourceGroups , and + // Tags . Use * to target all instances in the account. + // + // - TargetInstances + // + // - Description: (Optional) A comma separated list of instance IDs. You must + // provide a value for this parameter if you specify InstanceIds for the + // TargetType parameter. + // + // - TargetTagKey + // + // - Description: (Required) The tag key assigned to the instances you want to + // target. You must provide a value for this parameter if you specify Tags for + // the TargetType parameter. + // + // - TargetTagValue + // + // - Description: (Required) The value of the tag key assigned to the instances + // you want to target. You must provide a value for this parameter if you specify + // Tags for the TargetType parameter. + // + // - ResourceGroupName + // + // - Description: (Required) The name of the resource group associated with the + // instances you want to target. You must provide a value for this parameter if you + // specify ResourceGroups for the TargetType parameter. + // + // - TargetAccounts + // + // - Description: (Optional) The ID of the Amazon Web Services account + // initiating the configuration deployment. You only need to provide a value for + // this parameter if you want to deploy the configuration locally. A value must be + // provided for either TargetAccounts or TargetOrganizationalUnits . + // + // - TargetOrganizationalUnits + // + // - Description: (Optional) A comma separated list of organizational units + // (OUs) you want to deploy the configuration to. + // + // - TargetRegions + // + // - Description: (Required) A comma separated list of Amazon Web Services + // Regions you want to deploy the configuration to. + // + // This member is required. + Parameters map[string]string + + // The type of the Quick Setup configuration. + // + // This member is required. + Type *string + + // The ARN of the IAM role used to administrate local configuration deployments. + LocalDeploymentAdministrationRoleArn *string + + // The name of the IAM role used to deploy local configurations. + LocalDeploymentExecutionRoleName *string + + // The version of the Quick Setup type to use. + TypeVersion *string + + noSmithyDocumentSerde +} + +// A summarized definition of a Quick Setup configuration definition. +type ConfigurationDefinitionSummary struct { + + // The common parameters and values for the configuration definition. + FirstClassParameters map[string]string + + // The ID of the configuration definition. + Id *string + + // The type of the Quick Setup configuration used by the configuration definition. + Type *string + + // The version of the Quick Setup type used by the configuration definition. + TypeVersion *string + + noSmithyDocumentSerde +} + +// A summary of a Quick Setup configuration manager. +type ConfigurationManagerSummary struct { + + // The ARN of the Quick Setup configuration. + // + // This member is required. + ManagerArn *string + + // A summary of the Quick Setup configuration definition. + ConfigurationDefinitionSummaries []ConfigurationDefinitionSummary + + // The description of the configuration. + Description *string + + // The name of the configuration + Name *string + + // Summaries of the state of the configuration manager. These summaries include an + // aggregate of the statuses from the configuration definition associated with the + // configuration manager. This includes deployment statuses, association statuses, + // drift statuses, health checks, and more. + StatusSummaries []StatusSummary + + noSmithyDocumentSerde +} + +// A key-value pair to filter results. +type Filter struct { + + // The key for the filter. + // + // This member is required. + Key *string + + // The values for the filter keys. + // + // This member is required. + Values []string + + noSmithyDocumentSerde +} + +// Information about the Quick Setup type. +type QuickSetupTypeOutput struct { + + // The latest version number of the configuration. + LatestVersion *string + + // The type of the Quick Setup configuration. + Type *string + + noSmithyDocumentSerde +} + +// Settings configured for Quick Setup. +type ServiceSettings struct { + + // The IAM role used to enable Explorer. + ExplorerEnablingRoleArn *string + + noSmithyDocumentSerde +} + +// A summarized description of the status. +type StatusSummary struct { + + // The datetime stamp when the status was last updated. + // + // This member is required. + LastUpdatedAt *time.Time + + // The type of a status summary. + // + // This member is required. + StatusType StatusType + + // The current status. + Status Status + + // Details about the status. + StatusDetails map[string]string + + // When applicable, returns an informational message relevant to the current + // status and status type of the status summary object. We don't recommend + // implementing parsing logic around this value since the messages returned can + // vary in format. + StatusMessage *string + + noSmithyDocumentSerde +} + +// Key-value pairs of metadata. +type TagEntry struct { + + // The key for the tag. + Key *string + + // The value for the tag. + Value *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/ssmquicksetup/validators.go b/service/ssmquicksetup/validators.go new file mode 100644 index 00000000000..b15aa268478 --- /dev/null +++ b/service/ssmquicksetup/validators.go @@ -0,0 +1,447 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateConfigurationManager struct { +} + +func (*validateOpCreateConfigurationManager) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateConfigurationManager) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateConfigurationManagerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateConfigurationManagerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteConfigurationManager struct { +} + +func (*validateOpDeleteConfigurationManager) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteConfigurationManager) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteConfigurationManagerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteConfigurationManagerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetConfigurationManager struct { +} + +func (*validateOpGetConfigurationManager) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetConfigurationManager) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetConfigurationManagerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetConfigurationManagerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListConfigurationManagers struct { +} + +func (*validateOpListConfigurationManagers) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListConfigurationManagers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListConfigurationManagersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListConfigurationManagersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateConfigurationDefinition struct { +} + +func (*validateOpUpdateConfigurationDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateConfigurationDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateConfigurationDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateConfigurationDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateConfigurationManager struct { +} + +func (*validateOpUpdateConfigurationManager) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateConfigurationManager) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateConfigurationManagerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateConfigurationManagerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateConfigurationManagerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateConfigurationManager{}, middleware.After) +} + +func addOpDeleteConfigurationManagerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteConfigurationManager{}, middleware.After) +} + +func addOpGetConfigurationManagerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetConfigurationManager{}, middleware.After) +} + +func addOpListConfigurationManagersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListConfigurationManagers{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateConfigurationDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateConfigurationDefinition{}, middleware.After) +} + +func addOpUpdateConfigurationManagerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateConfigurationManager{}, middleware.After) +} + +func validateConfigurationDefinitionInput(v *types.ConfigurationDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConfigurationDefinitionInput"} + if v.Type == nil { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Parameters == nil { + invalidParams.Add(smithy.NewErrParamRequired("Parameters")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateConfigurationDefinitionsInputList(v []types.ConfigurationDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConfigurationDefinitionsInputList"} + for i := range v { + if err := validateConfigurationDefinitionInput(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFilter(v *types.Filter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Filter"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFiltersList(v []types.Filter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FiltersList"} + for i := range v { + if err := validateFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateConfigurationManagerInput(v *CreateConfigurationManagerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateConfigurationManagerInput"} + if v.ConfigurationDefinitions == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationDefinitions")) + } else if v.ConfigurationDefinitions != nil { + if err := validateConfigurationDefinitionsInputList(v.ConfigurationDefinitions); err != nil { + invalidParams.AddNested("ConfigurationDefinitions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteConfigurationManagerInput(v *DeleteConfigurationManagerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteConfigurationManagerInput"} + if v.ManagerArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ManagerArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetConfigurationManagerInput(v *GetConfigurationManagerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetConfigurationManagerInput"} + if v.ManagerArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ManagerArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListConfigurationManagersInput(v *ListConfigurationManagersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListConfigurationManagersInput"} + if v.Filters != nil { + if err := validateFiltersList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateConfigurationDefinitionInput(v *UpdateConfigurationDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateConfigurationDefinitionInput"} + if v.ManagerArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ManagerArn")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateConfigurationManagerInput(v *UpdateConfigurationManagerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateConfigurationManagerInput"} + if v.ManagerArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ManagerArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/support/doc.go b/service/support/doc.go index 27564777a48..269f687fa4b 100644 --- a/service/support/doc.go +++ b/service/support/doc.go @@ -45,7 +45,7 @@ // For more information about this service and the endpoints to use, see [About the Amazon Web Services Support API] in the // Amazon Web Services Support User Guide. // -// [Trusted Advisor]: https://docs.aws.amazon.com/ +// [Trusted Advisor]: https://docs.aws.amazon.com/awssupport/latest/user/trusted-advisor.html // [Amazon Web Services Support]: http://aws.amazon.com/premiumsupport/ // [About the Amazon Web Services Support API]: https://docs.aws.amazon.com/awssupport/latest/user/about-support-api.html // [Signature Version 4 Signing Process]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html diff --git a/service/support/types/types.go b/service/support/types/types.go index c3e3c0264be..8046cbcb5c3 100644 --- a/service/support/types/types.go +++ b/service/support/types/types.go @@ -7,7 +7,8 @@ import ( ) // An attachment to a case communication. The attachment consists of the file name -// and the content of the file. +// and the content of the file. Each attachment file size should not exceed 5 MB. +// File types that are supported include the following: pdf, jpeg,.doc, .log, .text type Attachment struct { // The content of the attachment file. @@ -66,6 +67,10 @@ type AttachmentDetails struct { // - status - The status of the case in the Amazon Web Services Support Center. // Valid values: // +// - all-open +// +// - customer-action-completed +// // - opened // // - pending-customer-action @@ -122,6 +127,10 @@ type CaseDetails struct { // // Valid values: // + // - all-open + // + // - customer-action-completed + // // - opened // // - pending-customer-action