From f64d7d2b0a0033996b32ba9e1b18e5a923452b84 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Thu, 1 Dec 2022 19:11:57 +0000 Subject: [PATCH] Regenerated Clients --- .../03e1296c3e674d59906561aa986b9b9b.json | 8 + .../246335b3d43349b09c8880839bf638f8.json | 8 + .../41575353444b40ffbf474f4155544f00.json | 9 + .../5b9ab24fc7ff47c2864fc3e5501312c4.json | 8 + .../67af669e733845edb9ee72ed359b422d.json | 8 + .../b5598a71474d40368b89ca9d4776b2a8.json | 8 + service/codecatalyst/LICENSE.txt | 202 + service/codecatalyst/api_client.go | 420 ++ service/codecatalyst/api_client_test.go | 123 + .../codecatalyst/api_op_CreateAccessToken.go | 138 + .../api_op_CreateDevEnvironment.go | 173 + service/codecatalyst/api_op_CreateProject.go | 136 + .../api_op_CreateSourceRepositoryBranch.go | 148 + .../codecatalyst/api_op_DeleteAccessToken.go | 113 + .../api_op_DeleteDevEnvironment.go | 138 + .../codecatalyst/api_op_GetDevEnvironment.go | 190 + service/codecatalyst/api_op_GetProject.go | 131 + .../api_op_GetSourceRepositoryCloneUrls.go | 128 + service/codecatalyst/api_op_GetSpace.go | 128 + .../codecatalyst/api_op_GetSubscription.go | 120 + service/codecatalyst/api_op_GetUserDetails.go | 126 + .../codecatalyst/api_op_ListAccessTokens.go | 217 + .../api_op_ListDevEnvironments.go | 233 + service/codecatalyst/api_op_ListEventLogs.go | 242 + service/codecatalyst/api_op_ListProjects.go | 224 + .../api_op_ListSourceRepositories.go | 228 + .../api_op_ListSourceRepositoryBranches.go | 235 + service/codecatalyst/api_op_ListSpaces.go | 194 + .../api_op_StartDevEnvironment.go | 155 + .../api_op_StartDevEnvironmentSession.go | 151 + .../codecatalyst/api_op_StopDevEnvironment.go | 144 + .../api_op_UpdateDevEnvironment.go | 183 + service/codecatalyst/api_op_VerifySession.go | 107 + service/codecatalyst/deserializers.go | 6325 ++++++++++++++++ service/codecatalyst/doc.go | 88 + service/codecatalyst/endpoints.go | 200 + service/codecatalyst/generated.json | 51 + service/codecatalyst/go.mod | 16 + service/codecatalyst/go.sum | 11 + service/codecatalyst/go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 258 + .../internal/endpoints/endpoints_test.go | 11 + service/codecatalyst/protocol_test.go | 3 + service/codecatalyst/serializers.go | 2231 ++++++ service/codecatalyst/types/enums.go | 170 + service/codecatalyst/types/errors.go | 131 + service/codecatalyst/types/types.go | 490 ++ service/codecatalyst/validators.go | 1053 +++ service/comprehend/api_op_ClassifyDocument.go | 41 +- .../api_op_CreateEntityRecognizer.go | 8 +- .../api_op_DescribeResourcePolicy.go | 3 +- service/comprehend/api_op_DetectEntities.go | 69 +- service/comprehend/api_op_ListEndpoints.go | 90 + .../api_op_ListPiiEntitiesDetectionJobs.go | 94 + ...i_op_StartTargetedSentimentDetectionJob.go | 3 +- service/comprehend/deserializers.go | 1269 +++- service/comprehend/serializers.go | 24 + service/comprehend/types/enums.go | 124 + service/comprehend/types/errors.go | 3 + service/comprehend/types/types.go | 321 +- service/comprehend/validators.go | 14 +- service/gamelift/api_op_AcceptMatch.go | 5 +- service/gamelift/api_op_ClaimGameServer.go | 37 +- service/gamelift/api_op_CreateAlias.go | 10 +- service/gamelift/api_op_CreateBuild.go | 88 +- service/gamelift/api_op_CreateFleet.go | 76 +- .../gamelift/api_op_CreateFleetLocations.go | 25 +- .../gamelift/api_op_CreateGameServerGroup.go | 10 +- service/gamelift/api_op_CreateGameSession.go | 69 +- .../gamelift/api_op_CreateGameSessionQueue.go | 7 +- service/gamelift/api_op_CreateLocation.go | 129 + .../api_op_CreateMatchmakingConfiguration.go | 52 +- .../api_op_CreateMatchmakingRuleSet.go | 25 +- .../gamelift/api_op_CreatePlayerSession.go | 23 +- .../gamelift/api_op_CreatePlayerSessions.go | 23 +- service/gamelift/api_op_CreateScript.go | 24 +- .../api_op_CreateVpcPeeringAuthorization.go | 17 +- .../api_op_CreateVpcPeeringConnection.go | 34 +- service/gamelift/api_op_DeleteAlias.go | 6 +- service/gamelift/api_op_DeleteBuild.go | 6 +- service/gamelift/api_op_DeleteFleet.go | 19 +- .../gamelift/api_op_DeleteFleetLocations.go | 7 - .../gamelift/api_op_DeleteGameServerGroup.go | 8 +- .../gamelift/api_op_DeleteGameSessionQueue.go | 14 +- service/gamelift/api_op_DeleteLocation.go | 119 + .../api_op_DeleteMatchmakingConfiguration.go | 8 +- .../api_op_DeleteMatchmakingRuleSet.go | 9 - .../gamelift/api_op_DeleteScalingPolicy.go | 10 +- service/gamelift/api_op_DeleteScript.go | 3 +- .../api_op_DeleteVpcPeeringAuthorization.go | 8 +- .../api_op_DeleteVpcPeeringConnection.go | 20 +- service/gamelift/api_op_DeregisterCompute.go | 122 + .../gamelift/api_op_DeregisterGameServer.go | 4 - service/gamelift/api_op_DescribeAlias.go | 5 +- service/gamelift/api_op_DescribeBuild.go | 7 +- service/gamelift/api_op_DescribeCompute.go | 129 + .../api_op_DescribeEC2InstanceLimits.go | 7 - .../api_op_DescribeFleetAttributes.go | 7 - .../gamelift/api_op_DescribeFleetCapacity.go | 43 +- .../gamelift/api_op_DescribeFleetEvents.go | 7 - .../api_op_DescribeFleetLocationAttributes.go | 7 - .../api_op_DescribeFleetLocationCapacity.go | 7 - ...api_op_DescribeFleetLocationUtilization.go | 7 - .../api_op_DescribeFleetPortSettings.go | 7 - .../api_op_DescribeFleetUtilization.go | 46 +- service/gamelift/api_op_DescribeGameServer.go | 4 - .../api_op_DescribeGameServerGroup.go | 8 +- .../api_op_DescribeGameServerInstances.go | 29 +- .../api_op_DescribeGameSessionDetails.go | 51 +- .../api_op_DescribeGameSessionPlacement.go | 9 +- .../api_op_DescribeGameSessionQueues.go | 17 +- .../gamelift/api_op_DescribeGameSessions.go | 71 +- service/gamelift/api_op_DescribeInstances.go | 5 +- .../gamelift/api_op_DescribeMatchmaking.go | 9 +- ...pi_op_DescribeMatchmakingConfigurations.go | 8 - .../api_op_DescribeMatchmakingRuleSets.go | 9 - .../gamelift/api_op_DescribePlayerSessions.go | 23 +- .../api_op_DescribeRuntimeConfiguration.go | 7 - .../api_op_DescribeScalingPolicies.go | 12 +- service/gamelift/api_op_DescribeScript.go | 3 +- ...api_op_DescribeVpcPeeringAuthorizations.go | 5 +- .../api_op_DescribeVpcPeeringConnections.go | 6 +- service/gamelift/api_op_GetComputeAccess.go | 160 + .../gamelift/api_op_GetComputeAuthToken.go | 155 + .../gamelift/api_op_GetGameSessionLogUrl.go | 7 +- service/gamelift/api_op_GetInstanceAccess.go | 11 +- service/gamelift/api_op_ListAliases.go | 9 +- service/gamelift/api_op_ListBuilds.go | 7 +- service/gamelift/api_op_ListCompute.go | 230 + service/gamelift/api_op_ListFleets.go | 12 +- .../gamelift/api_op_ListGameServerGroups.go | 30 +- service/gamelift/api_op_ListGameServers.go | 5 +- service/gamelift/api_op_ListLocations.go | 221 + service/gamelift/api_op_ListScripts.go | 3 +- .../gamelift/api_op_ListTagsForResource.go | 3 +- service/gamelift/api_op_PutScalingPolicy.go | 37 +- service/gamelift/api_op_RegisterCompute.go | 155 + service/gamelift/api_op_RegisterGameServer.go | 19 +- .../api_op_RequestUploadCredentials.go | 17 +- service/gamelift/api_op_ResolveAlias.go | 5 +- .../gamelift/api_op_ResumeGameServerGroup.go | 10 +- service/gamelift/api_op_SearchGameSessions.go | 71 +- service/gamelift/api_op_StartFleetActions.go | 36 +- .../api_op_StartGameSessionPlacement.go | 85 +- service/gamelift/api_op_StartMatchBackfill.go | 12 +- service/gamelift/api_op_StartMatchmaking.go | 8 +- service/gamelift/api_op_StopFleetActions.go | 14 +- .../api_op_StopGameSessionPlacement.go | 10 +- service/gamelift/api_op_StopMatchmaking.go | 4 - .../gamelift/api_op_SuspendGameServerGroup.go | 8 +- service/gamelift/api_op_TagResource.go | 3 +- service/gamelift/api_op_UntagResource.go | 3 +- service/gamelift/api_op_UpdateAlias.go | 5 +- service/gamelift/api_op_UpdateBuild.go | 15 +- .../gamelift/api_op_UpdateFleetAttributes.go | 30 +- .../gamelift/api_op_UpdateFleetCapacity.go | 49 +- .../api_op_UpdateFleetPortSettings.go | 14 +- service/gamelift/api_op_UpdateGameServer.go | 6 +- .../gamelift/api_op_UpdateGameServerGroup.go | 8 +- service/gamelift/api_op_UpdateGameSession.go | 7 +- .../gamelift/api_op_UpdateGameSessionQueue.go | 12 - .../api_op_UpdateMatchmakingConfiguration.go | 25 +- .../api_op_UpdateRuntimeConfiguration.go | 9 +- service/gamelift/api_op_UpdateScript.go | 7 +- .../api_op_ValidateMatchmakingRuleSet.go | 9 - service/gamelift/deserializers.go | 2841 +++++-- service/gamelift/doc.go | 16 +- service/gamelift/generated.json | 9 + service/gamelift/serializers.go | 822 +- service/gamelift/types/enums.go | 84 +- service/gamelift/types/errors.go | 4 +- service/gamelift/types/types.go | 610 +- service/gamelift/validators.go | 401 +- service/pipes/LICENSE.txt | 202 + service/pipes/api_client.go | 434 ++ service/pipes/api_client_test.go | 123 + service/pipes/api_op_CreatePipe.go | 175 + service/pipes/api_op_DeletePipe.go | 141 + service/pipes/api_op_DescribePipe.go | 171 + service/pipes/api_op_ListPipes.go | 239 + service/pipes/api_op_ListTagsForResource.go | 120 + service/pipes/api_op_StartPipe.go | 138 + service/pipes/api_op_StopPipe.go | 138 + service/pipes/api_op_TagResource.go | 130 + service/pipes/api_op_UntagResource.go | 121 + service/pipes/api_op_UpdatePipe.go | 173 + service/pipes/deserializers.go | 6694 +++++++++++++++++ service/pipes/doc.go | 12 + service/pipes/endpoints.go | 200 + service/pipes/generated.json | 38 + service/pipes/go.mod | 16 + service/pipes/go.sum | 11 + service/pipes/go_module_metadata.go | 6 + service/pipes/internal/endpoints/endpoints.go | 321 + .../internal/endpoints/endpoints_test.go | 11 + service/pipes/protocol_test.go | 3 + service/pipes/serializers.go | 2741 +++++++ service/pipes/types/enums.go | 352 + service/pipes/types/errors.go | 138 + service/pipes/types/types.go | 1544 ++++ service/pipes/types/types_exported_test.go | 74 + service/pipes/validators.go | 1064 +++ service/sfn/api_op_DeleteStateMachine.go | 13 +- service/sfn/api_op_DescribeExecution.go | 20 +- service/sfn/api_op_DescribeMapRun.go | 176 + service/sfn/api_op_DescribeStateMachine.go | 16 +- ...api_op_DescribeStateMachineForExecution.go | 20 +- service/sfn/api_op_ListExecutions.go | 23 +- service/sfn/api_op_ListMapRuns.go | 239 + service/sfn/api_op_StartExecution.go | 9 +- service/sfn/api_op_UpdateMapRun.go | 127 + service/sfn/api_op_UpdateStateMachine.go | 15 +- service/sfn/deserializers.go | 1412 +++- service/sfn/generated.json | 3 + service/sfn/serializers.go | 245 + service/sfn/types/enums.go | 50 + service/sfn/types/errors.go | 34 +- service/sfn/types/types.go | 184 + service/sfn/validators.go | 100 +- 219 files changed, 41902 insertions(+), 2102 deletions(-) create mode 100644 .changelog/03e1296c3e674d59906561aa986b9b9b.json create mode 100644 .changelog/246335b3d43349b09c8880839bf638f8.json create mode 100644 .changelog/41575353444b40ffbf474f4155544f00.json create mode 100644 .changelog/5b9ab24fc7ff47c2864fc3e5501312c4.json create mode 100644 .changelog/67af669e733845edb9ee72ed359b422d.json create mode 100644 .changelog/b5598a71474d40368b89ca9d4776b2a8.json create mode 100644 service/codecatalyst/LICENSE.txt create mode 100644 service/codecatalyst/api_client.go create mode 100644 service/codecatalyst/api_client_test.go create mode 100644 service/codecatalyst/api_op_CreateAccessToken.go create mode 100644 service/codecatalyst/api_op_CreateDevEnvironment.go create mode 100644 service/codecatalyst/api_op_CreateProject.go create mode 100644 service/codecatalyst/api_op_CreateSourceRepositoryBranch.go create mode 100644 service/codecatalyst/api_op_DeleteAccessToken.go create mode 100644 service/codecatalyst/api_op_DeleteDevEnvironment.go create mode 100644 service/codecatalyst/api_op_GetDevEnvironment.go create mode 100644 service/codecatalyst/api_op_GetProject.go create mode 100644 service/codecatalyst/api_op_GetSourceRepositoryCloneUrls.go create mode 100644 service/codecatalyst/api_op_GetSpace.go create mode 100644 service/codecatalyst/api_op_GetSubscription.go create mode 100644 service/codecatalyst/api_op_GetUserDetails.go create mode 100644 service/codecatalyst/api_op_ListAccessTokens.go create mode 100644 service/codecatalyst/api_op_ListDevEnvironments.go create mode 100644 service/codecatalyst/api_op_ListEventLogs.go create mode 100644 service/codecatalyst/api_op_ListProjects.go create mode 100644 service/codecatalyst/api_op_ListSourceRepositories.go create mode 100644 service/codecatalyst/api_op_ListSourceRepositoryBranches.go create mode 100644 service/codecatalyst/api_op_ListSpaces.go create mode 100644 service/codecatalyst/api_op_StartDevEnvironment.go create mode 100644 service/codecatalyst/api_op_StartDevEnvironmentSession.go create mode 100644 service/codecatalyst/api_op_StopDevEnvironment.go create mode 100644 service/codecatalyst/api_op_UpdateDevEnvironment.go create mode 100644 service/codecatalyst/api_op_VerifySession.go create mode 100644 service/codecatalyst/deserializers.go create mode 100644 service/codecatalyst/doc.go create mode 100644 service/codecatalyst/endpoints.go create mode 100644 service/codecatalyst/generated.json create mode 100644 service/codecatalyst/go.mod create mode 100644 service/codecatalyst/go.sum create mode 100644 service/codecatalyst/go_module_metadata.go create mode 100644 service/codecatalyst/internal/endpoints/endpoints.go create mode 100644 service/codecatalyst/internal/endpoints/endpoints_test.go create mode 100644 service/codecatalyst/protocol_test.go create mode 100644 service/codecatalyst/serializers.go create mode 100644 service/codecatalyst/types/enums.go create mode 100644 service/codecatalyst/types/errors.go create mode 100644 service/codecatalyst/types/types.go create mode 100644 service/codecatalyst/validators.go create mode 100644 service/gamelift/api_op_CreateLocation.go create mode 100644 service/gamelift/api_op_DeleteLocation.go create mode 100644 service/gamelift/api_op_DeregisterCompute.go create mode 100644 service/gamelift/api_op_DescribeCompute.go create mode 100644 service/gamelift/api_op_GetComputeAccess.go create mode 100644 service/gamelift/api_op_GetComputeAuthToken.go create mode 100644 service/gamelift/api_op_ListCompute.go create mode 100644 service/gamelift/api_op_ListLocations.go create mode 100644 service/gamelift/api_op_RegisterCompute.go create mode 100644 service/pipes/LICENSE.txt create mode 100644 service/pipes/api_client.go create mode 100644 service/pipes/api_client_test.go create mode 100644 service/pipes/api_op_CreatePipe.go create mode 100644 service/pipes/api_op_DeletePipe.go create mode 100644 service/pipes/api_op_DescribePipe.go create mode 100644 service/pipes/api_op_ListPipes.go create mode 100644 service/pipes/api_op_ListTagsForResource.go create mode 100644 service/pipes/api_op_StartPipe.go create mode 100644 service/pipes/api_op_StopPipe.go create mode 100644 service/pipes/api_op_TagResource.go create mode 100644 service/pipes/api_op_UntagResource.go create mode 100644 service/pipes/api_op_UpdatePipe.go create mode 100644 service/pipes/deserializers.go create mode 100644 service/pipes/doc.go create mode 100644 service/pipes/endpoints.go create mode 100644 service/pipes/generated.json create mode 100644 service/pipes/go.mod create mode 100644 service/pipes/go.sum create mode 100644 service/pipes/go_module_metadata.go create mode 100644 service/pipes/internal/endpoints/endpoints.go create mode 100644 service/pipes/internal/endpoints/endpoints_test.go create mode 100644 service/pipes/protocol_test.go create mode 100644 service/pipes/serializers.go create mode 100644 service/pipes/types/enums.go create mode 100644 service/pipes/types/errors.go create mode 100644 service/pipes/types/types.go create mode 100644 service/pipes/types/types_exported_test.go create mode 100644 service/pipes/validators.go create mode 100644 service/sfn/api_op_DescribeMapRun.go create mode 100644 service/sfn/api_op_ListMapRuns.go create mode 100644 service/sfn/api_op_UpdateMapRun.go diff --git a/.changelog/03e1296c3e674d59906561aa986b9b9b.json b/.changelog/03e1296c3e674d59906561aa986b9b9b.json new file mode 100644 index 00000000000..25069a1ae10 --- /dev/null +++ b/.changelog/03e1296c3e674d59906561aa986b9b9b.json @@ -0,0 +1,8 @@ +{ + "id": "03e1296c-3e67-4d59-9065-61aa986b9b9b", + "type": "feature", + "description": "This release adds support for the AWS Step Functions Map state in Distributed mode. The changes include a new MapRun resource and several new and modified APIs.", + "modules": [ + "service/sfn" + ] +} \ No newline at end of file diff --git a/.changelog/246335b3d43349b09c8880839bf638f8.json b/.changelog/246335b3d43349b09c8880839bf638f8.json new file mode 100644 index 00000000000..a5208471baa --- /dev/null +++ b/.changelog/246335b3d43349b09c8880839bf638f8.json @@ -0,0 +1,8 @@ +{ + "id": "246335b3-d433-49b0-9c88-80839bf638f8", + "type": "feature", + "description": "This release adds operations that support customers using the AWS Toolkits and Amazon CodeCatalyst, a unified software development service that helps developers develop, deploy, and maintain applications in the cloud. For more information, see the documentation.", + "modules": [ + "service/codecatalyst" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..24f950c3a60 --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,9 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/codecatalyst", + "service/pipes" + ] +} \ No newline at end of file diff --git a/.changelog/5b9ab24fc7ff47c2864fc3e5501312c4.json b/.changelog/5b9ab24fc7ff47c2864fc3e5501312c4.json new file mode 100644 index 00000000000..9c6b8837411 --- /dev/null +++ b/.changelog/5b9ab24fc7ff47c2864fc3e5501312c4.json @@ -0,0 +1,8 @@ +{ + "id": "5b9ab24f-c7ff-47c2-864f-c3e5501312c4", + "type": "feature", + "description": "AWS introduces new Amazon EventBridge Pipes which allow you to connect sources (SQS, Kinesis, DDB, Kafka, MQ) to Targets (14+ EventBridge Targets) without any code, with filtering, batching, input transformation, and an optional Enrichment stage (Lambda, StepFunctions, ApiGateway, ApiDestinations)", + "modules": [ + "service/pipes" + ] +} \ No newline at end of file diff --git a/.changelog/67af669e733845edb9ee72ed359b422d.json b/.changelog/67af669e733845edb9ee72ed359b422d.json new file mode 100644 index 00000000000..eff15000da5 --- /dev/null +++ b/.changelog/67af669e733845edb9ee72ed359b422d.json @@ -0,0 +1,8 @@ +{ + "id": "67af669e-7338-45ed-b9ee-72ed359b422d", + "type": "feature", + "description": "Comprehend now supports semi-structured documents (such as PDF files or image files) as inputs for custom analysis using the synchronous APIs (ClassifyDocument and DetectEntities).", + "modules": [ + "service/comprehend" + ] +} \ No newline at end of file diff --git a/.changelog/b5598a71474d40368b89ca9d4776b2a8.json b/.changelog/b5598a71474d40368b89ca9d4776b2a8.json new file mode 100644 index 00000000000..a44bdd5783e --- /dev/null +++ b/.changelog/b5598a71474d40368b89ca9d4776b2a8.json @@ -0,0 +1,8 @@ +{ + "id": "b5598a71-474d-4036-8b89-ca9d4776b2a8", + "type": "feature", + "description": "GameLift introduces a new feature, GameLift Anywhere. GameLift Anywhere allows you to integrate your own compute resources with GameLift. You can also use GameLift Anywhere to iteratively test your game servers without uploading the build to GameLift for every iteration.", + "modules": [ + "service/gamelift" + ] +} \ No newline at end of file diff --git a/service/codecatalyst/LICENSE.txt b/service/codecatalyst/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/codecatalyst/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/codecatalyst/api_client.go b/service/codecatalyst/api_client.go new file mode 100644 index 00000000000..4f482355e1b --- /dev/null +++ b/service/codecatalyst/api_client.go @@ -0,0 +1,420 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "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" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth/bearer" + 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" +) + +const ServiceID = "CodeCatalyst" +const ServiceAPIVersion = "2022-09-28" + +// Client provides the API client to make operations call for Amazon CodeCatalyst. +type Client struct { + options Options +} + +// 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) + + resolveDefaultEndpointConfiguration(&options) + + resolveBearerAuthSigner(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +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 + + // Signer for authenticating requests with bearer auth + BearerAuthSigner bearer.Signer + + // Bearer token value provider + BearerAuthTokenProvider bearer.TokenProvider + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // 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. + EndpointResolver EndpointResolver + + // 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. 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. 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 +} + +// 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...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// 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 (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) + } + + finalizeRetryMaxAttemptOptions(&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 noSmithyDocumentSerde = smithydocument.NoSerde + +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, + BearerAuthTokenProvider: cfg.BearerAuthTokenProvider, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(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 finalizeRetryMaxAttemptOptions(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, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "codecatalyst", goModuleVersion)(stack) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// 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 addBearerAuthSignerMiddleware(stack *middleware.Stack, o Options) error { + return bearer.AddAuthenticationMiddleware(stack, o.BearerAuthSigner, o.BearerAuthTokenProvider) +} + +func resolveBearerAuthSigner(o *Options) { + if o.BearerAuthSigner != nil { + return + } + o.BearerAuthSigner = newDefaultBearerAuthSigner(*o) +} + +func newDefaultBearerAuthSigner(o Options) bearer.Signer { + return bearer.NewSignHTTPSMessage() +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +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) +} diff --git a/service/codecatalyst/api_client_test.go b/service/codecatalyst/api_client_test.go new file mode 100644 index 00000000000..1cab3295e8c --- /dev/null +++ b/service/codecatalyst/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +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, + }) + + 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/codecatalyst/api_op_CreateAccessToken.go b/service/codecatalyst/api_op_CreateAccessToken.go new file mode 100644 index 00000000000..9077771a184 --- /dev/null +++ b/service/codecatalyst/api_op_CreateAccessToken.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a personal access token (PAT) for the current user. A personal access +// token (PAT) is similar to a password. It is associated with your user account. +// You use PATs to access Amazon CodeCatalyst resources such as source repositories +// from third-party applications like Git and integrated development environments +// (IDEs). For more information, see Managing personal access tokens in Amazon +// CodeCatalyst +// (https://docs.aws.amazon.com/codecatalyst/latest/userguide/ipa-tokens-keys.html). +func (c *Client) CreateAccessToken(ctx context.Context, params *CreateAccessTokenInput, optFns ...func(*Options)) (*CreateAccessTokenOutput, error) { + if params == nil { + params = &CreateAccessTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAccessToken", params, optFns, c.addOperationCreateAccessTokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAccessTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAccessTokenInput struct { + + // The friendly name of the personal access token. + // + // This member is required. + Name *string + + // The date and time the personal access token expires, in coordinated universal + // time (UTC) timestamp format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). + ExpiresTime *time.Time + + noSmithyDocumentSerde +} + +type CreateAccessTokenOutput struct { + + // The secret value of the personal access token. + // + // This member is required. + Secret *string + + // The date and time the personal access token expires, in coordinated universal + // time (UTC) timestamp format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). If not specified, the + // default is one year from creation. + ExpiresTime *time.Time + + // The friendly name of the personal access token. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAccessTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAccessToken{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAccessToken{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateAccessTokenValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccessToken(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateAccessToken(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateAccessToken", + } +} diff --git a/service/codecatalyst/api_op_CreateDevEnvironment.go b/service/codecatalyst/api_op_CreateDevEnvironment.go new file mode 100644 index 00000000000..cf67afd7e6a --- /dev/null +++ b/service/codecatalyst/api_op_CreateDevEnvironment.go @@ -0,0 +1,173 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a Dev Environment in Amazon CodeCatalyst, a cloud-based development Dev +// Environment that you can use to quickly work on the code stored in the source +// repositories of your project. By default, a Dev Environment is configured to +// have a 2 core processor, 4GB of RAM, and 16GB of persistent storage. +func (c *Client) CreateDevEnvironment(ctx context.Context, params *CreateDevEnvironmentInput, optFns ...func(*Options)) (*CreateDevEnvironmentOutput, error) { + if params == nil { + params = &CreateDevEnvironmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDevEnvironment", params, optFns, c.addOperationCreateDevEnvironmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDevEnvironmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDevEnvironmentInput struct { + + // The Amazon EC2 instace type to use for the Dev Environment. + // + // This member is required. + InstanceType types.InstanceType + + // Information about the amount of storage allocated to the Dev Environment. By + // default, a Dev Environment is configured to have 16GB of persistent storage. + // Valid values for persistent storage are based on memory sizes in 16GB + // increments. Valid values are 16, 32, and 64. + // + // This member is required. + PersistentStorage *types.PersistentStorageConfiguration + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The user-defined alias for a Dev Environment. + Alias *string + + // A user-specified idempotency token. Idempotency ensures that an API request + // completes only once. With an idempotent request, if the original request + // completes successfully, the subsequent retries return the result from the + // original successful request and have no additional effect. + ClientToken *string + + // Information about the integrated development environment (IDE) configured for a + // Dev Environment. An IDE is required to create a Dev Environment. For Dev + // Environment creation, this field contains configuration information and must be + // provided. + Ides []types.IdeConfiguration + + // The amount of time the Dev Environment will run without any activity detected + // before stopping, in minutes. Only whole integers are allowed. Dev Environments + // consume compute minutes when running. + InactivityTimeoutMinutes int32 + + // The source repository that contains the branch to clone into the Dev + // Environment. + Repositories []types.RepositoryInput + + noSmithyDocumentSerde +} + +type CreateDevEnvironmentOutput struct { + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDevEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDevEnvironment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDevEnvironment{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateDevEnvironmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDevEnvironment(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDevEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDevEnvironment", + } +} diff --git a/service/codecatalyst/api_op_CreateProject.go b/service/codecatalyst/api_op_CreateProject.go new file mode 100644 index 00000000000..71eb0a32efb --- /dev/null +++ b/service/codecatalyst/api_op_CreateProject.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a project in a specified space. +func (c *Client) CreateProject(ctx context.Context, params *CreateProjectInput, optFns ...func(*Options)) (*CreateProjectOutput, error) { + if params == nil { + params = &CreateProjectInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateProject", params, optFns, c.addOperationCreateProjectMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateProjectOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateProjectInput struct { + + // The friendly name of the project that will be displayed to users. + // + // This member is required. + DisplayName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The description of the project. This description will be displayed to all users + // of the project. We recommend providing a brief description of the project and + // its intended purpose. + Description *string + + noSmithyDocumentSerde +} + +type CreateProjectOutput struct { + + // The name of the project in the space. + // + // This member is required. + Name *string + + // The description of the project. + Description *string + + // The friendly name of the project. + DisplayName *string + + // The name of the space. + SpaceName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateProjectMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProject{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProject{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateProjectValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProject(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateProject(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateProject", + } +} diff --git a/service/codecatalyst/api_op_CreateSourceRepositoryBranch.go b/service/codecatalyst/api_op_CreateSourceRepositoryBranch.go new file mode 100644 index 00000000000..56c3ba92479 --- /dev/null +++ b/service/codecatalyst/api_op_CreateSourceRepositoryBranch.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a branch in a specified source repository in Amazon CodeCatalyst. This +// API only creates a branch in a source repository hosted in Amazon CodeCatalyst. +// You cannot use this API to create a branch in a linked repository. +func (c *Client) CreateSourceRepositoryBranch(ctx context.Context, params *CreateSourceRepositoryBranchInput, optFns ...func(*Options)) (*CreateSourceRepositoryBranchOutput, error) { + if params == nil { + params = &CreateSourceRepositoryBranchInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSourceRepositoryBranch", params, optFns, c.addOperationCreateSourceRepositoryBranchMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSourceRepositoryBranchOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSourceRepositoryBranchInput struct { + + // The name for the branch you're creating. + // + // This member is required. + Name *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the repository where you want to create a branch. + // + // This member is required. + SourceRepositoryName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The commit ID in an existing branch from which you want to create the new + // branch. + HeadCommitId *string + + noSmithyDocumentSerde +} + +type CreateSourceRepositoryBranchOutput struct { + + // The commit ID of the tip of the newly created branch. + HeadCommitId *string + + // The time the branch was last updated, in coordinated universal time (UTC) + // timestamp format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). + LastUpdatedTime *time.Time + + // The name of the newly created branch. + Name *string + + // The Git reference name of the branch. + Ref *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSourceRepositoryBranchMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSourceRepositoryBranch{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSourceRepositoryBranch{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateSourceRepositoryBranchValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSourceRepositoryBranch(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateSourceRepositoryBranch(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateSourceRepositoryBranch", + } +} diff --git a/service/codecatalyst/api_op_DeleteAccessToken.go b/service/codecatalyst/api_op_DeleteAccessToken.go new file mode 100644 index 00000000000..b176423f2bc --- /dev/null +++ b/service/codecatalyst/api_op_DeleteAccessToken.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + 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 specified personal access token (PAT). A personal access token can +// only be deleted by the user who created it. +func (c *Client) DeleteAccessToken(ctx context.Context, params *DeleteAccessTokenInput, optFns ...func(*Options)) (*DeleteAccessTokenOutput, error) { + if params == nil { + params = &DeleteAccessTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAccessToken", params, optFns, c.addOperationDeleteAccessTokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAccessTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAccessTokenInput struct { + + // The ID of the personal access token to delete. You can find the IDs of all PATs + // associated with your user account by calling ListAccessTokens. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteAccessTokenOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAccessTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAccessToken{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAccessToken{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteAccessTokenValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccessToken(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAccessToken(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteAccessToken", + } +} diff --git a/service/codecatalyst/api_op_DeleteDevEnvironment.go b/service/codecatalyst/api_op_DeleteDevEnvironment.go new file mode 100644 index 00000000000..4ec89c5f622 --- /dev/null +++ b/service/codecatalyst/api_op_DeleteDevEnvironment.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + 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 Dev Environment. +func (c *Client) DeleteDevEnvironment(ctx context.Context, params *DeleteDevEnvironmentInput, optFns ...func(*Options)) (*DeleteDevEnvironmentOutput, error) { + if params == nil { + params = &DeleteDevEnvironmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDevEnvironment", params, optFns, c.addOperationDeleteDevEnvironmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDevEnvironmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDevEnvironmentInput struct { + + // The system-generated unique ID of the Dev Environment you want to delete. To + // retrieve a list of Dev Environment IDs, use ListDevEnvironments. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + noSmithyDocumentSerde +} + +type DeleteDevEnvironmentOutput struct { + + // The system-generated unique ID of the deleted Dev Environment. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDevEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDevEnvironment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDevEnvironment{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteDevEnvironmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDevEnvironment(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDevEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDevEnvironment", + } +} diff --git a/service/codecatalyst/api_op_GetDevEnvironment.go b/service/codecatalyst/api_op_GetDevEnvironment.go new file mode 100644 index 00000000000..799fa02b56b --- /dev/null +++ b/service/codecatalyst/api_op_GetDevEnvironment.go @@ -0,0 +1,190 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns information about a Dev Environment for a source repository in a +// project. Dev Environments are specific to the user who creates them. +func (c *Client) GetDevEnvironment(ctx context.Context, params *GetDevEnvironmentInput, optFns ...func(*Options)) (*GetDevEnvironmentOutput, error) { + if params == nil { + params = &GetDevEnvironmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDevEnvironment", params, optFns, c.addOperationGetDevEnvironmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDevEnvironmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDevEnvironmentInput struct { + + // The system-generated unique ID of the Dev Environment for which you want to view + // information. To retrieve a list of Dev Environment IDs, use ListDevEnvironments. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + noSmithyDocumentSerde +} + +type GetDevEnvironmentOutput struct { + + // The system-generated unique ID of the user who created the Dev Environment. + // + // This member is required. + CreatorId *string + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + Id *string + + // The amount of time the Dev Environment will run without any activity detected + // before stopping, in minutes. + // + // This member is required. + InactivityTimeoutMinutes int32 + + // The Amazon EC2 instace type to use for the Dev Environment. + // + // This member is required. + InstanceType types.InstanceType + + // The time when the Dev Environment was last updated, in coordinated universal + // time (UTC) timestamp format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). + // + // This member is required. + LastUpdatedTime *time.Time + + // Information about the amount of storage allocated to the Dev Environment. By + // default, a Dev Environment is configured to have 16GB of persistent storage. + // + // This member is required. + PersistentStorage *types.PersistentStorage + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The source repository that contains the branch cloned into the Dev Environment. + // + // This member is required. + Repositories []types.DevEnvironmentRepositorySummary + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The current status of the Dev Environment. + // + // This member is required. + Status types.DevEnvironmentStatus + + // The user-specified alias for the Dev Environment. + Alias *string + + // Information about the integrated development environment (IDE) configured for + // the Dev Environment. + Ides []types.Ide + + // The reason for the status. + StatusReason *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDevEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDevEnvironment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDevEnvironment{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetDevEnvironmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDevEnvironment(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetDevEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetDevEnvironment", + } +} diff --git a/service/codecatalyst/api_op_GetProject.go b/service/codecatalyst/api_op_GetProject.go new file mode 100644 index 00000000000..79b8a88bff3 --- /dev/null +++ b/service/codecatalyst/api_op_GetProject.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a project. +func (c *Client) GetProject(ctx context.Context, params *GetProjectInput, optFns ...func(*Options)) (*GetProjectOutput, error) { + if params == nil { + params = &GetProjectInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetProject", params, optFns, c.addOperationGetProjectMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetProjectOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetProjectInput struct { + + // The name of the project in the space. + // + // This member is required. + Name *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + noSmithyDocumentSerde +} + +type GetProjectOutput struct { + + // The name of the project in the space. + // + // This member is required. + Name *string + + // The description of the project. + Description *string + + // The friendly name of the project displayed to users in Amazon CodeCatalyst. + DisplayName *string + + // The name of the space. + SpaceName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetProjectMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetProject{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetProject{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetProjectValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetProject(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetProject(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetProject", + } +} diff --git a/service/codecatalyst/api_op_GetSourceRepositoryCloneUrls.go b/service/codecatalyst/api_op_GetSourceRepositoryCloneUrls.go new file mode 100644 index 00000000000..74762f8faed --- /dev/null +++ b/service/codecatalyst/api_op_GetSourceRepositoryCloneUrls.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about the URLs that can be used with a Git client to clone a +// source repository. +func (c *Client) GetSourceRepositoryCloneUrls(ctx context.Context, params *GetSourceRepositoryCloneUrlsInput, optFns ...func(*Options)) (*GetSourceRepositoryCloneUrlsOutput, error) { + if params == nil { + params = &GetSourceRepositoryCloneUrlsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSourceRepositoryCloneUrls", params, optFns, c.addOperationGetSourceRepositoryCloneUrlsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSourceRepositoryCloneUrlsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSourceRepositoryCloneUrlsInput struct { + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the source repository. + // + // This member is required. + SourceRepositoryName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + noSmithyDocumentSerde +} + +type GetSourceRepositoryCloneUrlsOutput struct { + + // The HTTPS URL to use when cloning the source repository. + // + // This member is required. + Https *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSourceRepositoryCloneUrlsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSourceRepositoryCloneUrls{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSourceRepositoryCloneUrls{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetSourceRepositoryCloneUrlsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSourceRepositoryCloneUrls(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetSourceRepositoryCloneUrls(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSourceRepositoryCloneUrls", + } +} diff --git a/service/codecatalyst/api_op_GetSpace.go b/service/codecatalyst/api_op_GetSpace.go new file mode 100644 index 00000000000..693e3cd9f44 --- /dev/null +++ b/service/codecatalyst/api_op_GetSpace.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about an space. +func (c *Client) GetSpace(ctx context.Context, params *GetSpaceInput, optFns ...func(*Options)) (*GetSpaceOutput, error) { + if params == nil { + params = &GetSpaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSpace", params, optFns, c.addOperationGetSpaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSpaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSpaceInput struct { + + // The name of the space. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type GetSpaceOutput struct { + + // The name of the space. + // + // This member is required. + Name *string + + // The Amazon Web Services Region where the space exists. + // + // This member is required. + RegionName *string + + // The description of the space. + Description *string + + // The friendly name of the space displayed to users. + DisplayName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSpaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSpace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSpace{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetSpaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSpace(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetSpace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSpace", + } +} diff --git a/service/codecatalyst/api_op_GetSubscription.go b/service/codecatalyst/api_op_GetSubscription.go new file mode 100644 index 00000000000..26408c17d9c --- /dev/null +++ b/service/codecatalyst/api_op_GetSubscription.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about the Amazon Web Services account used for billing +// purposes and the billing plan for the space. +func (c *Client) GetSubscription(ctx context.Context, params *GetSubscriptionInput, optFns ...func(*Options)) (*GetSubscriptionOutput, error) { + if params == nil { + params = &GetSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSubscription", params, optFns, c.addOperationGetSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSubscriptionInput struct { + + // The name of the space. + // + // This member is required. + SpaceName *string + + noSmithyDocumentSerde +} + +type GetSubscriptionOutput struct { + + // The display name of the Amazon Web Services account used for billing for the + // space. + AwsAccountName *string + + // The type of the billing plan for the space. + SubscriptionType *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSubscription{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSubscription(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSubscription", + } +} diff --git a/service/codecatalyst/api_op_GetUserDetails.go b/service/codecatalyst/api_op_GetUserDetails.go new file mode 100644 index 00000000000..43e06b4b807 --- /dev/null +++ b/service/codecatalyst/api_op_GetUserDetails.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a user. +func (c *Client) GetUserDetails(ctx context.Context, params *GetUserDetailsInput, optFns ...func(*Options)) (*GetUserDetailsOutput, error) { + if params == nil { + params = &GetUserDetailsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetUserDetails", params, optFns, c.addOperationGetUserDetailsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetUserDetailsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetUserDetailsInput struct { + + // The system-generated unique ID of the user. + Id *string + + // The name of the user as displayed in Amazon CodeCatalyst. + UserName *string + + noSmithyDocumentSerde +} + +type GetUserDetailsOutput struct { + + // The friendly name displayed for the user in Amazon CodeCatalyst. + DisplayName *string + + // The email address provided by the user when they signed up. + PrimaryEmail *types.EmailAddress + + // The system-generated unique ID of the user. + UserId *string + + // The name of the user as displayed in Amazon CodeCatalyst. + UserName *string + + // + Version *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetUserDetailsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetUserDetails{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetUserDetails{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetUserDetails(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetUserDetails(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetUserDetails", + } +} diff --git a/service/codecatalyst/api_op_ListAccessTokens.go b/service/codecatalyst/api_op_ListAccessTokens.go new file mode 100644 index 00000000000..2d15d6b6225 --- /dev/null +++ b/service/codecatalyst/api_op_ListAccessTokens.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all personal access tokens (PATs) associated with the user who calls the +// API. You can only list PATs associated with your user account. +func (c *Client) ListAccessTokens(ctx context.Context, params *ListAccessTokensInput, optFns ...func(*Options)) (*ListAccessTokensOutput, error) { + if params == nil { + params = &ListAccessTokensInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAccessTokens", params, optFns, c.addOperationListAccessTokensMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAccessTokensOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAccessTokensInput struct { + + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional results. + MaxResults *int32 + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAccessTokensOutput struct { + + // A list of personal access tokens (PATs) associated with the calling user. + // + // This member is required. + Items []types.AccessTokenSummary + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAccessTokensMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccessTokens{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccessTokens{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessTokens(options.Region), middleware.Before); 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 + } + return nil +} + +// ListAccessTokensAPIClient is a client that implements the ListAccessTokens +// operation. +type ListAccessTokensAPIClient interface { + ListAccessTokens(context.Context, *ListAccessTokensInput, ...func(*Options)) (*ListAccessTokensOutput, error) +} + +var _ ListAccessTokensAPIClient = (*Client)(nil) + +// ListAccessTokensPaginatorOptions is the paginator options for ListAccessTokens +type ListAccessTokensPaginatorOptions struct { + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional 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 +} + +// ListAccessTokensPaginator is a paginator for ListAccessTokens +type ListAccessTokensPaginator struct { + options ListAccessTokensPaginatorOptions + client ListAccessTokensAPIClient + params *ListAccessTokensInput + nextToken *string + firstPage bool +} + +// NewListAccessTokensPaginator returns a new ListAccessTokensPaginator +func NewListAccessTokensPaginator(client ListAccessTokensAPIClient, params *ListAccessTokensInput, optFns ...func(*ListAccessTokensPaginatorOptions)) *ListAccessTokensPaginator { + if params == nil { + params = &ListAccessTokensInput{} + } + + options := ListAccessTokensPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAccessTokensPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccessTokensPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAccessTokens page. +func (p *ListAccessTokensPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessTokensOutput, 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 + + result, err := p.client.ListAccessTokens(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 +} + +func newServiceMetadataMiddleware_opListAccessTokens(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAccessTokens", + } +} diff --git a/service/codecatalyst/api_op_ListDevEnvironments.go b/service/codecatalyst/api_op_ListDevEnvironments.go new file mode 100644 index 00000000000..6220e3ac560 --- /dev/null +++ b/service/codecatalyst/api_op_ListDevEnvironments.go @@ -0,0 +1,233 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrives a list of Dev Environments in a project. +func (c *Client) ListDevEnvironments(ctx context.Context, params *ListDevEnvironmentsInput, optFns ...func(*Options)) (*ListDevEnvironmentsOutput, error) { + if params == nil { + params = &ListDevEnvironmentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDevEnvironments", params, optFns, c.addOperationListDevEnvironmentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDevEnvironmentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDevEnvironmentsInput struct { + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // Information about filters to apply to narrow the results returned in the list. + Filters []types.Filter + + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional results. + MaxResults *int32 + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + noSmithyDocumentSerde +} + +type ListDevEnvironmentsOutput struct { + + // Information about the Dev Environments in a project. + // + // This member is required. + Items []types.DevEnvironmentSummary + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDevEnvironmentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListDevEnvironments{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDevEnvironments{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpListDevEnvironmentsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDevEnvironments(options.Region), middleware.Before); 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 + } + return nil +} + +// ListDevEnvironmentsAPIClient is a client that implements the ListDevEnvironments +// operation. +type ListDevEnvironmentsAPIClient interface { + ListDevEnvironments(context.Context, *ListDevEnvironmentsInput, ...func(*Options)) (*ListDevEnvironmentsOutput, error) +} + +var _ ListDevEnvironmentsAPIClient = (*Client)(nil) + +// ListDevEnvironmentsPaginatorOptions is the paginator options for +// ListDevEnvironments +type ListDevEnvironmentsPaginatorOptions struct { + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional 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 +} + +// ListDevEnvironmentsPaginator is a paginator for ListDevEnvironments +type ListDevEnvironmentsPaginator struct { + options ListDevEnvironmentsPaginatorOptions + client ListDevEnvironmentsAPIClient + params *ListDevEnvironmentsInput + nextToken *string + firstPage bool +} + +// NewListDevEnvironmentsPaginator returns a new ListDevEnvironmentsPaginator +func NewListDevEnvironmentsPaginator(client ListDevEnvironmentsAPIClient, params *ListDevEnvironmentsInput, optFns ...func(*ListDevEnvironmentsPaginatorOptions)) *ListDevEnvironmentsPaginator { + if params == nil { + params = &ListDevEnvironmentsInput{} + } + + options := ListDevEnvironmentsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListDevEnvironmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevEnvironmentsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListDevEnvironments page. +func (p *ListDevEnvironmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevEnvironmentsOutput, 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 + + result, err := p.client.ListDevEnvironments(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 +} + +func newServiceMetadataMiddleware_opListDevEnvironments(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListDevEnvironments", + } +} diff --git a/service/codecatalyst/api_op_ListEventLogs.go b/service/codecatalyst/api_op_ListEventLogs.go new file mode 100644 index 00000000000..08c8d30de94 --- /dev/null +++ b/service/codecatalyst/api_op_ListEventLogs.go @@ -0,0 +1,242 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves a list of events that occurred during a specified time period in a +// space. You can use these events to audit user and system activity in a space. +func (c *Client) ListEventLogs(ctx context.Context, params *ListEventLogsInput, optFns ...func(*Options)) (*ListEventLogsOutput, error) { + if params == nil { + params = &ListEventLogsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListEventLogs", params, optFns, c.addOperationListEventLogsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListEventLogsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListEventLogsInput struct { + + // The time after which you do not want any events retrieved, in coordinated + // universal time (UTC) timestamp format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). + // + // This member is required. + EndTime *time.Time + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The date and time when you want to start retrieving events, in coordinated + // universal time (UTC) timestamp format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). + // + // This member is required. + StartTime *time.Time + + // The name of the event. + EventName *string + + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional results. + MaxResults *int32 + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + noSmithyDocumentSerde +} + +type ListEventLogsOutput struct { + + // Information about each event retrieved in the list. + // + // This member is required. + Items []types.EventLogEntry + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListEventLogsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListEventLogs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEventLogs{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpListEventLogsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEventLogs(options.Region), middleware.Before); 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 + } + return nil +} + +// ListEventLogsAPIClient is a client that implements the ListEventLogs operation. +type ListEventLogsAPIClient interface { + ListEventLogs(context.Context, *ListEventLogsInput, ...func(*Options)) (*ListEventLogsOutput, error) +} + +var _ ListEventLogsAPIClient = (*Client)(nil) + +// ListEventLogsPaginatorOptions is the paginator options for ListEventLogs +type ListEventLogsPaginatorOptions struct { + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional 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 +} + +// ListEventLogsPaginator is a paginator for ListEventLogs +type ListEventLogsPaginator struct { + options ListEventLogsPaginatorOptions + client ListEventLogsAPIClient + params *ListEventLogsInput + nextToken *string + firstPage bool +} + +// NewListEventLogsPaginator returns a new ListEventLogsPaginator +func NewListEventLogsPaginator(client ListEventLogsAPIClient, params *ListEventLogsInput, optFns ...func(*ListEventLogsPaginatorOptions)) *ListEventLogsPaginator { + if params == nil { + params = &ListEventLogsInput{} + } + + options := ListEventLogsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListEventLogsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventLogsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListEventLogs page. +func (p *ListEventLogsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventLogsOutput, 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 + + result, err := p.client.ListEventLogs(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 +} + +func newServiceMetadataMiddleware_opListEventLogs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListEventLogs", + } +} diff --git a/service/codecatalyst/api_op_ListProjects.go b/service/codecatalyst/api_op_ListProjects.go new file mode 100644 index 00000000000..06c495c5211 --- /dev/null +++ b/service/codecatalyst/api_op_ListProjects.go @@ -0,0 +1,224 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of projects. +func (c *Client) ListProjects(ctx context.Context, params *ListProjectsInput, optFns ...func(*Options)) (*ListProjectsOutput, error) { + if params == nil { + params = &ListProjectsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListProjects", params, optFns, c.addOperationListProjectsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListProjectsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListProjectsInput struct { + + // The name of the space. + // + // This member is required. + SpaceName *string + + // Information about filters to apply to narrow the results returned in the list. + Filters []types.ProjectListFilter + + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional results. + MaxResults *int32 + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + noSmithyDocumentSerde +} + +type ListProjectsOutput struct { + + // Information about the projects. + Items []types.ProjectSummary + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListProjectsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListProjects{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProjects{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpListProjectsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProjects(options.Region), middleware.Before); 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 + } + return nil +} + +// ListProjectsAPIClient is a client that implements the ListProjects operation. +type ListProjectsAPIClient interface { + ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) +} + +var _ ListProjectsAPIClient = (*Client)(nil) + +// ListProjectsPaginatorOptions is the paginator options for ListProjects +type ListProjectsPaginatorOptions struct { + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional 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 +} + +// ListProjectsPaginator is a paginator for ListProjects +type ListProjectsPaginator struct { + options ListProjectsPaginatorOptions + client ListProjectsAPIClient + params *ListProjectsInput + nextToken *string + firstPage bool +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + if params == nil { + params = &ListProjectsInput{} + } + + options := ListProjectsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListProjects page. +func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, 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 + + result, err := p.client.ListProjects(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 +} + +func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListProjects", + } +} diff --git a/service/codecatalyst/api_op_ListSourceRepositories.go b/service/codecatalyst/api_op_ListSourceRepositories.go new file mode 100644 index 00000000000..db14a4bf22e --- /dev/null +++ b/service/codecatalyst/api_op_ListSourceRepositories.go @@ -0,0 +1,228 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of source repositories in a project. +func (c *Client) ListSourceRepositories(ctx context.Context, params *ListSourceRepositoriesInput, optFns ...func(*Options)) (*ListSourceRepositoriesOutput, error) { + if params == nil { + params = &ListSourceRepositoriesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSourceRepositories", params, optFns, c.addOperationListSourceRepositoriesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSourceRepositoriesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSourceRepositoriesInput struct { + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional results. + MaxResults *int32 + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSourceRepositoriesOutput struct { + + // Information about the source repositories. + Items []types.ListSourceRepositoriesItem + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSourceRepositoriesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSourceRepositories{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSourceRepositories{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpListSourceRepositoriesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSourceRepositories(options.Region), middleware.Before); 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 + } + return nil +} + +// ListSourceRepositoriesAPIClient is a client that implements the +// ListSourceRepositories operation. +type ListSourceRepositoriesAPIClient interface { + ListSourceRepositories(context.Context, *ListSourceRepositoriesInput, ...func(*Options)) (*ListSourceRepositoriesOutput, error) +} + +var _ ListSourceRepositoriesAPIClient = (*Client)(nil) + +// ListSourceRepositoriesPaginatorOptions is the paginator options for +// ListSourceRepositories +type ListSourceRepositoriesPaginatorOptions struct { + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional 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 +} + +// ListSourceRepositoriesPaginator is a paginator for ListSourceRepositories +type ListSourceRepositoriesPaginator struct { + options ListSourceRepositoriesPaginatorOptions + client ListSourceRepositoriesAPIClient + params *ListSourceRepositoriesInput + nextToken *string + firstPage bool +} + +// NewListSourceRepositoriesPaginator returns a new ListSourceRepositoriesPaginator +func NewListSourceRepositoriesPaginator(client ListSourceRepositoriesAPIClient, params *ListSourceRepositoriesInput, optFns ...func(*ListSourceRepositoriesPaginatorOptions)) *ListSourceRepositoriesPaginator { + if params == nil { + params = &ListSourceRepositoriesInput{} + } + + options := ListSourceRepositoriesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSourceRepositoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSourceRepositoriesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSourceRepositories page. +func (p *ListSourceRepositoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSourceRepositoriesOutput, 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 + + result, err := p.client.ListSourceRepositories(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 +} + +func newServiceMetadataMiddleware_opListSourceRepositories(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListSourceRepositories", + } +} diff --git a/service/codecatalyst/api_op_ListSourceRepositoryBranches.go b/service/codecatalyst/api_op_ListSourceRepositoryBranches.go new file mode 100644 index 00000000000..4f2013e6bbb --- /dev/null +++ b/service/codecatalyst/api_op_ListSourceRepositoryBranches.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of branches in a specified source repository. +func (c *Client) ListSourceRepositoryBranches(ctx context.Context, params *ListSourceRepositoryBranchesInput, optFns ...func(*Options)) (*ListSourceRepositoryBranchesOutput, error) { + if params == nil { + params = &ListSourceRepositoryBranchesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSourceRepositoryBranches", params, optFns, c.addOperationListSourceRepositoryBranchesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSourceRepositoryBranchesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSourceRepositoryBranchesInput struct { + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the source repository. + // + // This member is required. + SourceRepositoryName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional results. + MaxResults *int32 + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSourceRepositoryBranchesOutput struct { + + // Information about the source branches. + Items []types.ListSourceRepositoryBranchesItem + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSourceRepositoryBranchesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSourceRepositoryBranches{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSourceRepositoryBranches{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpListSourceRepositoryBranchesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSourceRepositoryBranches(options.Region), middleware.Before); 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 + } + return nil +} + +// ListSourceRepositoryBranchesAPIClient is a client that implements the +// ListSourceRepositoryBranches operation. +type ListSourceRepositoryBranchesAPIClient interface { + ListSourceRepositoryBranches(context.Context, *ListSourceRepositoryBranchesInput, ...func(*Options)) (*ListSourceRepositoryBranchesOutput, error) +} + +var _ ListSourceRepositoryBranchesAPIClient = (*Client)(nil) + +// ListSourceRepositoryBranchesPaginatorOptions is the paginator options for +// ListSourceRepositoryBranches +type ListSourceRepositoryBranchesPaginatorOptions struct { + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional 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 +} + +// ListSourceRepositoryBranchesPaginator is a paginator for +// ListSourceRepositoryBranches +type ListSourceRepositoryBranchesPaginator struct { + options ListSourceRepositoryBranchesPaginatorOptions + client ListSourceRepositoryBranchesAPIClient + params *ListSourceRepositoryBranchesInput + nextToken *string + firstPage bool +} + +// NewListSourceRepositoryBranchesPaginator returns a new +// ListSourceRepositoryBranchesPaginator +func NewListSourceRepositoryBranchesPaginator(client ListSourceRepositoryBranchesAPIClient, params *ListSourceRepositoryBranchesInput, optFns ...func(*ListSourceRepositoryBranchesPaginatorOptions)) *ListSourceRepositoryBranchesPaginator { + if params == nil { + params = &ListSourceRepositoryBranchesInput{} + } + + options := ListSourceRepositoryBranchesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSourceRepositoryBranchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSourceRepositoryBranchesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSourceRepositoryBranches page. +func (p *ListSourceRepositoryBranchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSourceRepositoryBranchesOutput, 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 + + result, err := p.client.ListSourceRepositoryBranches(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 +} + +func newServiceMetadataMiddleware_opListSourceRepositoryBranches(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListSourceRepositoryBranches", + } +} diff --git a/service/codecatalyst/api_op_ListSpaces.go b/service/codecatalyst/api_op_ListSpaces.go new file mode 100644 index 00000000000..4b05cd13c4e --- /dev/null +++ b/service/codecatalyst/api_op_ListSpaces.go @@ -0,0 +1,194 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of spaces. +func (c *Client) ListSpaces(ctx context.Context, params *ListSpacesInput, optFns ...func(*Options)) (*ListSpacesOutput, error) { + if params == nil { + params = &ListSpacesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSpaces", params, optFns, c.addOperationListSpacesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSpacesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSpacesInput struct { + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSpacesOutput struct { + + // Information about the space. + Items []types.SpaceSummary + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSpacesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSpaces{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSpaces{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSpaces(options.Region), middleware.Before); 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 + } + return nil +} + +// ListSpacesAPIClient is a client that implements the ListSpaces operation. +type ListSpacesAPIClient interface { + ListSpaces(context.Context, *ListSpacesInput, ...func(*Options)) (*ListSpacesOutput, error) +} + +var _ ListSpacesAPIClient = (*Client)(nil) + +// ListSpacesPaginatorOptions is the paginator options for ListSpaces +type ListSpacesPaginatorOptions struct { + // 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 +} + +// ListSpacesPaginator is a paginator for ListSpaces +type ListSpacesPaginator struct { + options ListSpacesPaginatorOptions + client ListSpacesAPIClient + params *ListSpacesInput + nextToken *string + firstPage bool +} + +// NewListSpacesPaginator returns a new ListSpacesPaginator +func NewListSpacesPaginator(client ListSpacesAPIClient, params *ListSpacesInput, optFns ...func(*ListSpacesPaginatorOptions)) *ListSpacesPaginator { + if params == nil { + params = &ListSpacesInput{} + } + + options := ListSpacesPaginatorOptions{} + + for _, fn := range optFns { + fn(&options) + } + + return &ListSpacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSpacesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSpaces page. +func (p *ListSpacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSpacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + result, err := p.client.ListSpaces(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 +} + +func newServiceMetadataMiddleware_opListSpaces(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListSpaces", + } +} diff --git a/service/codecatalyst/api_op_StartDevEnvironment.go b/service/codecatalyst/api_op_StartDevEnvironment.go new file mode 100644 index 00000000000..7f173546b56 --- /dev/null +++ b/service/codecatalyst/api_op_StartDevEnvironment.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts a specified Dev Environment and puts it into an active state. +func (c *Client) StartDevEnvironment(ctx context.Context, params *StartDevEnvironmentInput, optFns ...func(*Options)) (*StartDevEnvironmentOutput, error) { + if params == nil { + params = &StartDevEnvironmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartDevEnvironment", params, optFns, c.addOperationStartDevEnvironmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartDevEnvironmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartDevEnvironmentInput struct { + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // Information about the integrated development environment (IDE) configured for a + // Dev Environment. + Ides []types.IdeConfiguration + + // The amount of time the Dev Environment will run without any activity detected + // before stopping, in minutes. Only whole integers are allowed. Dev Environments + // consume compute minutes when running. + InactivityTimeoutMinutes int32 + + // The Amazon EC2 instace type to use for the Dev Environment. + InstanceType types.InstanceType + + noSmithyDocumentSerde +} + +type StartDevEnvironmentOutput struct { + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The status of the Dev Environment. + // + // This member is required. + Status types.DevEnvironmentStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartDevEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartDevEnvironment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartDevEnvironment{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartDevEnvironmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDevEnvironment(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opStartDevEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartDevEnvironment", + } +} diff --git a/service/codecatalyst/api_op_StartDevEnvironmentSession.go b/service/codecatalyst/api_op_StartDevEnvironmentSession.go new file mode 100644 index 00000000000..f03205eff98 --- /dev/null +++ b/service/codecatalyst/api_op_StartDevEnvironmentSession.go @@ -0,0 +1,151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts a session for a specified Dev Environment. +func (c *Client) StartDevEnvironmentSession(ctx context.Context, params *StartDevEnvironmentSessionInput, optFns ...func(*Options)) (*StartDevEnvironmentSessionOutput, error) { + if params == nil { + params = &StartDevEnvironmentSessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartDevEnvironmentSession", params, optFns, c.addOperationStartDevEnvironmentSessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartDevEnvironmentSessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartDevEnvironmentSessionInput struct { + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // Information about the configuration of a Dev Environment session. + // + // This member is required. + SessionConfiguration *types.DevEnvironmentSessionConfiguration + + // The name of the space. + // + // This member is required. + SpaceName *string + + noSmithyDocumentSerde +} + +type StartDevEnvironmentSessionOutput struct { + + // Information about connection details for a Dev Environment. + // + // This member is required. + AccessDetails *types.DevEnvironmentAccessDetails + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The system-generated unique ID of the Dev Environment session. + SessionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartDevEnvironmentSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartDevEnvironmentSession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartDevEnvironmentSession{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartDevEnvironmentSessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDevEnvironmentSession(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opStartDevEnvironmentSession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartDevEnvironmentSession", + } +} diff --git a/service/codecatalyst/api_op_StopDevEnvironment.go b/service/codecatalyst/api_op_StopDevEnvironment.go new file mode 100644 index 00000000000..ed35290b6aa --- /dev/null +++ b/service/codecatalyst/api_op_StopDevEnvironment.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Pauses a specified Dev Environment and places it in a non-running state. Stopped +// Dev Environments do not consume compute minutes. +func (c *Client) StopDevEnvironment(ctx context.Context, params *StopDevEnvironmentInput, optFns ...func(*Options)) (*StopDevEnvironmentOutput, error) { + if params == nil { + params = &StopDevEnvironmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopDevEnvironment", params, optFns, c.addOperationStopDevEnvironmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopDevEnvironmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopDevEnvironmentInput struct { + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + noSmithyDocumentSerde +} + +type StopDevEnvironmentOutput struct { + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The status of the Dev Environment. + // + // This member is required. + Status types.DevEnvironmentStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopDevEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStopDevEnvironment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopDevEnvironment{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpStopDevEnvironmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopDevEnvironment(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opStopDevEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StopDevEnvironment", + } +} diff --git a/service/codecatalyst/api_op_UpdateDevEnvironment.go b/service/codecatalyst/api_op_UpdateDevEnvironment.go new file mode 100644 index 00000000000..343966a84f9 --- /dev/null +++ b/service/codecatalyst/api_op_UpdateDevEnvironment.go @@ -0,0 +1,183 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Changes one or more values for a Dev Environment. Updating certain values of the +// Dev Environment will cause a restart. +func (c *Client) UpdateDevEnvironment(ctx context.Context, params *UpdateDevEnvironmentInput, optFns ...func(*Options)) (*UpdateDevEnvironmentOutput, error) { + if params == nil { + params = &UpdateDevEnvironmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateDevEnvironment", params, optFns, c.addOperationUpdateDevEnvironmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateDevEnvironmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateDevEnvironmentInput struct { + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The user-specified alias for the Dev Environment. Changing this value will not + // cause a restart. + Alias *string + + // A user-specified idempotency token. Idempotency ensures that an API request + // completes only once. With an idempotent request, if the original request + // completes successfully, the subsequent retries return the result from the + // original successful request and have no additional effect. + ClientToken *string + + // Information about the integrated development environment (IDE) configured for a + // Dev Environment. + Ides []types.IdeConfiguration + + // The amount of time the Dev Environment will run without any activity detected + // before stopping, in minutes. Only whole integers are allowed. Dev Environments + // consume compute minutes when running. Changing this value will cause a restart + // of the Dev Environment if it is running. + InactivityTimeoutMinutes int32 + + // The Amazon EC2 instace type to use for the Dev Environment. Changing this value + // will cause a restart of the Dev Environment if it is running. + InstanceType types.InstanceType + + noSmithyDocumentSerde +} + +type UpdateDevEnvironmentOutput struct { + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The user-specified alias for the Dev Environment. + Alias *string + + // A user-specified idempotency token. Idempotency ensures that an API request + // completes only once. With an idempotent request, if the original request + // completes successfully, the subsequent retries return the result from the + // original successful request and have no additional effect. + ClientToken *string + + // Information about the integrated development environment (IDE) configured for + // the Dev Environment. + Ides []types.IdeConfiguration + + // The amount of time the Dev Environment will run without any activity detected + // before stopping, in minutes. + InactivityTimeoutMinutes int32 + + // The Amazon EC2 instace type to use for the Dev Environment. + InstanceType types.InstanceType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateDevEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDevEnvironment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDevEnvironment{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateDevEnvironmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDevEnvironment(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateDevEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateDevEnvironment", + } +} diff --git a/service/codecatalyst/api_op_VerifySession.go b/service/codecatalyst/api_op_VerifySession.go new file mode 100644 index 00000000000..9e09b217f99 --- /dev/null +++ b/service/codecatalyst/api_op_VerifySession.go @@ -0,0 +1,107 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Verifies whether the calling user has a valid Amazon CodeCatalyst login and +// session. If successful, this returns the ID of the user in Amazon CodeCatalyst. +func (c *Client) VerifySession(ctx context.Context, params *VerifySessionInput, optFns ...func(*Options)) (*VerifySessionOutput, error) { + if params == nil { + params = &VerifySessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "VerifySession", params, optFns, c.addOperationVerifySessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*VerifySessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type VerifySessionInput struct { + noSmithyDocumentSerde +} + +type VerifySessionOutput struct { + + // The system-generated unique ID of the user in Amazon CodeCatalyst. + Identity *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationVerifySessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpVerifySession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpVerifySession{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opVerifySession(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opVerifySession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "VerifySession", + } +} diff --git a/service/codecatalyst/deserializers.go b/service/codecatalyst/deserializers.go new file mode 100644 index 00000000000..2eb914cf5d1 --- /dev/null +++ b/service/codecatalyst/deserializers.go @@ -0,0 +1,6325 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/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" + "strings" +) + +type awsRestjson1_deserializeOpCreateAccessToken struct { +} + +func (*awsRestjson1_deserializeOpCreateAccessToken) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateAccessToken) 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_deserializeOpErrorCreateAccessToken(response, &metadata) + } + output := &CreateAccessTokenOutput{} + 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_deserializeOpDocumentCreateAccessTokenOutput(&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_deserializeOpErrorCreateAccessToken(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentCreateAccessTokenOutput(v **CreateAccessTokenOutput, 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 *CreateAccessTokenOutput + if *v == nil { + sv = &CreateAccessTokenOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "expiresTime": + 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.ExpiresTime = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessTokenName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "secret": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessTokenSecret to be of type string, got %T instead", value) + } + sv.Secret = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateDevEnvironment struct { +} + +func (*awsRestjson1_deserializeOpCreateDevEnvironment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateDevEnvironment) 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_deserializeOpErrorCreateDevEnvironment(response, &metadata) + } + output := &CreateDevEnvironmentOutput{} + 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_deserializeOpDocumentCreateDevEnvironmentOutput(&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_deserializeOpErrorCreateDevEnvironment(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentCreateDevEnvironmentOutput(v **CreateDevEnvironmentOutput, 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 *CreateDevEnvironmentOutput + if *v == nil { + sv = &CreateDevEnvironmentOutput{} + } 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 Uuid to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "projectName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.ProjectName = ptr.String(jtv) + } + + case "spaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.SpaceName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateProject struct { +} + +func (*awsRestjson1_deserializeOpCreateProject) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateProject) 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_deserializeOpErrorCreateProject(response, &metadata) + } + output := &CreateProjectOutput{} + 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_deserializeOpDocumentCreateProjectOutput(&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_deserializeOpErrorCreateProject(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentCreateProjectOutput(v **CreateProjectOutput, 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 *CreateProjectOutput + if *v == nil { + sv = &CreateProjectOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "displayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DisplayName = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "spaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.SpaceName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateSourceRepositoryBranch struct { +} + +func (*awsRestjson1_deserializeOpCreateSourceRepositoryBranch) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSourceRepositoryBranch) 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_deserializeOpErrorCreateSourceRepositoryBranch(response, &metadata) + } + output := &CreateSourceRepositoryBranchOutput{} + 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_deserializeOpDocumentCreateSourceRepositoryBranchOutput(&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_deserializeOpErrorCreateSourceRepositoryBranch(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentCreateSourceRepositoryBranchOutput(v **CreateSourceRepositoryBranchOutput, 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 *CreateSourceRepositoryBranchOutput + if *v == nil { + sv = &CreateSourceRepositoryBranchOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "headCommitId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.HeadCommitId = ptr.String(jtv) + } + + case "lastUpdatedTime": + 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.LastUpdatedTime = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceRepositoryBranchString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ref": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceRepositoryBranchRefString to be of type string, got %T instead", value) + } + sv.Ref = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteAccessToken struct { +} + +func (*awsRestjson1_deserializeOpDeleteAccessToken) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteAccessToken) 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_deserializeOpErrorDeleteAccessToken(response, &metadata) + } + output := &DeleteAccessTokenOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteAccessToken(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDeleteDevEnvironment struct { +} + +func (*awsRestjson1_deserializeOpDeleteDevEnvironment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteDevEnvironment) 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_deserializeOpErrorDeleteDevEnvironment(response, &metadata) + } + output := &DeleteDevEnvironmentOutput{} + 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_deserializeOpDocumentDeleteDevEnvironmentOutput(&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_deserializeOpErrorDeleteDevEnvironment(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentDeleteDevEnvironmentOutput(v **DeleteDevEnvironmentOutput, 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 *DeleteDevEnvironmentOutput + if *v == nil { + sv = &DeleteDevEnvironmentOutput{} + } 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 Uuid to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "projectName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.ProjectName = ptr.String(jtv) + } + + case "spaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.SpaceName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetDevEnvironment struct { +} + +func (*awsRestjson1_deserializeOpGetDevEnvironment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDevEnvironment) 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_deserializeOpErrorGetDevEnvironment(response, &metadata) + } + output := &GetDevEnvironmentOutput{} + 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_deserializeOpDocumentGetDevEnvironmentOutput(&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_deserializeOpErrorGetDevEnvironment(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentGetDevEnvironmentOutput(v **GetDevEnvironmentOutput, 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 *GetDevEnvironmentOutput + if *v == nil { + sv = &GetDevEnvironmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "alias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Alias = ptr.String(jtv) + } + + case "creatorId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreatorId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "ides": + if err := awsRestjson1_deserializeDocumentIdes(&sv.Ides, value); err != nil { + return err + } + + case "inactivityTimeoutMinutes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected InactivityTimeoutMinutes to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.InactivityTimeoutMinutes = int32(i64) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value) + } + sv.InstanceType = types.InstanceType(jtv) + } + + case "lastUpdatedTime": + 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.LastUpdatedTime = ptr.Time(t) + } + + case "persistentStorage": + if err := awsRestjson1_deserializeDocumentPersistentStorage(&sv.PersistentStorage, value); err != nil { + return err + } + + case "projectName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.ProjectName = ptr.String(jtv) + } + + case "repositories": + if err := awsRestjson1_deserializeDocumentDevEnvironmentRepositorySummaries(&sv.Repositories, value); err != nil { + return err + } + + case "spaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.SpaceName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DevEnvironmentStatus to be of type string, got %T instead", value) + } + sv.Status = types.DevEnvironmentStatus(jtv) + } + + case "statusReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusReason to be of type string, got %T instead", value) + } + sv.StatusReason = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetProject struct { +} + +func (*awsRestjson1_deserializeOpGetProject) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetProject) 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_deserializeOpErrorGetProject(response, &metadata) + } + output := &GetProjectOutput{} + 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_deserializeOpDocumentGetProjectOutput(&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_deserializeOpErrorGetProject(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentGetProjectOutput(v **GetProjectOutput, 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 *GetProjectOutput + if *v == nil { + sv = &GetProjectOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "displayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DisplayName = 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 "spaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.SpaceName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSourceRepositoryCloneUrls struct { +} + +func (*awsRestjson1_deserializeOpGetSourceRepositoryCloneUrls) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSourceRepositoryCloneUrls) 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_deserializeOpErrorGetSourceRepositoryCloneUrls(response, &metadata) + } + output := &GetSourceRepositoryCloneUrlsOutput{} + 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_deserializeOpDocumentGetSourceRepositoryCloneUrlsOutput(&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_deserializeOpErrorGetSourceRepositoryCloneUrls(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentGetSourceRepositoryCloneUrlsOutput(v **GetSourceRepositoryCloneUrlsOutput, 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 *GetSourceRepositoryCloneUrlsOutput + if *v == nil { + sv = &GetSourceRepositoryCloneUrlsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "https": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Https = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSpace struct { +} + +func (*awsRestjson1_deserializeOpGetSpace) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSpace) 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_deserializeOpErrorGetSpace(response, &metadata) + } + output := &GetSpaceOutput{} + 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_deserializeOpDocumentGetSpaceOutput(&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_deserializeOpErrorGetSpace(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentGetSpaceOutput(v **GetSpaceOutput, 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 *GetSpaceOutput + if *v == nil { + sv = &GetSpaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "displayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DisplayName = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "regionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionString to be of type string, got %T instead", value) + } + sv.RegionName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSubscription struct { +} + +func (*awsRestjson1_deserializeOpGetSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSubscription) 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_deserializeOpErrorGetSubscription(response, &metadata) + } + output := &GetSubscriptionOutput{} + 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_deserializeOpDocumentGetSubscriptionOutput(&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_deserializeOpErrorGetSubscription(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentGetSubscriptionOutput(v **GetSubscriptionOutput, 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 *GetSubscriptionOutput + if *v == nil { + sv = &GetSubscriptionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "awsAccountName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.AwsAccountName = ptr.String(jtv) + } + + case "subscriptionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetUserDetails struct { +} + +func (*awsRestjson1_deserializeOpGetUserDetails) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetUserDetails) 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_deserializeOpErrorGetUserDetails(response, &metadata) + } + output := &GetUserDetailsOutput{} + 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_deserializeOpDocumentGetUserDetailsOutput(&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_deserializeOpErrorGetUserDetails(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentGetUserDetailsOutput(v **GetUserDetailsOutput, 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 *GetUserDetailsOutput + if *v == nil { + sv = &GetUserDetailsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "displayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DisplayName = ptr.String(jtv) + } + + case "primaryEmail": + if err := awsRestjson1_deserializeDocumentEmailAddress(&sv.PrimaryEmail, value); err != nil { + return err + } + + case "userId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UserId = ptr.String(jtv) + } + + case "userName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UserName = ptr.String(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListAccessTokens struct { +} + +func (*awsRestjson1_deserializeOpListAccessTokens) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAccessTokens) 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_deserializeOpErrorListAccessTokens(response, &metadata) + } + output := &ListAccessTokensOutput{} + 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_deserializeOpDocumentListAccessTokensOutput(&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_deserializeOpErrorListAccessTokens(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentListAccessTokensOutput(v **ListAccessTokensOutput, 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 *ListAccessTokensOutput + if *v == nil { + sv = &ListAccessTokensOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentAccessTokenSummaries(&sv.Items, 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_deserializeOpListDevEnvironments struct { +} + +func (*awsRestjson1_deserializeOpListDevEnvironments) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDevEnvironments) 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_deserializeOpErrorListDevEnvironments(response, &metadata) + } + output := &ListDevEnvironmentsOutput{} + 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_deserializeOpDocumentListDevEnvironmentsOutput(&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_deserializeOpErrorListDevEnvironments(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentListDevEnvironmentsOutput(v **ListDevEnvironmentsOutput, 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 *ListDevEnvironmentsOutput + if *v == nil { + sv = &ListDevEnvironmentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentDevEnvironmentSummaryList(&sv.Items, 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_deserializeOpListEventLogs struct { +} + +func (*awsRestjson1_deserializeOpListEventLogs) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListEventLogs) 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_deserializeOpErrorListEventLogs(response, &metadata) + } + output := &ListEventLogsOutput{} + 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_deserializeOpDocumentListEventLogsOutput(&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_deserializeOpErrorListEventLogs(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentListEventLogsOutput(v **ListEventLogsOutput, 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 *ListEventLogsOutput + if *v == nil { + sv = &ListEventLogsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentEventLogEntries(&sv.Items, 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_deserializeOpListProjects struct { +} + +func (*awsRestjson1_deserializeOpListProjects) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListProjects) 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_deserializeOpErrorListProjects(response, &metadata) + } + output := &ListProjectsOutput{} + 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_deserializeOpDocumentListProjectsOutput(&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_deserializeOpErrorListProjects(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentListProjectsOutput(v **ListProjectsOutput, 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 *ListProjectsOutput + if *v == nil { + sv = &ListProjectsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentProjectSummaries(&sv.Items, 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_deserializeOpListSourceRepositories struct { +} + +func (*awsRestjson1_deserializeOpListSourceRepositories) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSourceRepositories) 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_deserializeOpErrorListSourceRepositories(response, &metadata) + } + output := &ListSourceRepositoriesOutput{} + 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_deserializeOpDocumentListSourceRepositoriesOutput(&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_deserializeOpErrorListSourceRepositories(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentListSourceRepositoriesOutput(v **ListSourceRepositoriesOutput, 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 *ListSourceRepositoriesOutput + if *v == nil { + sv = &ListSourceRepositoriesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentListSourceRepositoriesItems(&sv.Items, 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_deserializeOpListSourceRepositoryBranches struct { +} + +func (*awsRestjson1_deserializeOpListSourceRepositoryBranches) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSourceRepositoryBranches) 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_deserializeOpErrorListSourceRepositoryBranches(response, &metadata) + } + output := &ListSourceRepositoryBranchesOutput{} + 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_deserializeOpDocumentListSourceRepositoryBranchesOutput(&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_deserializeOpErrorListSourceRepositoryBranches(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentListSourceRepositoryBranchesOutput(v **ListSourceRepositoryBranchesOutput, 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 *ListSourceRepositoryBranchesOutput + if *v == nil { + sv = &ListSourceRepositoryBranchesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentListSourceRepositoryBranchesItems(&sv.Items, 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_deserializeOpListSpaces struct { +} + +func (*awsRestjson1_deserializeOpListSpaces) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSpaces) 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_deserializeOpErrorListSpaces(response, &metadata) + } + output := &ListSpacesOutput{} + 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_deserializeOpDocumentListSpacesOutput(&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_deserializeOpErrorListSpaces(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentListSpacesOutput(v **ListSpacesOutput, 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 *ListSpacesOutput + if *v == nil { + sv = &ListSpacesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentSpaceSummaries(&sv.Items, 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_deserializeOpStartDevEnvironment struct { +} + +func (*awsRestjson1_deserializeOpStartDevEnvironment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartDevEnvironment) 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_deserializeOpErrorStartDevEnvironment(response, &metadata) + } + output := &StartDevEnvironmentOutput{} + 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_deserializeOpDocumentStartDevEnvironmentOutput(&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_deserializeOpErrorStartDevEnvironment(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentStartDevEnvironmentOutput(v **StartDevEnvironmentOutput, 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 *StartDevEnvironmentOutput + if *v == nil { + sv = &StartDevEnvironmentOutput{} + } 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 Uuid to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "projectName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.ProjectName = ptr.String(jtv) + } + + case "spaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.SpaceName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DevEnvironmentStatus to be of type string, got %T instead", value) + } + sv.Status = types.DevEnvironmentStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartDevEnvironmentSession struct { +} + +func (*awsRestjson1_deserializeOpStartDevEnvironmentSession) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartDevEnvironmentSession) 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_deserializeOpErrorStartDevEnvironmentSession(response, &metadata) + } + output := &StartDevEnvironmentSessionOutput{} + 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_deserializeOpDocumentStartDevEnvironmentSessionOutput(&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_deserializeOpErrorStartDevEnvironmentSession(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentStartDevEnvironmentSessionOutput(v **StartDevEnvironmentSessionOutput, 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 *StartDevEnvironmentSessionOutput + if *v == nil { + sv = &StartDevEnvironmentSessionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accessDetails": + if err := awsRestjson1_deserializeDocumentDevEnvironmentAccessDetails(&sv.AccessDetails, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "projectName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.ProjectName = ptr.String(jtv) + } + + case "sessionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SessionId = ptr.String(jtv) + } + + case "spaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.SpaceName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStopDevEnvironment struct { +} + +func (*awsRestjson1_deserializeOpStopDevEnvironment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStopDevEnvironment) 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_deserializeOpErrorStopDevEnvironment(response, &metadata) + } + output := &StopDevEnvironmentOutput{} + 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_deserializeOpDocumentStopDevEnvironmentOutput(&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_deserializeOpErrorStopDevEnvironment(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentStopDevEnvironmentOutput(v **StopDevEnvironmentOutput, 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 *StopDevEnvironmentOutput + if *v == nil { + sv = &StopDevEnvironmentOutput{} + } 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 Uuid to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "projectName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.ProjectName = ptr.String(jtv) + } + + case "spaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.SpaceName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DevEnvironmentStatus to be of type string, got %T instead", value) + } + sv.Status = types.DevEnvironmentStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateDevEnvironment struct { +} + +func (*awsRestjson1_deserializeOpUpdateDevEnvironment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateDevEnvironment) 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_deserializeOpErrorUpdateDevEnvironment(response, &metadata) + } + output := &UpdateDevEnvironmentOutput{} + 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_deserializeOpDocumentUpdateDevEnvironmentOutput(&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_deserializeOpErrorUpdateDevEnvironment(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentUpdateDevEnvironmentOutput(v **UpdateDevEnvironmentOutput, 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 *UpdateDevEnvironmentOutput + if *v == nil { + sv = &UpdateDevEnvironmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "alias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Alias = ptr.String(jtv) + } + + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "ides": + if err := awsRestjson1_deserializeDocumentIdeConfigurationList(&sv.Ides, value); err != nil { + return err + } + + case "inactivityTimeoutMinutes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected InactivityTimeoutMinutes to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.InactivityTimeoutMinutes = int32(i64) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value) + } + sv.InstanceType = types.InstanceType(jtv) + } + + case "projectName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.ProjectName = ptr.String(jtv) + } + + case "spaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.SpaceName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpVerifySession struct { +} + +func (*awsRestjson1_deserializeOpVerifySession) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpVerifySession) 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_deserializeOpErrorVerifySession(response, &metadata) + } + output := &VerifySessionOutput{} + 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_deserializeOpDocumentVerifySessionOutput(&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_deserializeOpErrorVerifySession(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentVerifySessionOutput(v **VerifySessionOutput, 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 *VerifySessionOutput + if *v == nil { + sv = &VerifySessionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "identity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Identity = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +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_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_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + 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_deserializeDocumentServiceQuotaExceededException(&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_deserializeDocumentAccessTokenSummaries(v *[]types.AccessTokenSummary, 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.AccessTokenSummary + if *v == nil { + cv = []types.AccessTokenSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccessTokenSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAccessTokenSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAccessTokenSummary(v **types.AccessTokenSummary, 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.AccessTokenSummary + if *v == nil { + sv = &types.AccessTokenSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "expiresTime": + 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.ExpiresTime = ptr.Time(t) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessTokenId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessTokenName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + 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_deserializeDocumentDevEnvironmentAccessDetails(v **types.DevEnvironmentAccessDetails, 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.DevEnvironmentAccessDetails + if *v == nil { + sv = &types.DevEnvironmentAccessDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "streamUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value) + } + sv.StreamUrl = ptr.String(jtv) + } + + case "tokenValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value) + } + sv.TokenValue = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDevEnvironmentRepositorySummaries(v *[]types.DevEnvironmentRepositorySummary, 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.DevEnvironmentRepositorySummary + if *v == nil { + cv = []types.DevEnvironmentRepositorySummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DevEnvironmentRepositorySummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentDevEnvironmentRepositorySummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDevEnvironmentRepositorySummary(v **types.DevEnvironmentRepositorySummary, 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.DevEnvironmentRepositorySummary + if *v == nil { + sv = &types.DevEnvironmentRepositorySummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "branchName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceRepositoryBranchString to be of type string, got %T instead", value) + } + sv.BranchName = ptr.String(jtv) + } + + case "repositoryName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceRepositoryNameString to be of type string, got %T instead", value) + } + sv.RepositoryName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDevEnvironmentSummary(v **types.DevEnvironmentSummary, 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.DevEnvironmentSummary + if *v == nil { + sv = &types.DevEnvironmentSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "alias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Alias = ptr.String(jtv) + } + + case "creatorId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreatorId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "ides": + if err := awsRestjson1_deserializeDocumentIdes(&sv.Ides, value); err != nil { + return err + } + + case "inactivityTimeoutMinutes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected InactivityTimeoutMinutes to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.InactivityTimeoutMinutes = int32(i64) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value) + } + sv.InstanceType = types.InstanceType(jtv) + } + + case "lastUpdatedTime": + 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.LastUpdatedTime = ptr.Time(t) + } + + case "persistentStorage": + if err := awsRestjson1_deserializeDocumentPersistentStorage(&sv.PersistentStorage, value); err != nil { + return err + } + + case "projectName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.ProjectName = ptr.String(jtv) + } + + case "repositories": + if err := awsRestjson1_deserializeDocumentDevEnvironmentRepositorySummaries(&sv.Repositories, value); err != nil { + return err + } + + case "spaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.SpaceName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DevEnvironmentStatus to be of type string, got %T instead", value) + } + sv.Status = types.DevEnvironmentStatus(jtv) + } + + case "statusReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusReason to be of type string, got %T instead", value) + } + sv.StatusReason = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDevEnvironmentSummaryList(v *[]types.DevEnvironmentSummary, 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.DevEnvironmentSummary + if *v == nil { + cv = []types.DevEnvironmentSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DevEnvironmentSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentDevEnvironmentSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEmailAddress(v **types.EmailAddress, 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.EmailAddress + if *v == nil { + sv = &types.EmailAddress{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "email": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Email = ptr.String(jtv) + } + + case "verified": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Verified = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventLogEntries(v *[]types.EventLogEntry, 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.EventLogEntry + if *v == nil { + cv = []types.EventLogEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EventLogEntry + destAddr := &col + if err := awsRestjson1_deserializeDocumentEventLogEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEventLogEntry(v **types.EventLogEntry, 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.EventLogEntry + if *v == nil { + sv = &types.EventLogEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode = ptr.String(jtv) + } + + case "eventCategory": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EventCategory = ptr.String(jtv) + } + + case "eventName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EventName = ptr.String(jtv) + } + + case "eventSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EventSource = ptr.String(jtv) + } + + case "eventTime": + 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.EventTime = ptr.Time(t) + } + + case "eventType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EventType = ptr.String(jtv) + } + + 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 "operationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationType to be of type string, got %T instead", value) + } + sv.OperationType = types.OperationType(jtv) + } + + case "projectInformation": + if err := awsRestjson1_deserializeDocumentProjectInformation(&sv.ProjectInformation, value); err != nil { + return err + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + case "requestPayload": + if err := awsRestjson1_deserializeDocumentEventPayload(&sv.RequestPayload, value); err != nil { + return err + } + + case "responsePayload": + if err := awsRestjson1_deserializeDocumentEventPayload(&sv.ResponsePayload, value); err != nil { + return err + } + + case "sourceIpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SourceIpAddress = ptr.String(jtv) + } + + case "userAgent": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UserAgent = ptr.String(jtv) + } + + case "userIdentity": + if err := awsRestjson1_deserializeDocumentUserIdentity(&sv.UserIdentity, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventPayload(v **types.EventPayload, 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.EventPayload + if *v == nil { + sv = &types.EventPayload{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "contentType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ContentType = ptr.String(jtv) + } + + case "data": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Data = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIde(v **types.Ide, 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.Ide + if *v == nil { + sv = &types.Ide{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "runtime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Runtime = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIdeConfiguration(v **types.IdeConfiguration, 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.IdeConfiguration + if *v == nil { + sv = &types.IdeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "runtime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Runtime = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIdeConfigurationList(v *[]types.IdeConfiguration, 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.IdeConfiguration + if *v == nil { + cv = []types.IdeConfiguration{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.IdeConfiguration + destAddr := &col + if err := awsRestjson1_deserializeDocumentIdeConfiguration(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentIdes(v *[]types.Ide, 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.Ide + if *v == nil { + cv = []types.Ide{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Ide + destAddr := &col + if err := awsRestjson1_deserializeDocumentIde(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListSourceRepositoriesItem(v **types.ListSourceRepositoriesItem, 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.ListSourceRepositoriesItem + if *v == nil { + sv = &types.ListSourceRepositoriesItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdTime": + 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.CreatedTime = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceRepositoryDescriptionString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceRepositoryIdString to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedTime": + 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.LastUpdatedTime = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceRepositoryNameString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSourceRepositoriesItems(v *[]types.ListSourceRepositoriesItem, 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.ListSourceRepositoriesItem + if *v == nil { + cv = []types.ListSourceRepositoriesItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListSourceRepositoriesItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentListSourceRepositoriesItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListSourceRepositoryBranchesItem(v **types.ListSourceRepositoryBranchesItem, 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.ListSourceRepositoryBranchesItem + if *v == nil { + sv = &types.ListSourceRepositoryBranchesItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "headCommitId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.HeadCommitId = ptr.String(jtv) + } + + case "lastUpdatedTime": + 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.LastUpdatedTime = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceRepositoryBranchString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ref": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceRepositoryBranchRefString to be of type string, got %T instead", value) + } + sv.Ref = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListSourceRepositoryBranchesItems(v *[]types.ListSourceRepositoryBranchesItem, 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.ListSourceRepositoryBranchesItem + if *v == nil { + cv = []types.ListSourceRepositoryBranchesItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListSourceRepositoryBranchesItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentListSourceRepositoryBranchesItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPersistentStorage(v **types.PersistentStorage, 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.PersistentStorage + if *v == nil { + sv = &types.PersistentStorage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "sizeInGiB": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SizeInGiB = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentProjectInformation(v **types.ProjectInformation, 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.ProjectInformation + if *v == nil { + sv = &types.ProjectInformation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "projectId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ProjectId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentProjectSummaries(v *[]types.ProjectSummary, 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.ProjectSummary + if *v == nil { + cv = []types.ProjectSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProjectSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentProjectSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentProjectSummary(v **types.ProjectSummary, 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.ProjectSummary + if *v == nil { + sv = &types.ProjectSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "displayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DisplayName = 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_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_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, 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.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } 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_deserializeDocumentSpaceSummaries(v *[]types.SpaceSummary, 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.SpaceSummary + if *v == nil { + cv = []types.SpaceSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SpaceSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentSpaceSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSpaceSummary(v **types.SpaceSummary, 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.SpaceSummary + if *v == nil { + sv = &types.SpaceSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "displayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DisplayName = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "regionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionString to be of type string, got %T instead", value) + } + sv.RegionName = 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) + } + 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_deserializeDocumentUserIdentity(v **types.UserIdentity, 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.UserIdentity + if *v == nil { + sv = &types.UserIdentity{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "awsAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AwsAccountId = ptr.String(jtv) + } + + case "principalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PrincipalId = ptr.String(jtv) + } + + case "userName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UserName = ptr.String(jtv) + } + + case "userType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UserType to be of type string, got %T instead", value) + } + sv.UserType = types.UserType(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/codecatalyst/doc.go b/service/codecatalyst/doc.go new file mode 100644 index 00000000000..763e9355ad8 --- /dev/null +++ b/service/codecatalyst/doc.go @@ -0,0 +1,88 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package codecatalyst provides the API client, operations, and parameter types +// for Amazon CodeCatalyst. +// +// Amazon CodeCatalyst is in preview release and subject to change. Welcome to the +// Amazon CodeCatalyst API reference. This reference provides descriptions of +// operations and data types for Amazon CodeCatalyst. You can use the Amazon +// CodeCatalyst API to work with the following objects. Dev Environments and the +// Amazon Web Services Toolkits, by calling the following: +// +// * CreateAccessToken, +// which creates a personal access token (PAT) for the current user. +// +// * +// CreateDevEnvironment, which creates a Dev Environment, where you can quickly +// work on the code stored in the source repositories of your project. +// +// * +// CreateProject which creates a project in a specified space. +// +// * +// CreateSourceRepositoryBranch, which creates a branch in a specified repository +// where you can work on code. +// +// * DeleteDevEnvironment, which deletes a Dev +// Environment. +// +// * GetDevEnvironment, which returns information about a Dev +// Environment. +// +// * GetProject, which returns information about a project. +// +// * +// GetSourceRepositoryCloneUrls, which returns information about the URLs that can +// be used with a Git client to clone a source repository. +// +// * GetSubscription, +// which returns information about the Amazon Web Services account used for billing +// purposes and the billing plan for the space. +// +// * GetUserDetails, which returns +// information about a user in Amazon CodeCatalyst. +// +// * ListDevEnvironments, which +// retrives a list of Dev Environments in a project. +// +// * ListProjects, which +// retrieves a list of projects in a space. +// +// * ListSourceRepositories, which +// retrieves a list of source repositories in a project. +// +// * +// ListSourceRepositoryBranches, which retrieves a list of branches in a source +// repository. +// +// * ListSpaces, which retrieves a list of spaces. +// +// * +// StartDevEnvironment, which starts a specified Dev Environment and puts it into +// an active state. +// +// * StartDevEnvironmentSession, which starts a session to a +// specified Dev Environment. +// +// * StopDevEnvironment, which stops a specified Dev +// Environment and puts it into an stopped state. +// +// * UpdateDevEnvironment, which +// changes one or more values for a Dev Environment. +// +// * VerifySession, which +// verifies whether the calling user has a valid Amazon CodeCatalyst login and +// session. +// +// Security, activity, and resource management in Amazon CodeCatalyst, by +// calling the following: +// +// * DeleteAccessToken, which deletes a specified personal +// access token (PAT). +// +// * ListAccessTokens, which lists all personal access tokens +// (PATs) associated with a user. +// +// * ListEventLogs, which retrieves a list of +// events that occurred during a specified time period in a space. +package codecatalyst diff --git a/service/codecatalyst/endpoints.go b/service/codecatalyst/endpoints.go new file mode 100644 index 00000000000..7badc888591 --- /dev/null +++ b/service/codecatalyst/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/codecatalyst/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" + "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) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// 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, +) { + 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 { + 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 = "codecatalyst" + } + 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 + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(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 EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +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 + } + } + +} diff --git a/service/codecatalyst/generated.json b/service/codecatalyst/generated.json new file mode 100644 index 00000000000..c8663afb988 --- /dev/null +++ b/service/codecatalyst/generated.json @@ -0,0 +1,51 @@ +{ + "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_CreateAccessToken.go", + "api_op_CreateDevEnvironment.go", + "api_op_CreateProject.go", + "api_op_CreateSourceRepositoryBranch.go", + "api_op_DeleteAccessToken.go", + "api_op_DeleteDevEnvironment.go", + "api_op_GetDevEnvironment.go", + "api_op_GetProject.go", + "api_op_GetSourceRepositoryCloneUrls.go", + "api_op_GetSpace.go", + "api_op_GetSubscription.go", + "api_op_GetUserDetails.go", + "api_op_ListAccessTokens.go", + "api_op_ListDevEnvironments.go", + "api_op_ListEventLogs.go", + "api_op_ListProjects.go", + "api_op_ListSourceRepositories.go", + "api_op_ListSourceRepositoryBranches.go", + "api_op_ListSpaces.go", + "api_op_StartDevEnvironment.go", + "api_op_StartDevEnvironmentSession.go", + "api_op_StopDevEnvironment.go", + "api_op_UpdateDevEnvironment.go", + "api_op_VerifySession.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/codecatalyst", + "unstable": false +} diff --git a/service/codecatalyst/go.mod b/service/codecatalyst/go.mod new file mode 100644 index 00000000000..fc9ddc86265 --- /dev/null +++ b/service/codecatalyst/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/codecatalyst + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.17.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19 + github.com/aws/smithy-go v1.13.4 +) + +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/codecatalyst/go.sum b/service/codecatalyst/go.sum new file mode 100644 index 00000000000..b5b882cefe7 --- /dev/null +++ b/service/codecatalyst/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.13.4 h1:/RN2z1txIJWeXeOkzX+Hk/4Uuvv7dWtCjbmVJcrskyk= +github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/codecatalyst/go_module_metadata.go b/service/codecatalyst/go_module_metadata.go new file mode 100644 index 00000000000..0bf5002198f --- /dev/null +++ b/service/codecatalyst/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package codecatalyst + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/codecatalyst/internal/endpoints/endpoints.go b/service/codecatalyst/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..f7a9880cbae --- /dev/null +++ b/service/codecatalyst/internal/endpoints/endpoints.go @@ -0,0 +1,258 @@ +// 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 CodeCatalyst 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 + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\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: "codecatalyst.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "codecatalyst-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "codecatalyst-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "codecatalyst.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: false, + PartitionEndpoint: "aws-global", + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "aws-global", + }: endpoints.Endpoint{ + Hostname: "codecatalyst.global.api.aws", + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "codecatalyst.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "codecatalyst-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "codecatalyst-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "codecatalyst.{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: "codecatalyst-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "codecatalyst.{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: "codecatalyst-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "codecatalyst.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "codecatalyst.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "codecatalyst-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "codecatalyst-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "codecatalyst.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/codecatalyst/internal/endpoints/endpoints_test.go b/service/codecatalyst/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/codecatalyst/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/codecatalyst/protocol_test.go b/service/codecatalyst/protocol_test.go new file mode 100644 index 00000000000..ae94e72ad13 --- /dev/null +++ b/service/codecatalyst/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst diff --git a/service/codecatalyst/serializers.go b/service/codecatalyst/serializers.go new file mode 100644 index 00000000000..ee3757fb848 --- /dev/null +++ b/service/codecatalyst/serializers.go @@ -0,0 +1,2231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/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" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpCreateAccessToken struct { +} + +func (*awsRestjson1_serializeOpCreateAccessToken) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateAccessToken) 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.(*CreateAccessTokenInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/accessTokens") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentCreateAccessTokenInput(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_serializeOpHttpBindingsCreateAccessTokenInput(v *CreateAccessTokenInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateAccessTokenInput(v *CreateAccessTokenInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExpiresTime != nil { + ok := object.Key("expiresTime") + ok.String(smithytime.FormatDateTime(*v.ExpiresTime)) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpCreateDevEnvironment struct { +} + +func (*awsRestjson1_serializeOpCreateDevEnvironment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateDevEnvironment) 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.(*CreateDevEnvironmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateDevEnvironmentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateDevEnvironmentInput(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_serializeOpHttpBindingsCreateDevEnvironmentInput(v *CreateDevEnvironmentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateDevEnvironmentInput(v *CreateDevEnvironmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Alias != nil { + ok := object.Key("alias") + ok.String(*v.Alias) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Ides != nil { + ok := object.Key("ides") + if err := awsRestjson1_serializeDocumentIdeConfigurationList(v.Ides, ok); err != nil { + return err + } + } + + if v.InactivityTimeoutMinutes != 0 { + ok := object.Key("inactivityTimeoutMinutes") + ok.Integer(v.InactivityTimeoutMinutes) + } + + if len(v.InstanceType) > 0 { + ok := object.Key("instanceType") + ok.String(string(v.InstanceType)) + } + + if v.PersistentStorage != nil { + ok := object.Key("persistentStorage") + if err := awsRestjson1_serializeDocumentPersistentStorageConfiguration(v.PersistentStorage, ok); err != nil { + return err + } + } + + if v.Repositories != nil { + ok := object.Key("repositories") + if err := awsRestjson1_serializeDocumentRepositoriesInput(v.Repositories, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateProject struct { +} + +func (*awsRestjson1_serializeOpCreateProject) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateProject) 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.(*CreateProjectInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateProjectInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateProjectInput(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_serializeOpHttpBindingsCreateProjectInput(v *CreateProjectInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateProjectInput(v *CreateProjectInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.DisplayName != nil { + ok := object.Key("displayName") + ok.String(*v.DisplayName) + } + + return nil +} + +type awsRestjson1_serializeOpCreateSourceRepositoryBranch struct { +} + +func (*awsRestjson1_serializeOpCreateSourceRepositoryBranch) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSourceRepositoryBranch) 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.(*CreateSourceRepositoryBranchInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{sourceRepositoryName}/branches/{name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateSourceRepositoryBranchInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateSourceRepositoryBranchInput(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_serializeOpHttpBindingsCreateSourceRepositoryBranchInput(v *CreateSourceRepositoryBranchInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("name").String(*v.Name); err != nil { + return err + } + } + + if v.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SourceRepositoryName == nil || len(*v.SourceRepositoryName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member sourceRepositoryName must not be empty")} + } + if v.SourceRepositoryName != nil { + if err := encoder.SetURI("sourceRepositoryName").String(*v.SourceRepositoryName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSourceRepositoryBranchInput(v *CreateSourceRepositoryBranchInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.HeadCommitId != nil { + ok := object.Key("headCommitId") + ok.String(*v.HeadCommitId) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteAccessToken struct { +} + +func (*awsRestjson1_serializeOpDeleteAccessToken) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAccessToken) 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.(*DeleteAccessTokenInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/accessTokens/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteAccessTokenInput(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_serializeOpHttpBindingsDeleteAccessTokenInput(v *DeleteAccessTokenInput, 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 + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteDevEnvironment struct { +} + +func (*awsRestjson1_serializeOpDeleteDevEnvironment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteDevEnvironment) 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.(*DeleteDevEnvironmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteDevEnvironmentInput(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_serializeOpHttpBindingsDeleteDevEnvironmentInput(v *DeleteDevEnvironmentInput, 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.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetDevEnvironment struct { +} + +func (*awsRestjson1_serializeOpGetDevEnvironment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDevEnvironment) 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.(*GetDevEnvironmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetDevEnvironmentInput(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_serializeOpHttpBindingsGetDevEnvironmentInput(v *GetDevEnvironmentInput, 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.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetProject struct { +} + +func (*awsRestjson1_serializeOpGetProject) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetProject) 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.(*GetProjectInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetProjectInput(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_serializeOpHttpBindingsGetProjectInput(v *GetProjectInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("name").String(*v.Name); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSourceRepositoryCloneUrls struct { +} + +func (*awsRestjson1_serializeOpGetSourceRepositoryCloneUrls) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSourceRepositoryCloneUrls) 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.(*GetSourceRepositoryCloneUrlsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{sourceRepositoryName}/cloneUrls") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSourceRepositoryCloneUrlsInput(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_serializeOpHttpBindingsGetSourceRepositoryCloneUrlsInput(v *GetSourceRepositoryCloneUrlsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SourceRepositoryName == nil || len(*v.SourceRepositoryName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member sourceRepositoryName must not be empty")} + } + if v.SourceRepositoryName != nil { + if err := encoder.SetURI("sourceRepositoryName").String(*v.SourceRepositoryName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSpace struct { +} + +func (*awsRestjson1_serializeOpGetSpace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSpace) 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.(*GetSpaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSpaceInput(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_serializeOpHttpBindingsGetSpaceInput(v *GetSpaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSubscription struct { +} + +func (*awsRestjson1_serializeOpGetSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSubscription) 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.(*GetSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/subscription") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSubscriptionInput(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_serializeOpHttpBindingsGetSubscriptionInput(v *GetSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetUserDetails struct { +} + +func (*awsRestjson1_serializeOpGetUserDetails) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetUserDetails) 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.(*GetUserDetailsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/userDetails") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetUserDetailsInput(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_serializeOpHttpBindingsGetUserDetailsInput(v *GetUserDetailsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id != nil { + encoder.SetQuery("id").String(*v.Id) + } + + if v.UserName != nil { + encoder.SetQuery("userName").String(*v.UserName) + } + + return nil +} + +type awsRestjson1_serializeOpListAccessTokens struct { +} + +func (*awsRestjson1_serializeOpListAccessTokens) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAccessTokens) 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.(*ListAccessTokensInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/accessTokens") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentListAccessTokensInput(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_serializeOpHttpBindingsListAccessTokensInput(v *ListAccessTokensInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListAccessTokensInput(v *ListAccessTokensInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListDevEnvironments struct { +} + +func (*awsRestjson1_serializeOpListDevEnvironments) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListDevEnvironments) 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.(*ListDevEnvironmentsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListDevEnvironmentsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListDevEnvironmentsInput(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_serializeOpHttpBindingsListDevEnvironmentsInput(v *ListDevEnvironmentsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListDevEnvironmentsInput(v *ListDevEnvironmentsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListEventLogs struct { +} + +func (*awsRestjson1_serializeOpListEventLogs) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListEventLogs) 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.(*ListEventLogsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/eventLogs") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListEventLogsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListEventLogsInput(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_serializeOpHttpBindingsListEventLogsInput(v *ListEventLogsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListEventLogsInput(v *ListEventLogsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTime != nil { + ok := object.Key("endTime") + ok.String(smithytime.FormatDateTime(*v.EndTime)) + } + + if v.EventName != nil { + ok := object.Key("eventName") + ok.String(*v.EventName) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.StartTime != nil { + ok := object.Key("startTime") + ok.String(smithytime.FormatDateTime(*v.StartTime)) + } + + return nil +} + +type awsRestjson1_serializeOpListProjects struct { +} + +func (*awsRestjson1_serializeOpListProjects) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListProjects) 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.(*ListProjectsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListProjectsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListProjectsInput(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_serializeOpHttpBindingsListProjectsInput(v *ListProjectsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListProjectsInput(v *ListProjectsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentProjectListFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListSourceRepositories struct { +} + +func (*awsRestjson1_serializeOpListSourceRepositories) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSourceRepositories) 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.(*ListSourceRepositoriesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListSourceRepositoriesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListSourceRepositoriesInput(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_serializeOpHttpBindingsListSourceRepositoriesInput(v *ListSourceRepositoriesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListSourceRepositoriesInput(v *ListSourceRepositoriesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListSourceRepositoryBranches struct { +} + +func (*awsRestjson1_serializeOpListSourceRepositoryBranches) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSourceRepositoryBranches) 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.(*ListSourceRepositoryBranchesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/sourceRepositories/{sourceRepositoryName}/branches") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListSourceRepositoryBranchesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListSourceRepositoryBranchesInput(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_serializeOpHttpBindingsListSourceRepositoryBranchesInput(v *ListSourceRepositoryBranchesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SourceRepositoryName == nil || len(*v.SourceRepositoryName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member sourceRepositoryName must not be empty")} + } + if v.SourceRepositoryName != nil { + if err := encoder.SetURI("sourceRepositoryName").String(*v.SourceRepositoryName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListSourceRepositoryBranchesInput(v *ListSourceRepositoryBranchesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListSpaces struct { +} + +func (*awsRestjson1_serializeOpListSpaces) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSpaces) 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.(*ListSpacesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentListSpacesInput(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_serializeOpHttpBindingsListSpacesInput(v *ListSpacesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListSpacesInput(v *ListSpacesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpStartDevEnvironment struct { +} + +func (*awsRestjson1_serializeOpStartDevEnvironment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartDevEnvironment) 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.(*StartDevEnvironmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}/start") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStartDevEnvironmentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartDevEnvironmentInput(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_serializeOpHttpBindingsStartDevEnvironmentInput(v *StartDevEnvironmentInput, 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.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartDevEnvironmentInput(v *StartDevEnvironmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Ides != nil { + ok := object.Key("ides") + if err := awsRestjson1_serializeDocumentIdeConfigurationList(v.Ides, ok); err != nil { + return err + } + } + + if v.InactivityTimeoutMinutes != 0 { + ok := object.Key("inactivityTimeoutMinutes") + ok.Integer(v.InactivityTimeoutMinutes) + } + + if len(v.InstanceType) > 0 { + ok := object.Key("instanceType") + ok.String(string(v.InstanceType)) + } + + return nil +} + +type awsRestjson1_serializeOpStartDevEnvironmentSession struct { +} + +func (*awsRestjson1_serializeOpStartDevEnvironmentSession) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartDevEnvironmentSession) 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.(*StartDevEnvironmentSessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}/session") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStartDevEnvironmentSessionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartDevEnvironmentSessionInput(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_serializeOpHttpBindingsStartDevEnvironmentSessionInput(v *StartDevEnvironmentSessionInput, 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.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartDevEnvironmentSessionInput(v *StartDevEnvironmentSessionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SessionConfiguration != nil { + ok := object.Key("sessionConfiguration") + if err := awsRestjson1_serializeDocumentDevEnvironmentSessionConfiguration(v.SessionConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpStopDevEnvironment struct { +} + +func (*awsRestjson1_serializeOpStopDevEnvironment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStopDevEnvironment) 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.(*StopDevEnvironmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}/stop") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStopDevEnvironmentInput(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_serializeOpHttpBindingsStopDevEnvironmentInput(v *StopDevEnvironmentInput, 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.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateDevEnvironment struct { +} + +func (*awsRestjson1_serializeOpUpdateDevEnvironment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateDevEnvironment) 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.(*UpdateDevEnvironmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateDevEnvironmentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateDevEnvironmentInput(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_serializeOpHttpBindingsUpdateDevEnvironmentInput(v *UpdateDevEnvironmentInput, 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.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateDevEnvironmentInput(v *UpdateDevEnvironmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Alias != nil { + ok := object.Key("alias") + ok.String(*v.Alias) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Ides != nil { + ok := object.Key("ides") + if err := awsRestjson1_serializeDocumentIdeConfigurationList(v.Ides, ok); err != nil { + return err + } + } + + if v.InactivityTimeoutMinutes != 0 { + ok := object.Key("inactivityTimeoutMinutes") + ok.Integer(v.InactivityTimeoutMinutes) + } + + if len(v.InstanceType) > 0 { + ok := object.Key("instanceType") + ok.String(string(v.InstanceType)) + } + + return nil +} + +type awsRestjson1_serializeOpVerifySession struct { +} + +func (*awsRestjson1_serializeOpVerifySession) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpVerifySession) 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.(*VerifySessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/session") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpHttpBindingsVerifySessionInput(v *VerifySessionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeDocumentDevEnvironmentSessionConfiguration(v *types.DevEnvironmentSessionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExecuteCommandSessionConfiguration != nil { + ok := object.Key("executeCommandSessionConfiguration") + if err := awsRestjson1_serializeDocumentExecuteCommandSessionConfiguration(v.ExecuteCommandSessionConfiguration, ok); err != nil { + return err + } + } + + if len(v.SessionType) > 0 { + ok := object.Key("sessionType") + ok.String(string(v.SessionType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentExecuteCommandSessionConfiguration(v *types.ExecuteCommandSessionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arguments != nil { + ok := object.Key("arguments") + if err := awsRestjson1_serializeDocumentExecuteCommandSessionConfigurationArguments(v.Arguments, ok); err != nil { + return err + } + } + + if v.Command != nil { + ok := object.Key("command") + ok.String(*v.Command) + } + + return nil +} + +func awsRestjson1_serializeDocumentExecuteCommandSessionConfigurationArguments(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_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComparisonOperator != nil { + ok := object.Key("comparisonOperator") + ok.String(*v.ComparisonOperator) + } + + if v.Key != nil { + ok := object.Key("key") + ok.String(*v.Key) + } + + if v.Values != nil { + ok := object.Key("values") + if err := awsRestjson1_serializeDocumentStringList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentFilters(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_serializeDocumentIdeConfiguration(v *types.IdeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Runtime != nil { + ok := object.Key("runtime") + ok.String(*v.Runtime) + } + + return nil +} + +func awsRestjson1_serializeDocumentIdeConfigurationList(v []types.IdeConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentIdeConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentPersistentStorageConfiguration(v *types.PersistentStorageConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SizeInGiB != nil { + ok := object.Key("sizeInGiB") + ok.Integer(*v.SizeInGiB) + } + + return nil +} + +func awsRestjson1_serializeDocumentProjectListFilter(v *types.ProjectListFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ComparisonOperator) > 0 { + ok := object.Key("comparisonOperator") + ok.String(string(v.ComparisonOperator)) + } + + if len(v.Key) > 0 { + ok := object.Key("key") + ok.String(string(v.Key)) + } + + if v.Values != nil { + ok := object.Key("values") + if err := awsRestjson1_serializeDocumentStringList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentProjectListFilters(v []types.ProjectListFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentProjectListFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRepositoriesInput(v []types.RepositoryInput, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRepositoryInput(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRepositoryInput(v *types.RepositoryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BranchName != nil { + ok := object.Key("branchName") + ok.String(*v.BranchName) + } + + if v.RepositoryName != nil { + ok := object.Key("repositoryName") + ok.String(*v.RepositoryName) + } + + return nil +} + +func awsRestjson1_serializeDocumentStringList(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 +} diff --git a/service/codecatalyst/types/enums.go b/service/codecatalyst/types/enums.go new file mode 100644 index 00000000000..fea245a2c49 --- /dev/null +++ b/service/codecatalyst/types/enums.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type CatalogActionVersionFileRecordType string + +// Enum values for CatalogActionVersionFileRecordType +const ( + CatalogActionVersionFileRecordTypeLicense CatalogActionVersionFileRecordType = "LICENSE" + CatalogActionVersionFileRecordTypeReadme CatalogActionVersionFileRecordType = "README" +) + +// Values returns all known values for CatalogActionVersionFileRecordType. 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 (CatalogActionVersionFileRecordType) Values() []CatalogActionVersionFileRecordType { + return []CatalogActionVersionFileRecordType{ + "LICENSE", + "README", + } +} + +type ComparisonOperator string + +// Enum values for ComparisonOperator +const ( + ComparisonOperatorEquals ComparisonOperator = "EQ" + ComparisonOperatorGreaterThan ComparisonOperator = "GT" + ComparisonOperatorGreaterThanOrEquals ComparisonOperator = "GE" + ComparisonOperatorLessThan ComparisonOperator = "LT" + ComparisonOperatorLessThanOrEquals ComparisonOperator = "LE" +) + +// Values returns all known values for ComparisonOperator. 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 (ComparisonOperator) Values() []ComparisonOperator { + return []ComparisonOperator{ + "EQ", + "GT", + "GE", + "LT", + "LE", + } +} + +type DevEnvironmentSessionType string + +// Enum values for DevEnvironmentSessionType +const ( + DevEnvironmentSessionTypeSsm DevEnvironmentSessionType = "SSM" + DevEnvironmentSessionTypeSsh DevEnvironmentSessionType = "SSH" +) + +// Values returns all known values for DevEnvironmentSessionType. 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 (DevEnvironmentSessionType) Values() []DevEnvironmentSessionType { + return []DevEnvironmentSessionType{ + "SSM", + "SSH", + } +} + +type DevEnvironmentStatus string + +// Enum values for DevEnvironmentStatus +const ( + DevEnvironmentStatusPending DevEnvironmentStatus = "PENDING" + DevEnvironmentStatusRunning DevEnvironmentStatus = "RUNNING" + DevEnvironmentStatusStarting DevEnvironmentStatus = "STARTING" + DevEnvironmentStatusStopping DevEnvironmentStatus = "STOPPING" + DevEnvironmentStatusStopped DevEnvironmentStatus = "STOPPED" + DevEnvironmentStatusFailed DevEnvironmentStatus = "FAILED" + DevEnvironmentStatusDeleting DevEnvironmentStatus = "DELETING" + DevEnvironmentStatusDeleted DevEnvironmentStatus = "DELETED" +) + +// Values returns all known values for DevEnvironmentStatus. 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 (DevEnvironmentStatus) Values() []DevEnvironmentStatus { + return []DevEnvironmentStatus{ + "PENDING", + "RUNNING", + "STARTING", + "STOPPING", + "STOPPED", + "FAILED", + "DELETING", + "DELETED", + } +} + +type FilterKey string + +// Enum values for FilterKey +const ( + FilterKeyHasAccessTo FilterKey = "hasAccessTo" +) + +// Values returns all known values for FilterKey. 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 (FilterKey) Values() []FilterKey { + return []FilterKey{ + "hasAccessTo", + } +} + +type InstanceType string + +// Enum values for InstanceType +const ( + InstanceTypeDevStandard1Small InstanceType = "dev.standard1.small" + InstanceTypeDevStandard1Medium InstanceType = "dev.standard1.medium" + InstanceTypeDevStandard1Large InstanceType = "dev.standard1.large" + InstanceTypeDevStandard1Xlarge InstanceType = "dev.standard1.xlarge" +) + +// Values returns all known values for InstanceType. 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 (InstanceType) Values() []InstanceType { + return []InstanceType{ + "dev.standard1.small", + "dev.standard1.medium", + "dev.standard1.large", + "dev.standard1.xlarge", + } +} + +type OperationType string + +// Enum values for OperationType +const ( + OperationTypeReadonly OperationType = "READONLY" + OperationTypeMutation OperationType = "MUTATION" +) + +// Values returns all known values for OperationType. 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 (OperationType) Values() []OperationType { + return []OperationType{ + "READONLY", + "MUTATION", + } +} + +type UserType string + +// Enum values for UserType +const ( + UserTypeUser UserType = "USER" + UserTypeAwsAccount UserType = "AWS_ACCOUNT" + UserTypeUnknown UserType = "UNKNOWN" +) + +// Values returns all known values for UserType. 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 (UserType) Values() []UserType { + return []UserType{ + "USER", + "AWS_ACCOUNT", + "UNKNOWN", + } +} diff --git a/service/codecatalyst/types/errors.go b/service/codecatalyst/types/errors.go new file mode 100644 index 00000000000..059cb91ea75 --- /dev/null +++ b/service/codecatalyst/types/errors.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The request was denied because you don't have sufficient access to perform this +// action. Verify that you are a member of a role that allows this action. +type AccessDeniedException struct { + Message *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 { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied because the requested operation would cause a conflict +// with the current state of a service resource associated with the request. +// Another user might have updated the resource. Reload, make sure you have the +// latest data, and then try again. +type ConflictException struct { + Message *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 { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied because the specified resource was not found. Verify that +// the spelling is correct and that you have access to the resource. +type ResourceNotFoundException struct { + Message *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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied because one or more resources has reached its limits for +// the tier the space belongs to. Either reduce the number of resources, or change +// the tier if applicable. +type ServiceQuotaExceededException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *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 { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied because an input failed to satisfy the constraints +// specified by the service. Check the spelling and input requirements, and then +// try again. +type ValidationException struct { + Message *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 { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/codecatalyst/types/types.go b/service/codecatalyst/types/types.go new file mode 100644 index 00000000000..e1c56e4533d --- /dev/null +++ b/service/codecatalyst/types/types.go @@ -0,0 +1,490 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Information about a specified personal access token (PAT). +type AccessTokenSummary struct { + + // The system-generated ID of the personal access token. + // + // This member is required. + Id *string + + // The friendly name of the personal access token. + // + // This member is required. + Name *string + + // The date and time when the personal access token will expire, in coordinated + // universal time (UTC) timestamp format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). + ExpiresTime *time.Time + + noSmithyDocumentSerde +} + +// Information about connection details for a Dev Environment. +type DevEnvironmentAccessDetails struct { + + // The URL used to send commands to and from the Dev Environment. + // + // This member is required. + StreamUrl *string + + // An encrypted token value that contains session and caller information used to + // authenticate the connection. + // + // This member is required. + TokenValue *string + + noSmithyDocumentSerde +} + +// Information about the source repsitory for a Dev Environment. +type DevEnvironmentRepositorySummary struct { + + // The name of the source repository. + // + // This member is required. + RepositoryName *string + + // The name of the branch in a source repository cloned into the Dev Environment. + BranchName *string + + noSmithyDocumentSerde +} + +// Information about the configuration of a Dev Environment session. +type DevEnvironmentSessionConfiguration struct { + + // The type of the session. + // + // This member is required. + SessionType DevEnvironmentSessionType + + // Information about optional commands that will be run on the Dev Environment when + // the SSH session begins. + ExecuteCommandSessionConfiguration *ExecuteCommandSessionConfiguration + + noSmithyDocumentSerde +} + +// Information about a Dev Environment. +type DevEnvironmentSummary struct { + + // The system-generated unique ID of the user who created the Dev Environment. + // + // This member is required. + CreatorId *string + + // The system-generated unique ID for the Dev Environment. + // + // This member is required. + Id *string + + // The amount of time the Dev Environment will run without any activity detected + // before stopping, in minutes. Dev Environments consume compute minutes when + // running. + // + // This member is required. + InactivityTimeoutMinutes int32 + + // The Amazon EC2 instace type used for the Dev Environment. + // + // This member is required. + InstanceType InstanceType + + // The time when the Dev Environment was last updated, in coordinated universal + // time (UTC) timestamp format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). + // + // This member is required. + LastUpdatedTime *time.Time + + // Information about the configuration of persistent storage for the Dev + // Environment. + // + // This member is required. + PersistentStorage *PersistentStorage + + // Information about the repositories that will be cloned into the Dev Environment. + // If no rvalue is specified, no repository is cloned. + // + // This member is required. + Repositories []DevEnvironmentRepositorySummary + + // The status of the Dev Environment. + // + // This member is required. + Status DevEnvironmentStatus + + // The user-specified alias for the Dev Environment. + Alias *string + + // Information about the integrated development environment (IDE) configured for a + // Dev Environment. + Ides []Ide + + // The name of the project in the space. + ProjectName *string + + // The name of the space. + SpaceName *string + + // The reason for the status. + StatusReason *string + + noSmithyDocumentSerde +} + +// Information about an email address. +type EmailAddress struct { + + // The email address. + Email *string + + // Whether the email address has been verified. + Verified *bool + + noSmithyDocumentSerde +} + +// Information about an entry in an event log of Amazon CodeCatalyst activity. +type EventLogEntry struct { + + // The category for the event. + // + // This member is required. + EventCategory *string + + // The name of the event. + // + // This member is required. + EventName *string + + // The source of the event. + // + // This member is required. + EventSource *string + + // The time the event took place, in coordinated universal time (UTC) timestamp + // format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). + // + // This member is required. + EventTime *time.Time + + // The type of the event. + // + // This member is required. + EventType *string + + // The system-generated unique ID of the event. + // + // This member is required. + Id *string + + // The type of the event. + // + // This member is required. + OperationType OperationType + + // The system-generated unique ID of the user whose actions are recorded in the + // event. + // + // This member is required. + UserIdentity *UserIdentity + + // The code of the error, if any. + ErrorCode *string + + // Information about the project where the event occurred. + ProjectInformation *ProjectInformation + + // The system-generated unique ID of the request. + RequestId *string + + // Information about the payload of the request. + RequestPayload *EventPayload + + // Information about the payload of the response, if any. + ResponsePayload *EventPayload + + // The IP address of the user whose actions are recorded in the event. + SourceIpAddress *string + + // + UserAgent *string + + noSmithyDocumentSerde +} + +// Information about the payload of an event recording Amazon CodeCatalyst +// activity. +type EventPayload struct { + + // The type of content in the event payload. + ContentType *string + + // The data included in the event payload. + Data *string + + noSmithyDocumentSerde +} + +// Information about the commands that will be run on a Dev Environment when an SSH +// session begins. +type ExecuteCommandSessionConfiguration struct { + + // The command used at the beginning of the SSH session to a Dev Environment. + // + // This member is required. + Command *string + + // An array of arguments containing arguments and members. + Arguments []string + + noSmithyDocumentSerde +} + +type Filter struct { + + // + // + // This member is required. + Key *string + + // + // + // This member is required. + Values []string + + // + ComparisonOperator *string + + noSmithyDocumentSerde +} + +// Information about an integrated development environment (IDE) used in a Dev +// Environment. +type Ide struct { + + // The name of the IDE. + Name *string + + // A link to the IDE runtime image. + Runtime *string + + noSmithyDocumentSerde +} + +// Information about the configuration of an integrated development environment +// (IDE) for a Dev Environment. +type IdeConfiguration struct { + + // The name of the IDE. + Name *string + + // A link to the IDE runtime image. + Runtime *string + + noSmithyDocumentSerde +} + +// Information about a source repository returned in a list of source repositories. +type ListSourceRepositoriesItem struct { + + // The time the source repository was created, in coordinated universal time (UTC) + // timestamp format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). + // + // This member is required. + CreatedTime *time.Time + + // The system-generated unique ID of the source repository. + // + // This member is required. + Id *string + + // The time the source repository was last updated, in coordinated universal time + // (UTC) timestamp format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). + // + // This member is required. + LastUpdatedTime *time.Time + + // The name of the source repository. + // + // This member is required. + Name *string + + // The description of the repository, if any. + Description *string + + noSmithyDocumentSerde +} + +// Information about a branch of a source repository returned in a list of +// branches. +type ListSourceRepositoryBranchesItem struct { + + // The commit ID of the tip of the branch at the time of the request, also known as + // the head commit. + HeadCommitId *string + + // The time the branch was last updated, in coordinated universal time (UTC) + // timestamp format as specified in RFC 3339 + // (https://www.rfc-editor.org/rfc/rfc3339#section-5.6). + LastUpdatedTime *time.Time + + // The name of the branch. + Name *string + + // The Git reference name of the branch. + Ref *string + + noSmithyDocumentSerde +} + +// Information about the persistent storage for a Dev Environment. +type PersistentStorage struct { + + // The size of the persistent storage in gigabytes (specifically GiB). Valid values + // for storage are based on memory sizes in 16GB increments. Valid values are 16, + // 32, and 64. + // + // This member is required. + SizeInGiB *int32 + + noSmithyDocumentSerde +} + +// Information about the configuration of persistent storage for a Dev Environment. +type PersistentStorageConfiguration struct { + + // The size of the persistent storage in gigabytes (specifically GiB). Valid values + // for storage are based on memory sizes in 16GB increments. Valid values are 16, + // 32, and 64. + // + // This member is required. + SizeInGiB *int32 + + noSmithyDocumentSerde +} + +// Information about a project in a space. +type ProjectInformation struct { + + // The name of the project in the space. + Name *string + + // The system-generated unique ID of the project. + ProjectId *string + + noSmithyDocumentSerde +} + +// nformation about the filter used to narrow the results returned in a list of +// projects. +type ProjectListFilter struct { + + // A key that can be used to sort results. + // + // This member is required. + Key FilterKey + + // The value of the key. + // + // This member is required. + Values []string + + // The operator used to compare the fields. + ComparisonOperator ComparisonOperator + + noSmithyDocumentSerde +} + +// Information about a project. +type ProjectSummary struct { + + // The name of the project in the space. + // + // This member is required. + Name *string + + // The description of the project. + Description *string + + // The friendly name displayed to users of the project in Amazon CodeCatalyst. + DisplayName *string + + noSmithyDocumentSerde +} + +// Information about a repository that will be cloned to a Dev Environment. +type RepositoryInput struct { + + // The name of the source repository. + // + // This member is required. + RepositoryName *string + + // The name of the branch in a source repository. + BranchName *string + + noSmithyDocumentSerde +} + +// Information about an space. +type SpaceSummary struct { + + // We need to know what this is and the basic usage information so that third-party + // developers know how to use this data type. + // + // This member is required. + Name *string + + // The Amazon Web Services Region where the space exists. + // + // This member is required. + RegionName *string + + // The description of the space. + Description *string + + // The friendly name of the space displayed to users. + DisplayName *string + + noSmithyDocumentSerde +} + +// Information about a user whose activity is recorded in an event for a space. +type UserIdentity struct { + + // + // + // This member is required. + PrincipalId *string + + // The role assigned to the user in a Amazon CodeCatalyst space or project when the + // event occurred. + // + // This member is required. + UserType UserType + + // The Amazon Web Services account number of the user in Amazon Web Services, if + // any. + AwsAccountId *string + + // The display name of the user in Amazon CodeCatalyst. + UserName *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/codecatalyst/validators.go b/service/codecatalyst/validators.go new file mode 100644 index 00000000000..b10bcef7beb --- /dev/null +++ b/service/codecatalyst/validators.go @@ -0,0 +1,1053 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateAccessToken struct { +} + +func (*validateOpCreateAccessToken) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAccessToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAccessTokenInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAccessTokenInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDevEnvironment struct { +} + +func (*validateOpCreateDevEnvironment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDevEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDevEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDevEnvironmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateProject struct { +} + +func (*validateOpCreateProject) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateProjectInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateProjectInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateSourceRepositoryBranch struct { +} + +func (*validateOpCreateSourceRepositoryBranch) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSourceRepositoryBranch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSourceRepositoryBranchInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSourceRepositoryBranchInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAccessToken struct { +} + +func (*validateOpDeleteAccessToken) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAccessToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAccessTokenInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAccessTokenInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDevEnvironment struct { +} + +func (*validateOpDeleteDevEnvironment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDevEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDevEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDevEnvironmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDevEnvironment struct { +} + +func (*validateOpGetDevEnvironment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDevEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDevEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDevEnvironmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetProject struct { +} + +func (*validateOpGetProject) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetProjectInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetProjectInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSourceRepositoryCloneUrls struct { +} + +func (*validateOpGetSourceRepositoryCloneUrls) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSourceRepositoryCloneUrls) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSourceRepositoryCloneUrlsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSourceRepositoryCloneUrlsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSpace struct { +} + +func (*validateOpGetSpace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSpace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSpaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSpaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSubscription struct { +} + +func (*validateOpGetSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListDevEnvironments struct { +} + +func (*validateOpListDevEnvironments) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListDevEnvironments) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListDevEnvironmentsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListDevEnvironmentsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListEventLogs struct { +} + +func (*validateOpListEventLogs) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListEventLogs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListEventLogsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListEventLogsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListProjects struct { +} + +func (*validateOpListProjects) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListProjects) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListProjectsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListProjectsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListSourceRepositories struct { +} + +func (*validateOpListSourceRepositories) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListSourceRepositories) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListSourceRepositoriesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListSourceRepositoriesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListSourceRepositoryBranches struct { +} + +func (*validateOpListSourceRepositoryBranches) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListSourceRepositoryBranches) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListSourceRepositoryBranchesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListSourceRepositoryBranchesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartDevEnvironment struct { +} + +func (*validateOpStartDevEnvironment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartDevEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartDevEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartDevEnvironmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartDevEnvironmentSession struct { +} + +func (*validateOpStartDevEnvironmentSession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartDevEnvironmentSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartDevEnvironmentSessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartDevEnvironmentSessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStopDevEnvironment struct { +} + +func (*validateOpStopDevEnvironment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopDevEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopDevEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopDevEnvironmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateDevEnvironment struct { +} + +func (*validateOpUpdateDevEnvironment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateDevEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateDevEnvironmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateDevEnvironmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateAccessTokenValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAccessToken{}, middleware.After) +} + +func addOpCreateDevEnvironmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDevEnvironment{}, middleware.After) +} + +func addOpCreateProjectValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateProject{}, middleware.After) +} + +func addOpCreateSourceRepositoryBranchValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSourceRepositoryBranch{}, middleware.After) +} + +func addOpDeleteAccessTokenValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAccessToken{}, middleware.After) +} + +func addOpDeleteDevEnvironmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDevEnvironment{}, middleware.After) +} + +func addOpGetDevEnvironmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDevEnvironment{}, middleware.After) +} + +func addOpGetProjectValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetProject{}, middleware.After) +} + +func addOpGetSourceRepositoryCloneUrlsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSourceRepositoryCloneUrls{}, middleware.After) +} + +func addOpGetSpaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSpace{}, middleware.After) +} + +func addOpGetSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSubscription{}, middleware.After) +} + +func addOpListDevEnvironmentsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListDevEnvironments{}, middleware.After) +} + +func addOpListEventLogsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListEventLogs{}, middleware.After) +} + +func addOpListProjectsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListProjects{}, middleware.After) +} + +func addOpListSourceRepositoriesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListSourceRepositories{}, middleware.After) +} + +func addOpListSourceRepositoryBranchesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListSourceRepositoryBranches{}, middleware.After) +} + +func addOpStartDevEnvironmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartDevEnvironment{}, middleware.After) +} + +func addOpStartDevEnvironmentSessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartDevEnvironmentSession{}, middleware.After) +} + +func addOpStopDevEnvironmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopDevEnvironment{}, middleware.After) +} + +func addOpUpdateDevEnvironmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateDevEnvironment{}, middleware.After) +} + +func validateDevEnvironmentSessionConfiguration(v *types.DevEnvironmentSessionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DevEnvironmentSessionConfiguration"} + if len(v.SessionType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SessionType")) + } + if v.ExecuteCommandSessionConfiguration != nil { + if err := validateExecuteCommandSessionConfiguration(v.ExecuteCommandSessionConfiguration); err != nil { + invalidParams.AddNested("ExecuteCommandSessionConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateExecuteCommandSessionConfiguration(v *types.ExecuteCommandSessionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExecuteCommandSessionConfiguration"} + if v.Command == nil { + invalidParams.Add(smithy.NewErrParamRequired("Command")) + } + 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 validateFilters(v []types.Filter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Filters"} + 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 validatePersistentStorageConfiguration(v *types.PersistentStorageConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PersistentStorageConfiguration"} + if v.SizeInGiB == nil { + invalidParams.Add(smithy.NewErrParamRequired("SizeInGiB")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateProjectListFilter(v *types.ProjectListFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ProjectListFilter"} + if len(v.Key) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateProjectListFilters(v []types.ProjectListFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ProjectListFilters"} + for i := range v { + if err := validateProjectListFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRepositoriesInput(v []types.RepositoryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RepositoriesInput"} + for i := range v { + if err := validateRepositoryInput(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRepositoryInput(v *types.RepositoryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RepositoryInput"} + if v.RepositoryName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RepositoryName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAccessTokenInput(v *CreateAccessTokenInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAccessTokenInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDevEnvironmentInput(v *CreateDevEnvironmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDevEnvironmentInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.Repositories != nil { + if err := validateRepositoriesInput(v.Repositories); err != nil { + invalidParams.AddNested("Repositories", err.(smithy.InvalidParamsError)) + } + } + if len(v.InstanceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) + } + if v.PersistentStorage == nil { + invalidParams.Add(smithy.NewErrParamRequired("PersistentStorage")) + } else if v.PersistentStorage != nil { + if err := validatePersistentStorageConfiguration(v.PersistentStorage); err != nil { + invalidParams.AddNested("PersistentStorage", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateProjectInput(v *CreateProjectInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateProjectInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.DisplayName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DisplayName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateSourceRepositoryBranchInput(v *CreateSourceRepositoryBranchInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSourceRepositoryBranchInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.SourceRepositoryName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceRepositoryName")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAccessTokenInput(v *DeleteAccessTokenInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessTokenInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDevEnvironmentInput(v *DeleteDevEnvironmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDevEnvironmentInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDevEnvironmentInput(v *GetDevEnvironmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDevEnvironmentInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetProjectInput(v *GetProjectInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetProjectInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSourceRepositoryCloneUrlsInput(v *GetSourceRepositoryCloneUrlsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSourceRepositoryCloneUrlsInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.SourceRepositoryName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceRepositoryName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSpaceInput(v *GetSpaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSpaceInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSubscriptionInput(v *GetSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSubscriptionInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListDevEnvironmentsInput(v *ListDevEnvironmentsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListDevEnvironmentsInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.Filters != nil { + if err := validateFilters(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListEventLogsInput(v *ListEventLogsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListEventLogsInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.StartTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartTime")) + } + if v.EndTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndTime")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListProjectsInput(v *ListProjectsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListProjectsInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.Filters != nil { + if err := validateProjectListFilters(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListSourceRepositoriesInput(v *ListSourceRepositoriesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListSourceRepositoriesInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListSourceRepositoryBranchesInput(v *ListSourceRepositoryBranchesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListSourceRepositoryBranchesInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.SourceRepositoryName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceRepositoryName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartDevEnvironmentInput(v *StartDevEnvironmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartDevEnvironmentInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartDevEnvironmentSessionInput(v *StartDevEnvironmentSessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartDevEnvironmentSessionInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.SessionConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionConfiguration")) + } else if v.SessionConfiguration != nil { + if err := validateDevEnvironmentSessionConfiguration(v.SessionConfiguration); err != nil { + invalidParams.AddNested("SessionConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStopDevEnvironmentInput(v *StopDevEnvironmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopDevEnvironmentInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateDevEnvironmentInput(v *UpdateDevEnvironmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateDevEnvironmentInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/comprehend/api_op_ClassifyDocument.go b/service/comprehend/api_op_ClassifyDocument.go index 787c92f288a..5a049ff4512 100644 --- a/service/comprehend/api_op_ClassifyDocument.go +++ b/service/comprehend/api_op_ClassifyDocument.go @@ -13,6 +13,14 @@ import ( // Creates a new document classification request to analyze a single document in // real-time, using a previously created and trained custom model and an endpoint. +// You can input plain text or you can upload a single-page input document (text, +// PDF, Word, or image). If the system detects errors while processing a page in +// the input document, the API response includes an entry in Errors that describes +// the errors. If the system detects a document-level error in your input document, +// the API returns an InvalidRequestException error response. For details about +// this exception, see Errors in semi-structured documents +// (https://docs.aws.amazon.com/comprehend/latest/dg/idp-inputs-sync-err.html) in +// the Comprehend Developer Guide. func (c *Client) ClassifyDocument(ctx context.Context, params *ClassifyDocumentInput, optFns ...func(*Options)) (*ClassifyDocumentOutput, error) { if params == nil { params = &ClassifyDocumentInput{} @@ -37,9 +45,24 @@ type ClassifyDocumentInput struct { // This member is required. EndpointArn *string - // The document text to be analyzed. - // - // This member is required. + // Use the Bytes parameter to input a text, PDF, Word or image file. You can also + // use the Bytes parameter to input an Amazon Textract DetectDocumentText or + // AnalyzeDocument output file. Provide the input document as a sequence of + // base64-encoded bytes. If your code uses an Amazon Web Services SDK to classify + // documents, the SDK may encode the document file bytes for you. The maximum + // length of this field depends on the input document type. For details, see + // Inputs for real-time custom analysis + // (https://docs.aws.amazon.com/comprehend/latest/dg/idp-inputs-sync.html) in the + // Comprehend Developer Guide. If you use the Bytes parameter, do not use the Text + // parameter. + Bytes []byte + + // Provides configuration parameters to override the default actions for extracting + // text from PDF documents and image files. + DocumentReaderConfig *types.DocumentReaderConfig + + // The document text to be analyzed. If you enter text using this parameter, do not + // use the Bytes parameter. Text *string noSmithyDocumentSerde @@ -53,6 +76,18 @@ type ClassifyDocumentOutput struct { // be a dog or a cat, but not both at the same time. Classes []types.DocumentClass + // Extraction information about the document. This field is present in the response + // only if your request includes the Byte parameter. + DocumentMetadata *types.DocumentMetadata + + // The document type for each page in the input document. This field is present in + // the response only if your request includes the Byte parameter. + DocumentType []types.DocumentTypeListItem + + // Page-level errors that the system detected while processing the input document. + // The field is empty if the system encountered no errors. + Errors []types.ErrorsListItem + // The labels used the document being analyzed. These are used for multi-label // trained models. Individual labels represent different categories that are // related in some manner and are not mutually exclusive. For example, a movie can diff --git a/service/comprehend/api_op_CreateEntityRecognizer.go b/service/comprehend/api_op_CreateEntityRecognizer.go index b3458527ddc..b615aac30f6 100644 --- a/service/comprehend/api_op_CreateEntityRecognizer.go +++ b/service/comprehend/api_op_CreateEntityRecognizer.go @@ -45,9 +45,11 @@ type CreateEntityRecognizerInput struct { // This member is required. InputDataConfig *types.EntityRecognizerInputDataConfig - // You can specify any of the following languages supported by Amazon Comprehend: - // English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), German ("de"), or - // Portuguese ("pt"). All documents must be in the same language. + // You can specify any of the following languages: English ("en"), Spanish ("es"), + // French ("fr"), Italian ("it"), German ("de"), or Portuguese ("pt"). If you plan + // to use this entity recognizer with PDF, Word, or image input files, you must + // specify English as the language. All training documents must be in the same + // language. // // This member is required. LanguageCode types.LanguageCode diff --git a/service/comprehend/api_op_DescribeResourcePolicy.go b/service/comprehend/api_op_DescribeResourcePolicy.go index 80e1ea8b8a5..2204a4df43c 100644 --- a/service/comprehend/api_op_DescribeResourcePolicy.go +++ b/service/comprehend/api_op_DescribeResourcePolicy.go @@ -30,7 +30,8 @@ func (c *Client) DescribeResourcePolicy(ctx context.Context, params *DescribeRes type DescribeResourcePolicyInput struct { - // The Amazon Resource Name (ARN) of the policy to describe. + // The Amazon Resource Name (ARN) of the custom model version that has the resource + // policy. // // This member is required. ResourceArn *string diff --git a/service/comprehend/api_op_DetectEntities.go b/service/comprehend/api_op_DetectEntities.go index 7a50179dcac..19993079b52 100644 --- a/service/comprehend/api_op_DetectEntities.go +++ b/service/comprehend/api_op_DetectEntities.go @@ -11,10 +11,20 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Inspects text for named entities, and returns information about them. For more -// information, about named entities, see Entities +// Detects named entities in input text when you use the pre-trained model. Detects +// custom entities if you have a custom entity recognition model. When detecting +// named entities using the pre-trained model, use plain text as the input. For +// more information about named entities, see Entities // (https://docs.aws.amazon.com/comprehend/latest/dg/how-entities.html) in the -// Comprehend Developer Guide. +// Comprehend Developer Guide. When you use a custom entity recognition model, you +// can input plain text or you can upload a single-page input document (text, PDF, +// Word, or image). If the system detects errors while processing a page in the +// input document, the API response includes an entry in Errors for each error. If +// the system detects a document-level error in your input document, the API +// returns an InvalidRequestException error response. For details about this +// exception, see Errors in semi-structured documents +// (https://docs.aws.amazon.com/comprehend/latest/dg/idp-inputs-sync-err.html) in +// the Comprehend Developer Guide. func (c *Client) DetectEntities(ctx context.Context, params *DetectEntitiesInput, optFns ...func(*Options)) (*DetectEntitiesOutput, error) { if params == nil { params = &DetectEntitiesInput{} @@ -32,10 +42,24 @@ func (c *Client) DetectEntities(ctx context.Context, params *DetectEntitiesInput type DetectEntitiesInput struct { - // A UTF-8 text string. The maximum string size is 100 KB. - // - // This member is required. - Text *string + // This field applies only when you use a custom entity recognition model that was + // trained with PDF annotations. For other cases, enter your text input in the Text + // field. Use the Bytes parameter to input a text, PDF, Word or image file. Using a + // plain-text file in the Bytes parameter is equivelent to using the Text parameter + // (the Entities field in the response is identical). You can also use the Bytes + // parameter to input an Amazon Textract DetectDocumentText or AnalyzeDocument + // output file. Provide the input document as a sequence of base64-encoded bytes. + // If your code uses an Amazon Web Services SDK to detect entities, the SDK may + // encode the document file bytes for you. The maximum length of this field depends + // on the input document type. For details, see Inputs for real-time custom + // analysis (https://docs.aws.amazon.com/comprehend/latest/dg/idp-inputs-sync.html) + // in the Comprehend Developer Guide. If you use the Bytes parameter, do not use + // the Text parameter. + Bytes []byte + + // Provides configuration parameters to override the default actions for extracting + // text from PDF documents and image files. + DocumentReaderConfig *types.DocumentReaderConfig // The Amazon Resource Name of an endpoint that is associated with a custom entity // recognition model. Provide an endpoint if you want to detect entities by using @@ -47,17 +71,36 @@ type DetectEntitiesInput struct { EndpointArn *string // The language of the input documents. You can specify any of the primary - // languages supported by Amazon Comprehend. All documents must be in the same - // language. If your request includes the endpoint for a custom entity recognition - // model, Amazon Comprehend uses the language of your custom model, and it ignores - // any language code that you specify here. + // languages supported by Amazon Comprehend. If your request includes the endpoint + // for a custom entity recognition model, Amazon Comprehend uses the language of + // your custom model, and it ignores any language code that you specify here. All + // input documents must be in the same language. LanguageCode types.LanguageCode + // A UTF-8 text string. The maximum string size is 100 KB. If you enter text using + // this parameter, do not use the Bytes parameter. + Text *string + noSmithyDocumentSerde } type DetectEntitiesOutput struct { + // Information about each block of text in the input document. Blocks are nested. A + // page block contains a block for each line of text, which contains a block for + // each word. The Block content for a Word input document does not include a + // Geometry field. The Block field is not present in the response for plain-text + // inputs. + Blocks []types.Block + + // Information about the document, discovered during text extraction. This field is + // present in the response only if your request used the Byte parameter. + DocumentMetadata *types.DocumentMetadata + + // The document type for each page in the input document. This field is present in + // the response only if your request used the Byte parameter. + DocumentType []types.DocumentTypeListItem + // A collection of entities identified in the input text. For each entity, the // response provides the entity text, entity type, where the entity text begins and // ends, and the level of confidence that Amazon Comprehend has in the detection. @@ -68,6 +111,10 @@ type DetectEntitiesOutput struct { // the Comprehend Developer Guide. Entities []types.Entity + // Page-level errors that the system detected while processing the input document. + // The field is empty if the system encountered no errors. + Errors []types.ErrorsListItem + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/comprehend/api_op_ListEndpoints.go b/service/comprehend/api_op_ListEndpoints.go index fd8f08b6b93..450f91f0015 100644 --- a/service/comprehend/api_op_ListEndpoints.go +++ b/service/comprehend/api_op_ListEndpoints.go @@ -4,6 +4,7 @@ package comprehend import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" @@ -120,6 +121,95 @@ func (c *Client) addOperationListEndpointsMiddlewares(stack *middleware.Stack, o return nil } +// ListEndpointsAPIClient is a client that implements the ListEndpoints operation. +type ListEndpointsAPIClient interface { + ListEndpoints(context.Context, *ListEndpointsInput, ...func(*Options)) (*ListEndpointsOutput, error) +} + +var _ ListEndpointsAPIClient = (*Client)(nil) + +// ListEndpointsPaginatorOptions is the paginator options for ListEndpoints +type ListEndpointsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + 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 +} + +// ListEndpointsPaginator is a paginator for ListEndpoints +type ListEndpointsPaginator struct { + options ListEndpointsPaginatorOptions + client ListEndpointsAPIClient + params *ListEndpointsInput + nextToken *string + firstPage bool +} + +// NewListEndpointsPaginator returns a new ListEndpointsPaginator +func NewListEndpointsPaginator(client ListEndpointsAPIClient, params *ListEndpointsInput, optFns ...func(*ListEndpointsPaginatorOptions)) *ListEndpointsPaginator { + if params == nil { + params = &ListEndpointsInput{} + } + + options := ListEndpointsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEndpointsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListEndpoints page. +func (p *ListEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEndpointsOutput, 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 + + result, err := p.client.ListEndpoints(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 +} + func newServiceMetadataMiddleware_opListEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListPiiEntitiesDetectionJobs.go b/service/comprehend/api_op_ListPiiEntitiesDetectionJobs.go index b3154418e9a..f6889b7233f 100644 --- a/service/comprehend/api_op_ListPiiEntitiesDetectionJobs.go +++ b/service/comprehend/api_op_ListPiiEntitiesDetectionJobs.go @@ -4,6 +4,7 @@ package comprehend import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" @@ -117,6 +118,99 @@ func (c *Client) addOperationListPiiEntitiesDetectionJobsMiddlewares(stack *midd return nil } +// ListPiiEntitiesDetectionJobsAPIClient is a client that implements the +// ListPiiEntitiesDetectionJobs operation. +type ListPiiEntitiesDetectionJobsAPIClient interface { + ListPiiEntitiesDetectionJobs(context.Context, *ListPiiEntitiesDetectionJobsInput, ...func(*Options)) (*ListPiiEntitiesDetectionJobsOutput, error) +} + +var _ ListPiiEntitiesDetectionJobsAPIClient = (*Client)(nil) + +// ListPiiEntitiesDetectionJobsPaginatorOptions is the paginator options for +// ListPiiEntitiesDetectionJobs +type ListPiiEntitiesDetectionJobsPaginatorOptions struct { + // The maximum number of results to return in each page. + 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 +} + +// ListPiiEntitiesDetectionJobsPaginator is a paginator for +// ListPiiEntitiesDetectionJobs +type ListPiiEntitiesDetectionJobsPaginator struct { + options ListPiiEntitiesDetectionJobsPaginatorOptions + client ListPiiEntitiesDetectionJobsAPIClient + params *ListPiiEntitiesDetectionJobsInput + nextToken *string + firstPage bool +} + +// NewListPiiEntitiesDetectionJobsPaginator returns a new +// ListPiiEntitiesDetectionJobsPaginator +func NewListPiiEntitiesDetectionJobsPaginator(client ListPiiEntitiesDetectionJobsAPIClient, params *ListPiiEntitiesDetectionJobsInput, optFns ...func(*ListPiiEntitiesDetectionJobsPaginatorOptions)) *ListPiiEntitiesDetectionJobsPaginator { + if params == nil { + params = &ListPiiEntitiesDetectionJobsInput{} + } + + options := ListPiiEntitiesDetectionJobsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPiiEntitiesDetectionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPiiEntitiesDetectionJobsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPiiEntitiesDetectionJobs page. +func (p *ListPiiEntitiesDetectionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPiiEntitiesDetectionJobsOutput, 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 + + result, err := p.client.ListPiiEntitiesDetectionJobs(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 +} + func newServiceMetadataMiddleware_opListPiiEntitiesDetectionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_StartTargetedSentimentDetectionJob.go b/service/comprehend/api_op_StartTargetedSentimentDetectionJob.go index 959171c0e75..69bde36f299 100644 --- a/service/comprehend/api_op_StartTargetedSentimentDetectionJob.go +++ b/service/comprehend/api_op_StartTargetedSentimentDetectionJob.go @@ -39,7 +39,8 @@ type StartTargetedSentimentDetectionJobInput struct { // This member is required. DataAccessRoleArn *string - // The input properties for an inference job. + // The input properties for an inference job. The document reader config field + // applies only to non-text inputs for custom analysis. // // This member is required. InputDataConfig *types.InputDataConfig diff --git a/service/comprehend/deserializers.go b/service/comprehend/deserializers.go index 32870c6a567..a43033f7eed 100644 --- a/service/comprehend/deserializers.go +++ b/service/comprehend/deserializers.go @@ -9989,6 +9989,391 @@ func awsAwsjson11_deserializeDocumentBatchSizeLimitExceededException(v **types.B return nil } +func awsAwsjson11_deserializeDocumentBlock(v **types.Block, 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.Block + if *v == nil { + sv = &types.Block{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BlockType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BlockType to be of type string, got %T instead", value) + } + sv.BlockType = types.BlockType(jtv) + } + + case "Geometry": + if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, 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 "Page": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Page = ptr.Int32(int32(i64)) + } + + case "Relationships": + if err := awsAwsjson11_deserializeDocumentListOfRelationships(&sv.Relationships, value); err != nil { + return err + } + + case "Text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentBlockReference(v **types.BlockReference, 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.BlockReference + if *v == nil { + sv = &types.BlockReference{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BeginOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BeginOffset = ptr.Int32(int32(i64)) + } + + case "BlockId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.BlockId = ptr.String(jtv) + } + + case "ChildBlocks": + if err := awsAwsjson11_deserializeDocumentListOfChildBlocks(&sv.ChildBlocks, value); err != nil { + return err + } + + case "EndOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.EndOffset = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentBoundingBox(v **types.BoundingBox, 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.BoundingBox + if *v == nil { + sv = &types.BoundingBox{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Height": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Height = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Height = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + case "Left": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Left = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Left = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + case "Top": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Top = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Top = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + case "Width": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Width = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Width = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentChildBlock(v **types.ChildBlock, 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.ChildBlock + if *v == nil { + sv = &types.ChildBlock{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BeginOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BeginOffset = ptr.Int32(int32(i64)) + } + + case "ChildBlockId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ChildBlockId = ptr.String(jtv) + } + + case "EndOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.EndOffset = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentClassifierEvaluationMetrics(v **types.ClassifierEvaluationMetrics, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10438,6 +10823,19 @@ func awsAwsjson11_deserializeDocumentDocumentClass(v **types.DocumentClass, valu sv.Name = ptr.String(jtv) } + case "Page": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Page = ptr.Int32(int32(i64)) + } + case "Score": if value != nil { switch jtv := value.(type) { @@ -11211,6 +11609,19 @@ func awsAwsjson11_deserializeDocumentDocumentLabel(v **types.DocumentLabel, valu sv.Name = ptr.String(jtv) } + case "Page": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Page = ptr.Int32(int32(i64)) + } + case "Score": if value != nil { switch jtv := value.(type) { @@ -11254,6 +11665,55 @@ func awsAwsjson11_deserializeDocumentDocumentLabel(v **types.DocumentLabel, valu return nil } +func awsAwsjson11_deserializeDocumentDocumentMetadata(v **types.DocumentMetadata, 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.DocumentMetadata + if *v == nil { + sv = &types.DocumentMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExtractedCharacters": + if err := awsAwsjson11_deserializeDocumentListOfExtractedCharacters(&sv.ExtractedCharacters, value); err != nil { + return err + } + + case "Pages": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Pages = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentDocumentReaderConfig(v **types.DocumentReaderConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11308,6 +11768,59 @@ func awsAwsjson11_deserializeDocumentDocumentReaderConfig(v **types.DocumentRead return nil } +func awsAwsjson11_deserializeDocumentDocumentTypeListItem(v **types.DocumentTypeListItem, 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.DocumentTypeListItem + if *v == nil { + sv = &types.DocumentTypeListItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Page": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Page = ptr.Int32(int32(i64)) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentType to be of type string, got %T instead", value) + } + sv.Type = types.DocumentType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentDominantLanguage(v **types.DominantLanguage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11971,6 +12484,11 @@ func awsAwsjson11_deserializeDocumentEntity(v **types.Entity, value interface{}) sv.BeginOffset = ptr.Int32(int32(i64)) } + case "BlockReferences": + if err := awsAwsjson11_deserializeDocumentListOfBlockReferences(&sv.BlockReferences, value); err != nil { + return err + } + case "EndOffset": if value != nil { jtv, ok := value.(json.Number) @@ -13210,6 +13728,68 @@ func awsAwsjson11_deserializeDocumentEntityTypesListItem(v **types.EntityTypesLi return nil } +func awsAwsjson11_deserializeDocumentErrorsListItem(v **types.ErrorsListItem, 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.ErrorsListItem + if *v == nil { + sv = &types.ErrorsListItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PageBasedErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.PageBasedErrorCode(jtv) + } + + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "Page": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Page = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentEventsDetectionJobProperties(v **types.EventsDetectionJobProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13351,7 +13931,98 @@ func awsAwsjson11_deserializeDocumentEventsDetectionJobProperties(v **types.Even return nil } -func awsAwsjson11_deserializeDocumentEventsDetectionJobPropertiesList(v *[]types.EventsDetectionJobProperties, value interface{}) error { +func awsAwsjson11_deserializeDocumentEventsDetectionJobPropertiesList(v *[]types.EventsDetectionJobProperties, 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.EventsDetectionJobProperties + if *v == nil { + cv = []types.EventsDetectionJobProperties{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EventsDetectionJobProperties + destAddr := &col + if err := awsAwsjson11_deserializeDocumentEventsDetectionJobProperties(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentExtractedCharactersListItem(v **types.ExtractedCharactersListItem, 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.ExtractedCharactersListItem + if *v == nil { + sv = &types.ExtractedCharactersListItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Count": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Count = ptr.Int32(int32(i64)) + } + + case "Page": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Page = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentGeometry(v **types.Geometry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13359,29 +14030,36 @@ func awsAwsjson11_deserializeDocumentEventsDetectionJobPropertiesList(v *[]types return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.EventsDetectionJobProperties + var sv *types.Geometry if *v == nil { - cv = []types.EventsDetectionJobProperties{} + sv = &types.Geometry{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.EventsDetectionJobProperties - destAddr := &col - if err := awsAwsjson11_deserializeDocumentEventsDetectionJobProperties(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "BoundingBox": + if err := awsAwsjson11_deserializeDocumentBoundingBox(&sv.BoundingBox, value); err != nil { + return err + } + + case "Polygon": + if err := awsAwsjson11_deserializeDocumentPolygon(&sv.Polygon, value); err != nil { + return err + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } @@ -13519,6 +14197,46 @@ func awsAwsjson11_deserializeDocumentInvalidFilterException(v **types.InvalidFil return nil } +func awsAwsjson11_deserializeDocumentInvalidRequestDetail(v **types.InvalidRequestDetail, 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.InvalidRequestDetail + if *v == nil { + sv = &types.InvalidRequestDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InvalidRequestDetailReason to be of type string, got %T instead", value) + } + sv.Reason = types.InvalidRequestDetailReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13541,6 +14259,11 @@ func awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRe for key, value := range shape { switch key { + case "Detail": + if err := awsAwsjson11_deserializeDocumentInvalidRequestDetail(&sv.Detail, value); err != nil { + return err + } + case "Message": if value != nil { jtv, ok := value.(string) @@ -13550,6 +14273,15 @@ func awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRe sv.Message = ptr.String(jtv) } + case "Reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InvalidRequestReason to be of type string, got %T instead", value) + } + sv.Reason = types.InvalidRequestReason(jtv) + } + default: _, _ = key, value @@ -13923,6 +14655,108 @@ func awsAwsjson11_deserializeDocumentKmsKeyValidationException(v **types.KmsKeyV return nil } +func awsAwsjson11_deserializeDocumentListOfBlockReferences(v *[]types.BlockReference, 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.BlockReference + if *v == nil { + cv = []types.BlockReference{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BlockReference + destAddr := &col + if err := awsAwsjson11_deserializeDocumentBlockReference(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentListOfBlocks(v *[]types.Block, 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.Block + if *v == nil { + cv = []types.Block{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Block + destAddr := &col + if err := awsAwsjson11_deserializeDocumentBlock(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentListOfChildBlocks(v *[]types.ChildBlock, 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.ChildBlock + if *v == nil { + cv = []types.ChildBlock{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ChildBlock + destAddr := &col + if err := awsAwsjson11_deserializeDocumentChildBlock(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentListOfClasses(v *[]types.DocumentClass, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14237,6 +15071,40 @@ func awsAwsjson11_deserializeDocumentListOfDocumentReadFeatureTypes(v *[]types.D return nil } +func awsAwsjson11_deserializeDocumentListOfDocumentType(v *[]types.DocumentTypeListItem, 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.DocumentTypeListItem + if *v == nil { + cv = []types.DocumentTypeListItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DocumentTypeListItem + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDocumentTypeListItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentListOfDominantLanguages(v *[]types.DominantLanguage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14260,7 +15128,75 @@ func awsAwsjson11_deserializeDocumentListOfDominantLanguages(v *[]types.Dominant for _, value := range shape { var col types.DominantLanguage destAddr := &col - if err := awsAwsjson11_deserializeDocumentDominantLanguage(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentDominantLanguage(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentListOfEntities(v *[]types.Entity, 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.Entity + if *v == nil { + cv = []types.Entity{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Entity + destAddr := &col + if err := awsAwsjson11_deserializeDocumentEntity(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentListOfEntityLabels(v *[]types.EntityLabel, 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.EntityLabel + if *v == nil { + cv = []types.EntityLabel{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EntityLabel + destAddr := &col + if err := awsAwsjson11_deserializeDocumentEntityLabel(&destAddr, value); err != nil { return err } col = *destAddr @@ -14271,7 +15207,7 @@ func awsAwsjson11_deserializeDocumentListOfDominantLanguages(v *[]types.Dominant return nil } -func awsAwsjson11_deserializeDocumentListOfEntities(v *[]types.Entity, value interface{}) error { +func awsAwsjson11_deserializeDocumentListOfErrors(v *[]types.ErrorsListItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14284,17 +15220,17 @@ func awsAwsjson11_deserializeDocumentListOfEntities(v *[]types.Entity, value int return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Entity + var cv []types.ErrorsListItem if *v == nil { - cv = []types.Entity{} + cv = []types.ErrorsListItem{} } else { cv = *v } for _, value := range shape { - var col types.Entity + var col types.ErrorsListItem destAddr := &col - if err := awsAwsjson11_deserializeDocumentEntity(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentErrorsListItem(&destAddr, value); err != nil { return err } col = *destAddr @@ -14305,7 +15241,7 @@ func awsAwsjson11_deserializeDocumentListOfEntities(v *[]types.Entity, value int return nil } -func awsAwsjson11_deserializeDocumentListOfEntityLabels(v *[]types.EntityLabel, value interface{}) error { +func awsAwsjson11_deserializeDocumentListOfExtractedCharacters(v *[]types.ExtractedCharactersListItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14318,17 +15254,17 @@ func awsAwsjson11_deserializeDocumentListOfEntityLabels(v *[]types.EntityLabel, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.EntityLabel + var cv []types.ExtractedCharactersListItem if *v == nil { - cv = []types.EntityLabel{} + cv = []types.ExtractedCharactersListItem{} } else { cv = *v } for _, value := range shape { - var col types.EntityLabel + var col types.ExtractedCharactersListItem destAddr := &col - if err := awsAwsjson11_deserializeDocumentEntityLabel(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentExtractedCharactersListItem(&destAddr, value); err != nil { return err } col = *destAddr @@ -14511,6 +15447,40 @@ func awsAwsjson11_deserializeDocumentListOfPiiEntityTypes(v *[]types.PiiEntityTy return nil } +func awsAwsjson11_deserializeDocumentListOfRelationships(v *[]types.RelationshipsListItem, 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.RelationshipsListItem + if *v == nil { + cv = []types.RelationshipsListItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RelationshipsListItem + destAddr := &col + if err := awsAwsjson11_deserializeDocumentRelationshipsListItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentListOfSyntaxTokens(v *[]types.SyntaxToken, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15080,6 +16050,139 @@ func awsAwsjson11_deserializeDocumentPiiOutputDataConfig(v **types.PiiOutputData return nil } +func awsAwsjson11_deserializeDocumentPoint(v **types.Point, 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.Point + if *v == nil { + sv = &types.Point{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "X": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.X = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.X = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + case "Y": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Y = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Y = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPolygon(v *[]types.Point, 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.Point + if *v == nil { + cv = []types.Point{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Point + destAddr := &col + if err := awsAwsjson11_deserializeDocumentPoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentRedactionConfig(v **types.RedactionConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15134,6 +16237,51 @@ func awsAwsjson11_deserializeDocumentRedactionConfig(v **types.RedactionConfig, return nil } +func awsAwsjson11_deserializeDocumentRelationshipsListItem(v **types.RelationshipsListItem, 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.RelationshipsListItem + if *v == nil { + sv = &types.RelationshipsListItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Ids": + if err := awsAwsjson11_deserializeDocumentStringList(&sv.Ids, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RelationshipType to be of type string, got %T instead", value) + } + sv.Type = types.RelationshipType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15681,6 +16829,42 @@ func awsAwsjson11_deserializeDocumentSentimentScore(v **types.SentimentScore, va return nil } +func awsAwsjson11_deserializeDocumentStringList(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 String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentSubnets(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16995,6 +18179,21 @@ func awsAwsjson11_deserializeOpDocumentClassifyDocumentOutput(v **ClassifyDocume return err } + case "DocumentMetadata": + if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { + return err + } + + case "DocumentType": + if err := awsAwsjson11_deserializeDocumentListOfDocumentType(&sv.DocumentType, value); err != nil { + return err + } + + case "Errors": + if err := awsAwsjson11_deserializeDocumentListOfErrors(&sv.Errors, value); err != nil { + return err + } + case "Labels": if err := awsAwsjson11_deserializeDocumentListOfLabels(&sv.Labels, value); err != nil { return err @@ -17860,11 +19059,31 @@ func awsAwsjson11_deserializeOpDocumentDetectEntitiesOutput(v **DetectEntitiesOu for key, value := range shape { switch key { + case "Blocks": + if err := awsAwsjson11_deserializeDocumentListOfBlocks(&sv.Blocks, value); err != nil { + return err + } + + case "DocumentMetadata": + if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { + return err + } + + case "DocumentType": + if err := awsAwsjson11_deserializeDocumentListOfDocumentType(&sv.DocumentType, value); err != nil { + return err + } + case "Entities": if err := awsAwsjson11_deserializeDocumentListOfEntities(&sv.Entities, value); err != nil { return err } + case "Errors": + if err := awsAwsjson11_deserializeDocumentListOfErrors(&sv.Errors, value); err != nil { + return err + } + default: _, _ = key, value diff --git a/service/comprehend/serializers.go b/service/comprehend/serializers.go index ca81adfa7db..3df4bc59ae8 100644 --- a/service/comprehend/serializers.go +++ b/service/comprehend/serializers.go @@ -4934,6 +4934,18 @@ func awsAwsjson11_serializeOpDocumentClassifyDocumentInput(v *ClassifyDocumentIn object := value.Object() defer object.Close() + if v.Bytes != nil { + ok := object.Key("Bytes") + ok.Base64EncodeBytes(v.Bytes) + } + + if v.DocumentReaderConfig != nil { + ok := object.Key("DocumentReaderConfig") + if err := awsAwsjson11_serializeDocumentDocumentReaderConfig(v.DocumentReaderConfig, ok); err != nil { + return err + } + } + if v.EndpointArn != nil { ok := object.Key("EndpointArn") ok.String(*v.EndpointArn) @@ -5376,6 +5388,18 @@ func awsAwsjson11_serializeOpDocumentDetectEntitiesInput(v *DetectEntitiesInput, object := value.Object() defer object.Close() + if v.Bytes != nil { + ok := object.Key("Bytes") + ok.Base64EncodeBytes(v.Bytes) + } + + if v.DocumentReaderConfig != nil { + ok := object.Key("DocumentReaderConfig") + if err := awsAwsjson11_serializeDocumentDocumentReaderConfig(v.DocumentReaderConfig, ok); err != nil { + return err + } + } + if v.EndpointArn != nil { ok := object.Key("EndpointArn") ok.String(*v.EndpointArn) diff --git a/service/comprehend/types/enums.go b/service/comprehend/types/enums.go index 17f05f8ee35..bcb04fe5c3f 100644 --- a/service/comprehend/types/enums.go +++ b/service/comprehend/types/enums.go @@ -21,6 +21,24 @@ func (AugmentedManifestsDocumentTypeFormat) Values() []AugmentedManifestsDocumen } } +type BlockType string + +// Enum values for BlockType +const ( + BlockTypeLine BlockType = "LINE" + BlockTypeWord BlockType = "WORD" +) + +// Values returns all known values for BlockType. 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 (BlockType) Values() []BlockType { + return []BlockType{ + "LINE", + "WORD", + } +} + type DocumentClassifierDataFormat string // Enum values for DocumentClassifierDataFormat @@ -111,6 +129,34 @@ func (DocumentReadMode) Values() []DocumentReadMode { } } +type DocumentType string + +// Enum values for DocumentType +const ( + DocumentTypeNativePdf DocumentType = "NATIVE_PDF" + DocumentTypeScannedPdf DocumentType = "SCANNED_PDF" + DocumentTypeMsWord DocumentType = "MS_WORD" + DocumentTypeImage DocumentType = "IMAGE" + DocumentTypePlainText DocumentType = "PLAIN_TEXT" + DocumentTypeTextractDetectDocumentTextJson DocumentType = "TEXTRACT_DETECT_DOCUMENT_TEXT_JSON" + DocumentTypeTextractAnalyzeDocumentJson DocumentType = "TEXTRACT_ANALYZE_DOCUMENT_JSON" +) + +// Values returns all known values for DocumentType. 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 (DocumentType) Values() []DocumentType { + return []DocumentType{ + "NATIVE_PDF", + "SCANNED_PDF", + "MS_WORD", + "IMAGE", + "PLAIN_TEXT", + "TEXTRACT_DETECT_DOCUMENT_TEXT_JSON", + "TEXTRACT_ANALYZE_DOCUMENT_JSON", + } +} + type EndpointStatus string // Enum values for EndpointStatus @@ -203,6 +249,44 @@ func (InputFormat) Values() []InputFormat { } } +type InvalidRequestDetailReason string + +// Enum values for InvalidRequestDetailReason +const ( + InvalidRequestDetailReasonDocumentSizeExceeded InvalidRequestDetailReason = "DOCUMENT_SIZE_EXCEEDED" + InvalidRequestDetailReasonUnsupportedDocType InvalidRequestDetailReason = "UNSUPPORTED_DOC_TYPE" + InvalidRequestDetailReasonPageLimitExceeded InvalidRequestDetailReason = "PAGE_LIMIT_EXCEEDED" + InvalidRequestDetailReasonTextractAccessDenied InvalidRequestDetailReason = "TEXTRACT_ACCESS_DENIED" +) + +// Values returns all known values for InvalidRequestDetailReason. 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 (InvalidRequestDetailReason) Values() []InvalidRequestDetailReason { + return []InvalidRequestDetailReason{ + "DOCUMENT_SIZE_EXCEEDED", + "UNSUPPORTED_DOC_TYPE", + "PAGE_LIMIT_EXCEEDED", + "TEXTRACT_ACCESS_DENIED", + } +} + +type InvalidRequestReason string + +// Enum values for InvalidRequestReason +const ( + InvalidRequestReasonInvalidDocument InvalidRequestReason = "INVALID_DOCUMENT" +) + +// Values returns all known values for InvalidRequestReason. 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 (InvalidRequestReason) Values() []InvalidRequestReason { + return []InvalidRequestReason{ + "INVALID_DOCUMENT", + } +} + type JobStatus string // Enum values for JobStatus @@ -295,6 +379,30 @@ func (ModelStatus) Values() []ModelStatus { } } +type PageBasedErrorCode string + +// Enum values for PageBasedErrorCode +const ( + PageBasedErrorCodeTextractBadPage PageBasedErrorCode = "TEXTRACT_BAD_PAGE" + PageBasedErrorCodeTextractProvisionedThroughputExceeded PageBasedErrorCode = "TEXTRACT_PROVISIONED_THROUGHPUT_EXCEEDED" + PageBasedErrorCodePageCharactersExceeded PageBasedErrorCode = "PAGE_CHARACTERS_EXCEEDED" + PageBasedErrorCodePageSizeExceeded PageBasedErrorCode = "PAGE_SIZE_EXCEEDED" + PageBasedErrorCodeInternalServerError PageBasedErrorCode = "INTERNAL_SERVER_ERROR" +) + +// Values returns all known values for PageBasedErrorCode. 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 (PageBasedErrorCode) Values() []PageBasedErrorCode { + return []PageBasedErrorCode{ + "TEXTRACT_BAD_PAGE", + "TEXTRACT_PROVISIONED_THROUGHPUT_EXCEEDED", + "PAGE_CHARACTERS_EXCEEDED", + "PAGE_SIZE_EXCEEDED", + "INTERNAL_SERVER_ERROR", + } +} + type PartOfSpeechTagType string // Enum values for PartOfSpeechTagType @@ -469,6 +577,22 @@ func (PiiEntityType) Values() []PiiEntityType { } } +type RelationshipType string + +// Enum values for RelationshipType +const ( + RelationshipTypeChild RelationshipType = "CHILD" +) + +// Values returns all known values for RelationshipType. 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 (RelationshipType) Values() []RelationshipType { + return []RelationshipType{ + "CHILD", + } +} + type SentimentType string // Enum values for SentimentType diff --git a/service/comprehend/types/errors.go b/service/comprehend/types/errors.go index 1a58d845e74..0f05bc98f2c 100644 --- a/service/comprehend/types/errors.go +++ b/service/comprehend/types/errors.go @@ -93,6 +93,9 @@ func (e *InvalidFilterException) ErrorFault() smithy.ErrorFault { return smithy. type InvalidRequestException struct { Message *string + Reason InvalidRequestReason + Detail *InvalidRequestDetail + noSmithyDocumentSerde } diff --git a/service/comprehend/types/types.go b/service/comprehend/types/types.go index cb8a18013eb..0baecfa466c 100644 --- a/service/comprehend/types/types.go +++ b/service/comprehend/types/types.go @@ -159,6 +159,100 @@ type BatchItemError struct { noSmithyDocumentSerde } +// Information about each word or line of text in the input document. For +// additional information, see Block +// (https://docs.aws.amazon.com/textract/latest/dg/API_Block.html) in the Amazon +// Textract API reference. +type Block struct { + + // The block represents a line of text or one word of text. + // + // * WORD - A word that's + // detected on a document page. A word is one or more ISO basic Latin script + // characters that aren't separated by spaces. + // + // * LINE - A string of tab-delimited, + // contiguous words that are detected on a document page + BlockType BlockType + + // Co-ordinates of the rectangle or polygon that contains the text. + Geometry *Geometry + + // Unique identifier for the block. + Id *string + + // Page number where the block appears. + Page *int32 + + // A list of child blocks of the current block. For example, a LINE object has + // child blocks for each WORD block that's part of the line of text. + Relationships []RelationshipsListItem + + // The word or line of text extracted from the block. + Text *string + + noSmithyDocumentSerde +} + +// A reference to a block. +type BlockReference struct { + + // Offset of the start of the block within its parent block. + BeginOffset *int32 + + // Unique identifier for the block. + BlockId *string + + // List of child blocks within this block. + ChildBlocks []ChildBlock + + // Offset of the end of the block within its parent block. + EndOffset *int32 + + noSmithyDocumentSerde +} + +// The bounding box around the detected page or around an element on a document +// page. The left (x-coordinate) and top (y-coordinate) are coordinates that +// represent the top and left sides of the bounding box. Note that the upper-left +// corner of the image is the origin (0,0). For additional information, see +// BoundingBox +// (https://docs.aws.amazon.com/textract/latest/dg/API_BoundingBox.html) in the +// Amazon Textract API reference. +type BoundingBox struct { + + // The height of the bounding box as a ratio of the overall document page height. + Height *float32 + + // The left coordinate of the bounding box as a ratio of overall document page + // width. + Left *float32 + + // The top coordinate of the bounding box as a ratio of overall document page + // height. + Top *float32 + + // The width of the bounding box as a ratio of the overall document page width. + Width *float32 + + noSmithyDocumentSerde +} + +// Nested block contained within a block. +type ChildBlock struct { + + // Offset of the start of the child block within its parent block. + BeginOffset *int32 + + // Unique identifier for the child block. + ChildBlockId *string + + // Offset of the end of the child block within its parent block. + EndOffset *int32 + + noSmithyDocumentSerde +} + // Describes the result metrics for the test data associated with an documentation // classifier. type ClassifierEvaluationMetrics struct { @@ -240,6 +334,10 @@ type DocumentClass struct { // The name of the class. Name *string + // Page number in the input document. This field is present in the response only if + // your request includes the Byte parameter. + Page *int32 + // The confidence score that Amazon Comprehend has this class correctly attributed. Score *float32 @@ -573,43 +671,99 @@ type DocumentLabel struct { // The name of the label. Name *string + // Page number where the label occurs. This field is present in the response only + // if your request includes the Byte parameter. + Page *int32 + // The confidence score that Amazon Comprehend has this label correctly attributed. Score *float32 noSmithyDocumentSerde } -// The input properties for a topic detection job. +// Information about the document, discovered during text extraction. +type DocumentMetadata struct { + + // List of pages in the document, with the number of characters extracted from each + // page. + ExtractedCharacters []ExtractedCharactersListItem + + // Number of pages in the document. + Pages *int32 + + noSmithyDocumentSerde +} + +// Provides configuration parameters to override the default actions for extracting +// text from PDF documents and image files. By default, Amazon Comprehend performs +// the following actions to extract text from files, based on the input file +// type: +// +// * Word files - Amazon Comprehend parser extracts the text. +// +// * Digital PDF +// files - Amazon Comprehend parser extracts the text. +// +// * Image files and scanned +// PDF files - Amazon Comprehend uses the Amazon Textract DetectDocumentText API to +// extract the text. +// +// DocumentReaderConfig does not apply to plain text files or +// Word files. For image files and PDF documents, you can override these default +// actions using the fields listed below. For more information, see Setting text +// extraction options +// (https://docs.aws.amazon.com/comprehend/latest/dg/detecting-cer.html#detecting-cer-pdf). type DocumentReaderConfig struct { - // This enum field will start with two values which will apply to PDFs: + // This field defines the Amazon Textract API operation that Amazon Comprehend uses + // to extract text from PDF files and image files. Enter one of the following + // values: // - // * - // TEXTRACT_DETECT_DOCUMENT_TEXT - The service calls DetectDocumentText for PDF - // documents per page. + // * TEXTRACT_DETECT_DOCUMENT_TEXT - The Amazon Comprehend service uses + // the DetectDocumentText API operation. // - // * TEXTRACT_ANALYZE_DOCUMENT - The service calls - // AnalyzeDocument for PDF documents per page. + // * TEXTRACT_ANALYZE_DOCUMENT - The Amazon + // Comprehend service uses the AnalyzeDocument API operation. // // This member is required. DocumentReadAction DocumentReadAction - // This enum field provides two values: + // Determines the text extraction actions for PDF files. Enter one of the following + // values: // - // * SERVICE_DEFAULT - use service defaults - // for Document reading. For Digital PDF it would mean using an internal parser - // instead of Textract APIs + // * SERVICE_DEFAULT - use the Amazon Comprehend service defaults for PDF + // files. // - // * FORCE_DOCUMENT_READ_ACTION - Always use specified - // action for DocumentReadAction, including Digital PDF. + // * FORCE_DOCUMENT_READ_ACTION - Amazon Comprehend uses the Textract API + // specified by DocumentReadAction for all PDF files, including digital PDF files. DocumentReadMode DocumentReadMode - // Specifies how the text in an input file should be processed: + // Specifies the type of Amazon Textract features to apply. If you chose + // TEXTRACT_ANALYZE_DOCUMENT as the read action, you must specify one or both of + // the following values: + // + // * TABLES - Returns information about any tables that are + // detected in the input document. + // + // * FORMS - Returns information and the data from + // any forms that are detected in the input document. FeatureTypes []DocumentReadFeatureTypes noSmithyDocumentSerde } +// Document type for each page in the document. +type DocumentTypeListItem struct { + + // Page number. + Page *int32 + + // Document type. + Type DocumentType + + noSmithyDocumentSerde +} + // Returns the code for the dominant language in the input text and the level of // confidence that Amazon Comprehend has in the accuracy of the detection. type DominantLanguage struct { @@ -879,11 +1033,15 @@ type EntitiesDetectionJobProperties struct { type Entity struct { // The zero-based offset from the beginning of the source text to the first - // character in the entity. + // character in the entity. This field is empty for non-text input. BeginOffset *int32 + // A reference to each block for this entity. This field is empty for plain-text + // input. + BlockReferences []BlockReference + // The zero-based offset from the beginning of the source text to the last - // character in the entity. + // character in the entity. This field is empty for non-text input. EndOffset *int32 // The level of confidence that Amazon Comprehend has in the accuracy of the @@ -893,7 +1051,10 @@ type Entity struct { // The text of the entity. Text *string - // The entity's type. + // The entity type. For entity detection using the built-in model, this field + // contains one of the standard entity types listed below. For custom entity + // detection, this field contains one of the entity types that you specified when + // you trained your custom model. Type EntityType noSmithyDocumentSerde @@ -1246,6 +1407,43 @@ type EntityTypesListItem struct { noSmithyDocumentSerde } +// Text extraction encountered one or more page-level errors in the input document. +// The ErrorCode contains one of the following values: +// +// * TEXTRACT_BAD_PAGE - +// Amazon Textract cannot read the page. For more information about page limits in +// Amazon Textract, see Page Quotas in Amazon Textract +// (https://docs.aws.amazon.com/textract/latest/dg/limits-document.html). +// +// * +// TEXTRACT_PROVISIONED_THROUGHPUT_EXCEEDED - The number of requests exceeded your +// throughput limit. For more information about throughput quotas in Amazon +// Textract, see Default quotas in Amazon Textract +// (https://docs.aws.amazon.com/textract/latest/dg/limits-quotas-explained.html). +// +// * +// PAGE_CHARACTERS_EXCEEDED - Too many text characters on the page (10,000 +// characters maximum). +// +// * PAGE_SIZE_EXCEEDED - The maximum page size is 10 MB. +// +// * +// INTERNAL_SERVER_ERROR - The request encountered a service issue. Try the API +// request again. +type ErrorsListItem struct { + + // Error code for the cause of the error. + ErrorCode PageBasedErrorCode + + // Text message explaining the reason for the error. + ErrorMessage *string + + // Page number where the error occurred. + Page *int32 + + noSmithyDocumentSerde +} + // Provides information for filtering a list of event detection jobs. type EventsDetectionJobFilter struct { @@ -1318,7 +1516,36 @@ type EventsDetectionJobProperties struct { noSmithyDocumentSerde } -// The input properties for an inference job. +// Array of the number of characters extracted from each page. +type ExtractedCharactersListItem struct { + + // Number of characters extracted from each page. + Count *int32 + + // Page number. + Page *int32 + + noSmithyDocumentSerde +} + +// Information about the location of items on a document page. For additional +// information, see Geometry +// (https://docs.aws.amazon.com/textract/latest/dg/API_Geometry.html) in the Amazon +// Textract API reference. +type Geometry struct { + + // An axis-aligned coarse representation of the location of the recognized item on + // the document page. + BoundingBox *BoundingBox + + // Within the bounding box, a fine-grained polygon around the recognized item. + Polygon []Point + + noSmithyDocumentSerde +} + +// The input properties for an inference job. The document reader config field +// applies only to non-text inputs for custom analysis. type InputDataConfig struct { // The Amazon S3 URI for the input data. The URI must be in same region as the API @@ -1331,10 +1558,8 @@ type InputDataConfig struct { // This member is required. S3Uri *string - // The document reader config field applies only for InputDataConfig of - // StartEntitiesDetectionJob. Use DocumentReaderConfig to provide specifications - // about how you want your inference documents read. Currently it applies for PDF - // documents in StartEntitiesDetectionJob custom inference. + // Provides configuration parameters to override the default actions for extracting + // text from PDF documents and image files. DocumentReaderConfig *DocumentReaderConfig // Specifies how the text in an input file should be processed: @@ -1351,6 +1576,28 @@ type InputDataConfig struct { noSmithyDocumentSerde } +// Provides additional detail about why the request failed: +// +// * Document size is too +// large - Check the size of your file and resubmit the request. +// +// * Document type +// is not supported - Check the file type and resubmit the request. +// +// * Too many +// pages in the document - Check the number of pages in your file and resubmit the +// request. +// +// * Access denied to Amazon Textract - Verify that your account has +// permission to use Amazon Textract API operations and resubmit the request. +type InvalidRequestDetail struct { + + // Reason code is INVALID_DOCUMENT. + Reason InvalidRequestDetailReason + + noSmithyDocumentSerde +} + // Describes a key noun phrase. type KeyPhrase struct { @@ -1650,6 +1897,21 @@ type PiiOutputDataConfig struct { noSmithyDocumentSerde } +// The X and Y coordinates of a point on a document page. For additional +// information, see Point +// (https://docs.aws.amazon.com/textract/latest/dg/API_Point.html) in the Amazon +// Textract API reference. +type Point struct { + + // The value of the X coordinate for a point on a polygon + X *float32 + + // The value of the Y coordinate for a point on a polygon + Y *float32 + + noSmithyDocumentSerde +} + // Provides configuration parameters for PII entity redaction. type RedactionConfig struct { @@ -1667,6 +1929,18 @@ type RedactionConfig struct { noSmithyDocumentSerde } +// List of child blocks for the current block. +type RelationshipsListItem struct { + + // Identifers of the child blocks. + Ids []string + + // Only supported relationship is a child relationship. + Type RelationshipType + + noSmithyDocumentSerde +} + // Provides information for filtering a list of dominant language detection jobs. // For more information, see the operation. type SentimentDetectionJobFilter struct { @@ -1863,7 +2137,8 @@ type TargetedSentimentDetectionJobProperties struct { // The time that the targeted sentiment detection job ended. EndTime *time.Time - // The input properties for an inference job. + // The input properties for an inference job. The document reader config field + // applies only to non-text inputs for custom analysis. InputDataConfig *InputDataConfig // The Amazon Resource Name (ARN) of the targeted sentiment detection job. It is a diff --git a/service/comprehend/validators.go b/service/comprehend/validators.go index 293af8d2c21..1bded6c185f 100644 --- a/service/comprehend/validators.go +++ b/service/comprehend/validators.go @@ -1821,12 +1821,14 @@ func validateOpClassifyDocumentInput(v *ClassifyDocumentInput) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "ClassifyDocumentInput"} - if v.Text == nil { - invalidParams.Add(smithy.NewErrParamRequired("Text")) - } if v.EndpointArn == nil { invalidParams.Add(smithy.NewErrParamRequired("EndpointArn")) } + if v.DocumentReaderConfig != nil { + if err := validateDocumentReaderConfig(v.DocumentReaderConfig); err != nil { + invalidParams.AddNested("DocumentReaderConfig", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2229,8 +2231,10 @@ func validateOpDetectEntitiesInput(v *DetectEntitiesInput) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "DetectEntitiesInput"} - if v.Text == nil { - invalidParams.Add(smithy.NewErrParamRequired("Text")) + if v.DocumentReaderConfig != nil { + if err := validateDocumentReaderConfig(v.DocumentReaderConfig); err != nil { + invalidParams.AddNested("DocumentReaderConfig", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams diff --git a/service/gamelift/api_op_AcceptMatch.go b/service/gamelift/api_op_AcceptMatch.go index 01b51b67764..b7bf11daaa2 100644 --- a/service/gamelift/api_op_AcceptMatch.go +++ b/service/gamelift/api_op_AcceptMatch.go @@ -33,9 +33,7 @@ import ( // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-client.html) // FlexMatch events // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-events.html) -// (reference) Related actions StartMatchmaking | DescribeMatchmaking | -// StopMatchmaking | AcceptMatch | StartMatchBackfill | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// (reference) func (c *Client) AcceptMatch(ctx context.Context, params *AcceptMatchInput, optFns ...func(*Options)) (*AcceptMatchOutput, error) { if params == nil { params = &AcceptMatchInput{} @@ -51,7 +49,6 @@ func (c *Client) AcceptMatch(ctx context.Context, params *AcceptMatchInput, optF return out, nil } -// Represents the input for a request operation. type AcceptMatchInput struct { // Player response to the proposed match. diff --git a/service/gamelift/api_op_ClaimGameServer.go b/service/gamelift/api_op_ClaimGameServer.go index 2c2667b6f23..e5e735d97ea 100644 --- a/service/gamelift/api_op_ClaimGameServer.go +++ b/service/gamelift/api_op_ClaimGameServer.go @@ -25,26 +25,24 @@ import ( // connection information is returned. A claimed game server's utilization status // remains AVAILABLE while the claim status is set to CLAIMED for up to 60 seconds. // This time period gives the game server time to update its status to UTILIZED -// (using UpdateGameServer) once players join. If the game server's status is not -// updated within 60 seconds, the game server reverts to unclaimed status and is -// available to be claimed by another request. The claim time period is a fixed -// value and is not configurable. If you try to claim a specific game server, this -// request will fail in the following cases: +// after players join. If the game server's status is not updated within 60 +// seconds, the game server reverts to unclaimed status and is available to be +// claimed by another request. The claim time period is a fixed value and is not +// configurable. If you try to claim a specific game server, this request will fail +// in the following cases: // -// * If the game server utilization -// status is UTILIZED. +// * If the game server utilization status is UTILIZED. // -// * If the game server claim status is CLAIMED. +// * +// If the game server claim status is CLAIMED. // -// When -// claiming a specific game server, this request will succeed even if the game -// server is running on an instance in DRAINING status. To avoid this, first check -// the instance status by calling DescribeGameServerInstances. Learn more GameLift -// FleetIQ Guide +// When claiming a specific game +// server, this request will succeed even if the game server is running on an +// instance in DRAINING status. To avoid this, first check the instance status by +// calling DescribeGameServerInstances +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameServerInstances.html) +// . Learn more GameLift FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions RegisterGameServer | ListGameServers | ClaimGameServer | -// DescribeGameServer | UpdateGameServer | DeregisterGameServer | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) ClaimGameServer(ctx context.Context, params *ClaimGameServerInput, optFns ...func(*Options)) (*ClaimGameServerOutput, error) { if params == nil { params = &ClaimGameServerInput{} @@ -63,16 +61,15 @@ func (c *Client) ClaimGameServer(ctx context.Context, params *ClaimGameServerInp type ClaimGameServerInput struct { // A unique identifier for the game server group where the game server is running. - // Use either the GameServerGroup name or ARN value. If you are not specifying a - // game server to claim, this value identifies where you want GameLift FleetIQ to - // look for an available game server to claim. + // If you are not specifying a game server to claim, this value identifies where + // you want GameLift FleetIQ to look for an available game server to claim. // // This member is required. GameServerGroupName *string // A set of custom game server properties, formatted as a single string value. This // data is passed to a game client or service when it requests information on game - // servers using ListGameServers or ClaimGameServer. + // servers. GameServerData *string // A custom string that uniquely identifies the game server to claim. If this diff --git a/service/gamelift/api_op_CreateAlias.go b/service/gamelift/api_op_CreateAlias.go index 14ac963d1af..628f8fafc78 100644 --- a/service/gamelift/api_op_CreateAlias.go +++ b/service/gamelift/api_op_CreateAlias.go @@ -23,8 +23,7 @@ import ( // and optional description. Each simple alias can point to only one fleet, but a // fleet can have multiple aliases. If successful, a new alias record is returned, // including an alias ID and an ARN. You can reassign an alias to another fleet by -// calling UpdateAlias. Related actions CreateAlias | ListAliases | DescribeAlias | -// UpdateAlias | DeleteAlias | ResolveAlias | All APIs by task +// calling UpdateAlias. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreateAlias(ctx context.Context, params *CreateAliasInput, optFns ...func(*Options)) (*CreateAliasOutput, error) { if params == nil { @@ -41,7 +40,6 @@ func (c *Client) CreateAlias(ctx context.Context, params *CreateAliasInput, optF return out, nil } -// Represents the input for a request operation. type CreateAliasInput struct { // A descriptive label that is associated with an alias. Alias names do not need to @@ -64,16 +62,12 @@ type CreateAliasInput struct { // management, access management and cost allocation. For more information, see // Tagging Amazon Web Services Resources // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon - // Web Services General Reference. Once the resource is created, you can use - // TagResource, UntagResource, and ListTagsForResource to add, remove, and view - // tags. The maximum tag limit may be lower than stated. See the Amazon Web - // Services General Reference for actual tagging limits. + // Web Services General Reference. Tags []types.Tag noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type CreateAliasOutput struct { // The newly created alias resource. diff --git a/service/gamelift/api_op_CreateBuild.go b/service/gamelift/api_op_CreateBuild.go index 2b38cf2f12e..645dc8c4ddd 100644 --- a/service/gamelift/api_op_CreateBuild.go +++ b/service/gamelift/api_op_CreateBuild.go @@ -12,40 +12,39 @@ import ( ) // Creates a new Amazon GameLift build resource for your game server binary files. -// Game server binaries must be combined into a zip file for use with Amazon -// GameLift. When setting up a new game build for GameLift, we recommend using the -// Amazon Web Services CLI command upload-build +// Combine game server binaries into a zip file for use with Amazon GameLift. When +// setting up a new game build for GameLift, we recommend using the CLI command +// upload-build // (https://docs.aws.amazon.com/cli/latest/reference/gamelift/upload-build.html) . // This helper command combines two tasks: (1) it uploads your build files from a // file directory to a GameLift Amazon S3 location, and (2) it creates a new build -// resource. The CreateBuild operation can used in the following scenarios: +// resource. You can use the operation in the following scenarios: // -// * To -// create a new game build with build files that are in an Amazon S3 location under -// an Amazon Web Services account that you control. To use this option, you must -// first give Amazon GameLift access to the Amazon S3 bucket. With permissions in -// place, call CreateBuild and specify a build name, operating system, and the -// Amazon S3 storage location of your game build. +// * To create a +// new game build with build files that are in an Amazon S3 location under an +// Amazon Web Services account that you control. To use this option, you give +// Amazon GameLift access to the Amazon S3 bucket. With permissions in place, +// specify a build name, operating system, and the Amazon S3 storage location of +// your game build. // -// * To directly upload your build -// files to a GameLift Amazon S3 location. To use this option, first call -// CreateBuild and specify a build name and operating system. This operation -// creates a new build resource and also returns an Amazon S3 location with -// temporary access credentials. Use the credentials to manually upload your build -// files to the specified Amazon S3 location. For more information, see Uploading -// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/UploadingObjects.html) -// in the Amazon S3 Developer Guide. Build files can be uploaded to the GameLift -// Amazon S3 location once only; that can't be updated. +// * To directly upload your build files to a GameLift Amazon S3 +// location. To use this option, specify a build name and operating system. This +// operation creates a new build resource and also returns an Amazon S3 location +// with temporary access credentials. Use the credentials to manually upload your +// build files to the specified Amazon S3 location. For more information, see +// Uploading Objects +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/UploadingObjects.html) in the +// Amazon S3 Developer Guide. After you upload build files to the GameLift Amazon +// S3 location, you can't update them. // -// If successful, this -// operation creates a new build resource with a unique build ID and places it in -// INITIALIZED status. A build must be in READY status before you can create fleets -// with it. Learn more Uploading Your Game +// If successful, this operation creates a new +// build resource with a unique build ID and places it in INITIALIZED status. A +// build must be in READY status before you can create fleets with it. Learn more +// Uploading Your Game // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html) // Create a Build with Files in Amazon S3 -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html#gamelift-build-cli-uploading-create-build) -// Related actions CreateBuild | ListBuilds | DescribeBuild | UpdateBuild | -// DeleteBuild | All APIs by task +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html#gamelift-build-cli-uploading-create-build)All +// APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreateBuild(ctx context.Context, params *CreateBuildInput, optFns ...func(*Options)) (*CreateBuildOutput, error) { if params == nil { @@ -62,21 +61,25 @@ func (c *Client) CreateBuild(ctx context.Context, params *CreateBuildInput, optF return out, nil } -// Represents the input for a request operation. type CreateBuildInput struct { - // A descriptive label that is associated with a build. Build names do not need to - // be unique. You can use UpdateBuild to change this value later. + // A descriptive label associated with a build. Build names do not need to be + // unique. You can change this value later. Name *string - // The operating system that the game server binaries are built to run on. This + // The operating system that you built the game server binaries to run on. This // value determines the type of fleet resources that you can use for this build. If // your game build contains multiple executables, they all must run on the same // operating system. If an operating system is not specified when creating a build, - // Amazon GameLift uses the default value (WINDOWS_2012). This value cannot be - // changed later. + // GameLift uses the default value (WINDOWS_2012). This value cannot be changed + // later. OperatingSystem types.OperatingSystem + // A server SDK version you used when integrating your game server build with + // GameLift. For more information see Integrate games with custom game servers + // (https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-custom-intro.html). + ServerSdkVersion *string + // Information indicating where your game build files are stored. Use this // parameter only when creating a build with files stored in an Amazon S3 bucket // that you own. The storage location must specify an Amazon S3 bucket name and @@ -87,25 +90,29 @@ type CreateBuildInput struct { // of 0. StorageLocation *types.S3Location - // A list of labels to assign to the new build resource. Tags are developer-defined + // A list of labels to assign to the new build resource. Tags are developer defined // key-value pairs. Tagging Amazon Web Services resources are useful for resource // management, access management and cost allocation. For more information, see // Tagging Amazon Web Services Resources // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon // Web Services General Reference. Once the resource is created, you can use - // TagResource, UntagResource, and ListTagsForResource to add, remove, and view - // tags. The maximum tag limit may be lower than stated. See the Amazon Web - // Services General Reference for actual tagging limits. + // TagResource + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_TagResource.html), + // UntagResource + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_UntagResource.html), + // and ListTagsForResource + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListTagsForResource.html) + // to add, remove, and view tags. The maximum tag limit may be lower than stated. + // See the Amazon Web Services General Reference for actual tagging limits. Tags []types.Tag - // Version information that is associated with a build or script. Version strings - // do not need to be unique. You can use UpdateBuild to change this value later. + // Version information associated with a build or script. Version strings do not + // need to be unique. You can change this value later. Version *string noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type CreateBuildOutput struct { // The newly created build resource, including a unique build IDs and status. @@ -117,7 +124,8 @@ type CreateBuildOutput struct { // This element is returned only when the operation is called without a storage // location. It contains credentials to use when you are uploading a build file to // an Amazon S3 bucket that is owned by Amazon GameLift. Credentials have a limited - // life span. To refresh these credentials, call RequestUploadCredentials. + // life span. To refresh these credentials, call RequestUploadCredentials + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_RequestUploadCredentials.html). UploadCredentials *types.AwsCredentials // Metadata pertaining to the operation's result. diff --git a/service/gamelift/api_op_CreateFleet.go b/service/gamelift/api_op_CreateFleet.go index b4f8633c9e8..90681b3a5fa 100644 --- a/service/gamelift/api_op_CreateFleet.go +++ b/service/gamelift/api_op_CreateFleet.go @@ -36,23 +36,12 @@ import ( // new Fleet resource and places it in NEW status, which prompts GameLift to // initiate the fleet creation workflow // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creation-workflow.html). -// You can track fleet creation by checking fleet status using -// DescribeFleetAttributes and DescribeFleetLocationAttributes/, or by monitoring -// fleet creation events using DescribeFleetEvents. As soon as the fleet status -// changes to ACTIVE, you can enable automatic scaling for the fleet with -// PutScalingPolicy and set capacity for the home Region with UpdateFleetCapacity. -// When the status of each remote location reaches ACTIVE, you can set capacity by -// location using UpdateFleetCapacity. Learn more Setting up fleets +// Learn more Setting up fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html)Debug // fleet creation issues // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html#fleets-creating-debug-creation)Multi-location // fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleet | UpdateFleetCapacity | PutScalingPolicy | -// DescribeEC2InstanceLimits | DescribeFleetAttributes | -// DescribeFleetLocationAttributes | UpdateFleetAttributes | StopFleetActions | -// DeleteFleet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreateFleet(ctx context.Context, params *CreateFleetInput, optFns ...func(*Options)) (*CreateFleetOutput, error) { if params == nil { params = &CreateFleetInput{} @@ -68,41 +57,43 @@ func (c *Client) CreateFleet(ctx context.Context, params *CreateFleetInput, optF return out, nil } -// Represents the input for a request operation. type CreateFleetInput struct { - // The GameLift-supported Amazon EC2 instance type to use for all fleet instances. - // Instance type determines the computing resources that will be used to host your - // game servers, including CPU, memory, storage, and networking capacity. See - // Amazon Elastic Compute Cloud Instance Types - // (http://aws.amazon.com/ec2/instance-types/) for detailed descriptions of Amazon - // EC2 instance types. - // - // This member is required. - EC2InstanceType types.EC2InstanceType - // A descriptive label that is associated with a fleet. Fleet names do not need to // be unique. // // This member is required. Name *string + // GameLift Anywhere configuration options. + AnywhereConfiguration *types.AnywhereConfiguration + // The unique identifier for a custom game server build to be deployed on fleet // instances. You can use either the build ID or ARN. The build must be uploaded to // GameLift and in READY status. This fleet property cannot be changed later. BuildId *string - // Prompts GameLift to generate a TLS/SSL certificate for the fleet. TLS - // certificates are used for encrypting traffic between game clients and the game - // servers that are running on GameLift. By default, the CertificateConfiguration - // is set to DISABLED. This property cannot be changed after the fleet is created. - // Note: This feature requires the Amazon Web Services Certificate Manager (ACM) - // service, which is not available in all Amazon Web Services regions. When working - // in a region that does not support this feature, a fleet creation request with - // certificate generation fails with a 4xx error. + // Prompts GameLift to generate a TLS/SSL certificate for the fleet. GameLift uses + // the certificates to encrypt traffic between game clients and the game servers + // running on GameLift. By default, the CertificateConfiguration is DISABLED. You + // can't change this property after you create the fleet. Certificate Manager (ACM) + // certificates expire after 13 months. Certificate expiration can cause fleets to + // fail, preventing players from connecting to instances in the fleet. We recommend + // you replace fleets before 13 months, consider using fleet aliases for a smooth + // transition. ACM isn't available in all Amazon Web Services regions. A fleet + // creation request with certificate generation enabled in an unsupported Region, + // fails with a 4xx error. For more information about the supported Regions, see + // Supported Regions + // (https://docs.aws.amazon.com/acm/latest/userguide/acm-regions.html) in the + // Certificate Manager User Guide. CertificateConfiguration *types.CertificateConfiguration - // A human-readable description of the fleet. + // The type of compute resource used to host your game servers. You can use your + // own compute resources with GameLift Anywhere or use Amazon EC2 instances with + // managed GameLift. + ComputeType types.ComputeType + + // A description for the fleet. Description *string // The allowed IP address ranges and port settings that allow inbound traffic to @@ -111,6 +102,14 @@ type CreateFleetInput struct { // Realtime Servers fleets, GameLift automatically sets TCP and UDP ranges. EC2InboundPermissions []types.IpPermission + // The GameLift-supported Amazon EC2 instance type to use for all fleet instances. + // Instance type determines the computing resources that will be used to host your + // game servers, including CPU, memory, storage, and networking capacity. See + // Amazon Elastic Compute Cloud Instance Types + // (http://aws.amazon.com/ec2/instance-types/) for detailed descriptions of Amazon + // EC2 instance types. + EC2InstanceType types.EC2InstanceType + // Indicates whether to use On-Demand or Spot instances for this fleet. By default, // this property is set to ON_DEMAND. Learn more about when to use On-Demand // versus Spot Instances @@ -140,9 +139,10 @@ type CreateFleetInput struct { // This parameter is no longer used. To specify where GameLift should store log // files once a server process shuts down, use the GameLift server API - // ProcessReady() and specify one or more directory paths in logParameters. See - // more information in the Server API Reference - // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api-ref.html#gamelift-sdk-server-api-ref-dataypes-process). + // ProcessReady() and specify one or more directory paths in logParameters. For + // more information, see Initialize the server process + // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-initialize) + // in the GameLift Developer Guide. LogPaths []string // The name of an Amazon Web Services CloudWatch metric group to add this fleet to. @@ -210,16 +210,12 @@ type CreateFleetInput struct { // management, access management and cost allocation. For more information, see // Tagging Amazon Web Services Resources // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon - // Web Services General Reference. Once the fleet is created, you can use - // TagResource, UntagResource, and ListTagsForResource to add, remove, and view - // tags. The maximum tag limit may be lower than stated. See the Amazon Web - // Services General Reference for actual tagging limits. + // Web Services General Reference. Tags []types.Tag noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type CreateFleetOutput struct { // The properties for the new fleet, including the current status. All fleets are diff --git a/service/gamelift/api_op_CreateFleetLocations.go b/service/gamelift/api_op_CreateFleetLocations.go index 2f0c1fc09a9..12a908424e3 100644 --- a/service/gamelift/api_op_CreateFleetLocations.go +++ b/service/gamelift/api_op_CreateFleetLocations.go @@ -16,24 +16,17 @@ import ( // auto-scaling, and other configuration settings. This operation cannot be used // with fleets that don't support remote locations. Fleets can have multiple // locations only if they reside in Amazon Web Services Regions that support this -// feature (see CreateFleet for the complete list) and were created after the -// feature was released in March 2021. To add fleet locations, specify the fleet to -// be updated and provide a list of one or more locations. If successful, this -// operation returns the list of added locations with their status set to NEW. -// GameLift initiates the process of starting an instance in each added location. -// You can track the status of each new location by monitoring location creation -// events using DescribeFleetEvents. Alternatively, you can poll location status by -// calling DescribeFleetLocationAttributes. After a location status becomes ACTIVE, -// you can adjust the location's capacity as needed with UpdateFleetCapacity. Learn -// more Setting up fleets +// feature and were created after the feature was released in March 2021. To add +// fleet locations, specify the fleet to be updated and provide a list of one or +// more locations. If successful, this operation returns the list of added +// locations with their status set to NEW. GameLift initiates the process of +// starting an instance in each added location. You can track the status of each +// new location by monitoring location creation events using DescribeFleetEvents +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeFleetEvents.html). +// Learn more Setting up fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html)Multi-location // fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleetLocations | DescribeFleetLocationAttributes | -// DescribeFleetLocationCapacity | DescribeFleetLocationUtilization | -// DescribeFleetAttributes | DescribeFleetCapacity | DescribeFleetUtilization | -// UpdateFleetCapacity | StopFleetActions | DeleteFleetLocations | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreateFleetLocations(ctx context.Context, params *CreateFleetLocationsInput, optFns ...func(*Options)) (*CreateFleetLocationsOutput, error) { if params == nil { params = &CreateFleetLocationsInput{} @@ -49,7 +42,6 @@ func (c *Client) CreateFleetLocations(ctx context.Context, params *CreateFleetLo return out, nil } -// Represents the input for a request operation. type CreateFleetLocationsInput struct { // A unique identifier for the fleet to add locations to. You can use either the @@ -68,7 +60,6 @@ type CreateFleetLocationsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type CreateFleetLocationsOutput struct { // The Amazon Resource Name (ARN diff --git a/service/gamelift/api_op_CreateGameServerGroup.go b/service/gamelift/api_op_CreateGameServerGroup.go index 7f9a56c4ad6..5304f18efef 100644 --- a/service/gamelift/api_op_CreateGameServerGroup.go +++ b/service/gamelift/api_op_CreateGameServerGroup.go @@ -48,11 +48,6 @@ import ( // as part of its balancing activities to optimize for availability and cost. Learn // more GameLift FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions CreateGameServerGroup | ListGameServerGroups | -// DescribeGameServerGroup | UpdateGameServerGroup | DeleteGameServerGroup | -// ResumeGameServerGroup | SuspendGameServerGroup | DescribeGameServerInstances | -// All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) CreateGameServerGroup(ctx context.Context, params *CreateGameServerGroupInput, optFns ...func(*Options)) (*CreateGameServerGroupOutput, error) { if params == nil { params = &CreateGameServerGroupInput{} @@ -179,10 +174,7 @@ type CreateGameServerGroupInput struct { // useful for resource management, access management, and cost allocation. For more // information, see Tagging Amazon Web Services Resources // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon - // Web Services General Reference. Once the resource is created, you can use - // TagResource, UntagResource, and ListTagsForResource to add, remove, and view - // tags, respectively. The maximum tag limit may be lower than stated. See the - // Amazon Web Services General Reference for actual tagging limits. + // Web Services General Reference. Tags []types.Tag // A list of virtual private cloud (VPC) subnets to use with instances in the game diff --git a/service/gamelift/api_op_CreateGameSession.go b/service/gamelift/api_op_CreateGameSession.go index 51f42b7a08a..5a71b220dcc 100644 --- a/service/gamelift/api_op_CreateGameSession.go +++ b/service/gamelift/api_op_CreateGameSession.go @@ -14,36 +14,38 @@ import ( // Creates a multiplayer game session for players in a specific fleet location. // This operation prompts an available server process to start a game session and // retrieves connection information for the new game session. As an alternative, -// consider using the GameLift game session placement feature with with -// StartGameSessionPlacement, which uses FleetIQ algorithms and queues to optimize -// the placement process. When creating a game session, you specify exactly where -// you want to place it and provide a set of game session configuration settings. -// The fleet must be in ACTIVE status before a game session can be created in it. -// This operation can be used in the following ways: -// -// * To create a game session on -// an instance in a fleet's home Region, provide a fleet or alias ID along with -// your game session configuration. +// consider using the GameLift game session placement feature with +// StartGameSessionPlacement +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_StartGameSessionPlacement.html) +// , which uses FleetIQ algorithms and queues to optimize the placement process. +// When creating a game session, you specify exactly where you want to place it and +// provide a set of game session configuration settings. The fleet must be in +// ACTIVE status before a game session can be created in it. This operation can be +// used in the following ways: // // * To create a game session on an instance in a -// fleet's remote location, provide a fleet or alias ID and a location name, along -// with your game session configuration. +// fleet's home Region, provide a fleet or alias ID along with your game session +// configuration. +// +// * To create a game session on an instance in a fleet's remote +// location, provide a fleet or alias ID and a location name, along with your game +// session configuration. // -// If successful, a workflow is initiated to -// start a new game session. A GameSession object is returned containing the game -// session configuration and status. When the status is ACTIVE, game session -// connection information is provided and player sessions can be created for the -// game session. By default, newly created game sessions are open to new players. -// You can restrict new player access by using UpdateGameSession to change the game -// session's player session creation policy. Game session logs are retained for all -// active game sessions for 14 days. To access the logs, call GetGameSessionLogUrl +// If successful, a workflow is initiated to start a new +// game session. A GameSession object is returned containing the game session +// configuration and status. When the status is ACTIVE, game session connection +// information is provided and player sessions can be created for the game session. +// By default, newly created game sessions are open to new players. You can +// restrict new player access by using UpdateGameSession +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSession.html) +// to change the game session's player session creation policy. Game session logs +// are retained for all active game sessions for 14 days. To access the logs, call +// GetGameSessionLogUrl +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_GetGameSessionLogUrl.html) // to download the log files. Available in Amazon GameLift Local. Learn more Start // a game session -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession) -// Related actions CreateGameSession | DescribeGameSessions | -// DescribeGameSessionDetails | SearchGameSessions | UpdateGameSession | -// GetGameSessionLogUrl | StartGameSessionPlacement | DescribeGameSessionPlacement -// | StopGameSessionPlacement | All APIs by task +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)All +// APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreateGameSession(ctx context.Context, params *CreateGameSessionInput, optFns ...func(*Options)) (*CreateGameSessionOutput, error) { if params == nil { @@ -60,7 +62,6 @@ func (c *Client) CreateGameSession(ctx context.Context, params *CreateGameSessio return out, nil } -// Represents the input for a request operation. type CreateGameSessionInput struct { // The maximum number of players that can be connected simultaneously to the game @@ -88,21 +89,20 @@ type CreateGameSessionInput struct { FleetId *string // A set of custom properties for a game session, formatted as key:value pairs. - // These properties are passed to a game server process in the GameSession object - // with a request to start a new game session (see Start a Game Session + // These properties are passed to a game server process with a request to start a + // new game session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). GameProperties []types.GameProperty // A set of custom game session properties, formatted as a single string value. - // This data is passed to a game server process in the GameSession object with a - // request to start a new game session (see Start a Game Session + // This data is passed to a game server process with a request to start a new game + // session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). GameSessionData *string - // This parameter is no longer preferred. Please use IdempotencyToken instead. - // Custom string that uniquely identifies a request for a new game session. Maximum - // token length is 48 characters. If provided, this string is included in the new - // game session's ID. + // This parameter is deprecated. Use IdempotencyToken instead. Custom string that + // uniquely identifies a request for a new game session. Maximum token length is 48 + // characters. If provided, this string is included in the new game session's ID. GameSessionId *string // Custom string that uniquely identifies the new game session request. This is @@ -127,7 +127,6 @@ type CreateGameSessionInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type CreateGameSessionOutput struct { // Object that describes the newly created game session record. diff --git a/service/gamelift/api_op_CreateGameSessionQueue.go b/service/gamelift/api_op_CreateGameSessionQueue.go index d0ab9cc82a6..5409df0689f 100644 --- a/service/gamelift/api_op_CreateGameSessionQueue.go +++ b/service/gamelift/api_op_CreateGameSessionQueue.go @@ -65,7 +65,6 @@ func (c *Client) CreateGameSessionQueue(ctx context.Context, params *CreateGameS return out, nil } -// Represents the input for a request operation. type CreateGameSessionQueueInput struct { // A descriptive label that is associated with game session queue. Queue names must @@ -113,10 +112,7 @@ type CreateGameSessionQueueInput struct { // useful for resource management, access management and cost allocation. For more // information, see Tagging Amazon Web Services Resources // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon - // Web Services General Reference. Once the resource is created, you can use - // TagResource, UntagResource, and ListTagsForResource to add, remove, and view - // tags. The maximum tag limit may be lower than stated. See the Amazon Web - // Services General Reference for actual tagging limits. + // Web Services General Reference. Tags []types.Tag // The maximum time, in seconds, that a new game session placement request remains @@ -127,7 +123,6 @@ type CreateGameSessionQueueInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type CreateGameSessionQueueOutput struct { // An object that describes the newly created game session queue. diff --git a/service/gamelift/api_op_CreateLocation.go b/service/gamelift/api_op_CreateLocation.go new file mode 100644 index 00000000000..5bb1cb34da8 --- /dev/null +++ b/service/gamelift/api_op_CreateLocation.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package gamelift + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/gamelift/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a custom location for use in an Anywhere fleet. +func (c *Client) CreateLocation(ctx context.Context, params *CreateLocationInput, optFns ...func(*Options)) (*CreateLocationOutput, error) { + if params == nil { + params = &CreateLocationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateLocation", params, optFns, c.addOperationCreateLocationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateLocationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateLocationInput struct { + + // A descriptive name for the custom location. + // + // This member is required. + LocationName *string + + // A list of labels to assign to the new matchmaking configuration resource. Tags + // are developer-defined key-value pairs. Tagging Amazon Web Services resources are + // useful for resource management, access management and cost allocation. For more + // information, see Tagging Amazon Web Services Resources + // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon + // Web Services General Rareference. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateLocationOutput struct { + + // The details of the custom location you created. + Location *types.LocationModel + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateLocationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateLocation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateLocation{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateLocationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLocation(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateLocation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "gamelift", + OperationName: "CreateLocation", + } +} diff --git a/service/gamelift/api_op_CreateMatchmakingConfiguration.go b/service/gamelift/api_op_CreateMatchmakingConfiguration.go index d9939e020aa..5872f8e367c 100644 --- a/service/gamelift/api_op_CreateMatchmakingConfiguration.go +++ b/service/gamelift/api_op_CreateMatchmakingConfiguration.go @@ -16,29 +16,20 @@ import ( // the matchmaking configuration sets out rules for matching players and forming // teams. If you're also using GameLift hosting, it defines how to start game // sessions for each match. Your matchmaking system can use multiple configurations -// to handle different game scenarios. All matchmaking requests (StartMatchmaking -// or StartMatchBackfill) identify the matchmaking configuration to use and provide -// player attributes consistent with that configuration. To create a matchmaking -// configuration, you must provide the following: configuration name and FlexMatch -// mode (with or without GameLift hosting); a rule set that specifies how to -// evaluate players and find acceptable matches; whether player acceptance is -// required; and the maximum time allowed for a matchmaking attempt. When using -// FlexMatch with GameLift hosting, you also need to identify the game session -// queue to use when starting a game session for the match. In addition, you must -// set up an Amazon Simple Notification Service topic to receive matchmaking -// notifications. Provide the topic ARN in the matchmaking configuration. An -// alternative method, continuously polling ticket status with DescribeMatchmaking, -// is only suitable for games in development with low matchmaking usage. Learn more -// Design a FlexMatch matchmaker +// to handle different game scenarios. All matchmaking requests identify the +// matchmaking configuration to use and provide player attributes consistent with +// that configuration. To create a matchmaking configuration, you must provide the +// following: configuration name and FlexMatch mode (with or without GameLift +// hosting); a rule set that specifies how to evaluate players and find acceptable +// matches; whether player acceptance is required; and the maximum time allowed for +// a matchmaking attempt. When using FlexMatch with GameLift hosting, you also need +// to identify the game session queue to use when starting a game session for the +// match. In addition, you must set up an Amazon Simple Notification Service topic +// to receive matchmaking notifications. Provide the topic ARN in the matchmaking +// configuration. Learn more Design a FlexMatch matchmaker // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-configuration.html) // Set up FlexMatch event notification // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-notification.html) -// Related actions CreateMatchmakingConfiguration | -// DescribeMatchmakingConfigurations | UpdateMatchmakingConfiguration | -// DeleteMatchmakingConfiguration | CreateMatchmakingRuleSet | -// DescribeMatchmakingRuleSets | ValidateMatchmakingRuleSet | -// DeleteMatchmakingRuleSet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreateMatchmakingConfiguration(ctx context.Context, params *CreateMatchmakingConfigurationInput, optFns ...func(*Options)) (*CreateMatchmakingConfigurationOutput, error) { if params == nil { params = &CreateMatchmakingConfigurationInput{} @@ -54,7 +45,6 @@ func (c *Client) CreateMatchmakingConfiguration(ctx context.Context, params *Cre return out, nil } -// Represents the input for a request operation. type CreateMatchmakingConfigurationInput struct { // A flag that determines whether a match that was created with this configuration @@ -99,9 +89,9 @@ type CreateMatchmakingConfigurationInput struct { // The method used to backfill game sessions that are created with this matchmaking // configuration. Specify MANUAL when your game manages backfill requests manually // or does not use the match backfill feature. Specify AUTOMATIC to have GameLift - // create a StartMatchBackfill request whenever a game session has one or more open - // slots. Learn more about manual and automatic backfill in Backfill Existing - // Games with FlexMatch + // create a backfill request whenever a game session has one or more open slots. + // Learn more about manual and automatic backfill in Backfill Existing Games with + // FlexMatch // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-backfill.html). // Automatic backfill is not available when FlexMatchMode is set to STANDALONE. BackfillMode types.BackfillMode @@ -126,8 +116,8 @@ type CreateMatchmakingConfigurationInput struct { FlexMatchMode types.FlexMatchMode // A set of custom properties for a game session, formatted as key:value pairs. - // These properties are passed to a game server process in the GameSession object - // with a request to start a new game session (see Start a Game Session + // These properties are passed to a game server process with a request to start a + // new game session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). // This information is added to the new GameSession object that is created for a // successful match. This parameter is not used if FlexMatchMode is set to @@ -135,8 +125,8 @@ type CreateMatchmakingConfigurationInput struct { GameProperties []types.GameProperty // A set of custom game session properties, formatted as a single string value. - // This data is passed to a game server process in the GameSession object with a - // request to start a new game session (see Start a Game Session + // This data is passed to a game server process with a request to start a new game + // session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). // This information is added to the new GameSession object that is created for a // successful match. This parameter is not used if FlexMatchMode is set to @@ -164,16 +154,12 @@ type CreateMatchmakingConfigurationInput struct { // useful for resource management, access management and cost allocation. For more // information, see Tagging Amazon Web Services Resources // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon - // Web Services General Reference. Once the resource is created, you can use - // TagResource, UntagResource, and ListTagsForResource to add, remove, and view - // tags. The maximum tag limit may be lower than stated. See the Amazon Web - // Services General Reference for actual tagging limits. + // Web Services General Reference. Tags []types.Tag noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type CreateMatchmakingConfigurationOutput struct { // Object that describes the newly created matchmaking configuration. diff --git a/service/gamelift/api_op_CreateMatchmakingRuleSet.go b/service/gamelift/api_op_CreateMatchmakingRuleSet.go index 899dc3c01bf..19bb05a1771 100644 --- a/service/gamelift/api_op_CreateMatchmakingRuleSet.go +++ b/service/gamelift/api_op_CreateMatchmakingRuleSet.go @@ -14,11 +14,12 @@ import ( // Creates a new rule set for FlexMatch matchmaking. A rule set describes the type // of match to create, such as the number and size of teams. It also sets the // parameters for acceptable player matches, such as minimum skill level or -// character type. A rule set is used by a MatchmakingConfiguration. To create a -// matchmaking rule set, provide unique rule set name and the rule set body in JSON -// format. Rule sets must be defined in the same Region as the matchmaking -// configuration they are used with. Since matchmaking rule sets cannot be edited, -// it is a good idea to check the rule set syntax using ValidateMatchmakingRuleSet +// character type. To create a matchmaking rule set, provide unique rule set name +// and the rule set body in JSON format. Rule sets must be defined in the same +// Region as the matchmaking configuration they are used with. Since matchmaking +// rule sets cannot be edited, it is a good idea to check the rule set syntax using +// ValidateMatchmakingRuleSet +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_ValidateMatchmakingRuleSet.html) // before creating a new rule set. Learn more // // * Build a rule set @@ -31,13 +32,6 @@ import ( // * // Matchmaking with FlexMatch // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-intro.html) -// -// Related -// actions CreateMatchmakingConfiguration | DescribeMatchmakingConfigurations | -// UpdateMatchmakingConfiguration | DeleteMatchmakingConfiguration | -// CreateMatchmakingRuleSet | DescribeMatchmakingRuleSets | -// ValidateMatchmakingRuleSet | DeleteMatchmakingRuleSet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreateMatchmakingRuleSet(ctx context.Context, params *CreateMatchmakingRuleSetInput, optFns ...func(*Options)) (*CreateMatchmakingRuleSetOutput, error) { if params == nil { params = &CreateMatchmakingRuleSetInput{} @@ -53,7 +47,6 @@ func (c *Client) CreateMatchmakingRuleSet(ctx context.Context, params *CreateMat return out, nil } -// Represents the input for a request operation. type CreateMatchmakingRuleSetInput struct { // A unique identifier for the matchmaking rule set. A matchmaking configuration @@ -74,16 +67,12 @@ type CreateMatchmakingRuleSetInput struct { // useful for resource management, access management and cost allocation. For more // information, see Tagging Amazon Web Services Resources // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon - // Web Services General Reference. Once the resource is created, you can use - // TagResource, UntagResource, and ListTagsForResource to add, remove, and view - // tags. The maximum tag limit may be lower than stated. See the Amazon Web - // Services General Reference for actual tagging limits. + // Web Services General Reference. Tags []types.Tag noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type CreateMatchmakingRuleSetOutput struct { // The newly created matchmaking rule set. diff --git a/service/gamelift/api_op_CreatePlayerSession.go b/service/gamelift/api_op_CreatePlayerSession.go index 0cf63b9352c..9415dbf82e3 100644 --- a/service/gamelift/api_op_CreatePlayerSession.go +++ b/service/gamelift/api_op_CreatePlayerSession.go @@ -14,17 +14,16 @@ import ( // Reserves an open player slot in a game session for a player. New player sessions // can be created in any game session with an open slot that is in ACTIVE status // and has a player creation policy of ACCEPT_ALL. You can add a group of players -// to a game session with CreatePlayerSessions. To create a player session, specify -// a game session ID, player ID, and optionally a set of player data. If -// successful, a slot is reserved in the game session for the player and a new -// PlayerSession object is returned with a player session ID. The player references -// the player session ID when sending a connection request to the game session, and -// the game server can use it to validate the player reservation with the GameLift -// service. Player sessions cannot be updated. The maximum number of players per -// game session is 200. It is not adjustable. Available in Amazon GameLift Local. -// Related actions CreatePlayerSession | CreatePlayerSessions | -// DescribePlayerSessions | StartGameSessionPlacement | -// DescribeGameSessionPlacement | All APIs by task +// to a game session with CreatePlayerSessions +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreatePlayerSessions.html) +// . To create a player session, specify a game session ID, player ID, and +// optionally a set of player data. If successful, a slot is reserved in the game +// session for the player and a new PlayerSessions object is returned with a player +// session ID. The player references the player session ID when sending a +// connection request to the game session, and the game server can use it to +// validate the player reservation with the GameLift service. Player sessions +// cannot be updated. The maximum number of players per game session is 200. It is +// not adjustable. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreatePlayerSession(ctx context.Context, params *CreatePlayerSessionInput, optFns ...func(*Options)) (*CreatePlayerSessionOutput, error) { if params == nil { @@ -41,7 +40,6 @@ func (c *Client) CreatePlayerSession(ctx context.Context, params *CreatePlayerSe return out, nil } -// Represents the input for a request operation. type CreatePlayerSessionInput struct { // A unique identifier for the game session to add a player to. @@ -61,7 +59,6 @@ type CreatePlayerSessionInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type CreatePlayerSessionOutput struct { // Object that describes the newly created player session record. diff --git a/service/gamelift/api_op_CreatePlayerSessions.go b/service/gamelift/api_op_CreatePlayerSessions.go index 4d9fd1d8d26..fd0a87bb6a9 100644 --- a/service/gamelift/api_op_CreatePlayerSessions.go +++ b/service/gamelift/api_op_CreatePlayerSessions.go @@ -14,17 +14,16 @@ import ( // Reserves open slots in a game session for a group of players. New player // sessions can be created in any game session with an open slot that is in ACTIVE // status and has a player creation policy of ACCEPT_ALL. To add a single player to -// a game session, use CreatePlayerSession. To create player sessions, specify a -// game session ID and a list of player IDs. Optionally, provide a set of player -// data for each player ID. If successful, a slot is reserved in the game session -// for each player, and new PlayerSession objects are returned with player session -// IDs. Each player references their player session ID when sending a connection -// request to the game session, and the game server can use it to validate the -// player reservation with the GameLift service. Player sessions cannot be updated. -// The maximum number of players per game session is 200. It is not adjustable. -// Available in Amazon GameLift Local. Related actions CreatePlayerSession | -// CreatePlayerSessions | DescribePlayerSessions | StartGameSessionPlacement | -// DescribeGameSessionPlacement | All APIs by task +// a game session, use CreatePlayerSession +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreatePlayerSession.html) +// To create player sessions, specify a game session ID and a list of player IDs. +// Optionally, provide a set of player data for each player ID. If successful, a +// slot is reserved in the game session for each player, and new PlayerSession +// objects are returned with player session IDs. Each player references their +// player session ID when sending a connection request to the game session, and the +// game server can use it to validate the player reservation with the GameLift +// service. Player sessions cannot be updated. The maximum number of players per +// game session is 200. It is not adjustable. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreatePlayerSessions(ctx context.Context, params *CreatePlayerSessionsInput, optFns ...func(*Options)) (*CreatePlayerSessionsOutput, error) { if params == nil { @@ -41,7 +40,6 @@ func (c *Client) CreatePlayerSessions(ctx context.Context, params *CreatePlayerS return out, nil } -// Represents the input for a request operation. type CreatePlayerSessionsInput struct { // A unique identifier for the game session to add players to. @@ -63,7 +61,6 @@ type CreatePlayerSessionsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type CreatePlayerSessionsOutput struct { // A collection of player session objects created for the added players. diff --git a/service/gamelift/api_op_CreateScript.go b/service/gamelift/api_op_CreateScript.go index a976719e5b9..67c8240ecbf 100644 --- a/service/gamelift/api_op_CreateScript.go +++ b/service/gamelift/api_op_CreateScript.go @@ -37,8 +37,7 @@ import ( // (https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-intro.html)Set // Up a Role for Amazon GameLift Access // (https://docs.aws.amazon.com/gamelift/latest/developerguide/setting-up-role.html) -// Related actions CreateScript | ListScripts | DescribeScript | UpdateScript | -// DeleteScript | All APIs by task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreateScript(ctx context.Context, params *CreateScriptInput, optFns ...func(*Options)) (*CreateScriptOutput, error) { if params == nil { @@ -58,7 +57,9 @@ func (c *Client) CreateScript(ctx context.Context, params *CreateScriptInput, op type CreateScriptInput struct { // A descriptive label that is associated with a script. Script names do not need - // to be unique. You can use UpdateScript to change this value later. + // to be unique. You can use UpdateScript + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateScript.html) + // to change this value later. Name *string // The location of the Amazon S3 bucket where a zipped file containing your @@ -77,13 +78,20 @@ type CreateScriptInput struct { // information, see Tagging Amazon Web Services Resources // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon // Web Services General Reference. Once the resource is created, you can use - // TagResource, UntagResource, and ListTagsForResource to add, remove, and view - // tags. The maximum tag limit may be lower than stated. See the Amazon Web - // Services General Reference for actual tagging limits. + // TagResource + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_TagResource.html), + // UntagResource + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_UntagResource.html), + // and ListTagsForResource + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListTagsForResource.html) + // to add, remove, and view tags. The maximum tag limit may be lower than stated. + // See the Amazon Web Services General Reference for actual tagging limits. Tags []types.Tag - // Version information that is associated with a build or script. Version strings - // do not need to be unique. You can use UpdateScript to change this value later. + // Version information associated with a build or script. Version strings do not + // need to be unique. You can use UpdateScript + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateScript.html) + // to change this value later. Version *string // A data object containing your Realtime scripts and dependencies as a zip file. diff --git a/service/gamelift/api_op_CreateVpcPeeringAuthorization.go b/service/gamelift/api_op_CreateVpcPeeringAuthorization.go index a272cb3eb5f..286efea20eb 100644 --- a/service/gamelift/api_op_CreateVpcPeeringAuthorization.go +++ b/service/gamelift/api_op_CreateVpcPeeringAuthorization.go @@ -14,9 +14,11 @@ import ( // Requests authorization to create or delete a peer connection between the VPC for // your Amazon GameLift fleet and a virtual private cloud (VPC) in your Amazon Web // Services account. VPC peering enables the game servers on your fleet to -// communicate directly with other Amazon Web Services resources. Once you've -// received authorization, call CreateVpcPeeringConnection to establish the peering -// connection. For more information, see VPC Peering with Amazon GameLift Fleets +// communicate directly with other Amazon Web Services resources. After you've +// received authorization, use CreateVpcPeeringConnection +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateVpcPeeringConnection.html) +// to establish the peering connection. For more information, see VPC Peering with +// Amazon GameLift Fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html). // You can peer with VPCs that are owned by any Amazon Web Services account you // have access to, including the account that you use to manage your Amazon @@ -33,11 +35,8 @@ import ( // GameLift fleet. Identify the following values: (1) VPC ID that you want to // delete the peering connection for, and (2) ID of the Amazon Web Services account // that you use to manage Amazon GameLift. The authorization remains valid for 24 -// hours unless it is canceled by a call to DeleteVpcPeeringAuthorization. You must -// create or delete the peering connection while the authorization is valid. -// Related actions CreateVpcPeeringAuthorization | DescribeVpcPeeringAuthorizations -// | DeleteVpcPeeringAuthorization | CreateVpcPeeringConnection | -// DescribeVpcPeeringConnections | DeleteVpcPeeringConnection | All APIs by task +// hours unless it is canceled. You must create or delete the peering connection +// while the authorization is valid. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreateVpcPeeringAuthorization(ctx context.Context, params *CreateVpcPeeringAuthorizationInput, optFns ...func(*Options)) (*CreateVpcPeeringAuthorizationOutput, error) { if params == nil { @@ -54,7 +53,6 @@ func (c *Client) CreateVpcPeeringAuthorization(ctx context.Context, params *Crea return out, nil } -// Represents the input for a request operation. type CreateVpcPeeringAuthorizationInput struct { // A unique identifier for the Amazon Web Services account that you use to manage @@ -77,7 +75,6 @@ type CreateVpcPeeringAuthorizationInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type CreateVpcPeeringAuthorizationOutput struct { // Details on the requested VPC peering authorization, including expiration. diff --git a/service/gamelift/api_op_CreateVpcPeeringConnection.go b/service/gamelift/api_op_CreateVpcPeeringConnection.go index 33858d0f8da..d914855052e 100644 --- a/service/gamelift/api_op_CreateVpcPeeringConnection.go +++ b/service/gamelift/api_op_CreateVpcPeeringConnection.go @@ -20,22 +20,23 @@ import ( // Fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html). // Before calling this operation to establish the peering connection, you first -// need to call CreateVpcPeeringAuthorization and identify the VPC you want to peer -// with. Once the authorization for the specified VPC is issued, you have 24 hours -// to establish the connection. These two operations handle all tasks necessary to -// peer the two VPCs, including acceptance, updating routing tables, etc. To -// establish the connection, call this operation from the Amazon Web Services -// account that is used to manage the Amazon GameLift fleets. Identify the -// following values: (1) The ID of the fleet you want to be enable a VPC peering -// connection for; (2) The Amazon Web Services account with the VPC that you want -// to peer with; and (3) The ID of the VPC you want to peer with. This operation is -// asynchronous. If successful, a VpcPeeringConnection request is created. You can -// use continuous polling to track the request's status using -// DescribeVpcPeeringConnections, or by monitoring fleet events for success or -// failure using DescribeFleetEvents. Related actions CreateVpcPeeringAuthorization -// | DescribeVpcPeeringAuthorizations | DeleteVpcPeeringAuthorization | -// CreateVpcPeeringConnection | DescribeVpcPeeringConnections | -// DeleteVpcPeeringConnection | All APIs by task +// need to use CreateVpcPeeringAuthorization +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateVpcPeeringAuthorization.html) +// and identify the VPC you want to peer with. Once the authorization for the +// specified VPC is issued, you have 24 hours to establish the connection. These +// two operations handle all tasks necessary to peer the two VPCs, including +// acceptance, updating routing tables, etc. To establish the connection, call this +// operation from the Amazon Web Services account that is used to manage the Amazon +// GameLift fleets. Identify the following values: (1) The ID of the fleet you want +// to be enable a VPC peering connection for; (2) The Amazon Web Services account +// with the VPC that you want to peer with; and (3) The ID of the VPC you want to +// peer with. This operation is asynchronous. If successful, a connection request +// is created. You can use continuous polling to track the request's status using +// DescribeVpcPeeringConnections +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeVpcPeeringConnections.html) +// , or by monitoring fleet events for success or failure using DescribeFleetEvents +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeFleetEvents.html) +// . Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) CreateVpcPeeringConnection(ctx context.Context, params *CreateVpcPeeringConnectionInput, optFns ...func(*Options)) (*CreateVpcPeeringConnectionOutput, error) { if params == nil { @@ -52,7 +53,6 @@ func (c *Client) CreateVpcPeeringConnection(ctx context.Context, params *CreateV return out, nil } -// Represents the input for a request operation. type CreateVpcPeeringConnectionInput struct { // A unique identifier for the fleet. You can use either the fleet ID or ARN value. diff --git a/service/gamelift/api_op_DeleteAlias.go b/service/gamelift/api_op_DeleteAlias.go index 1c2d2fd4b02..ff2230f163d 100644 --- a/service/gamelift/api_op_DeleteAlias.go +++ b/service/gamelift/api_op_DeleteAlias.go @@ -12,9 +12,8 @@ import ( // Deletes an alias. This operation removes all record of the alias. Game clients // attempting to access a server process using the deleted alias receive an error. -// To delete an alias, specify the alias ID to be deleted. Related actions -// CreateAlias | ListAliases | DescribeAlias | UpdateAlias | DeleteAlias | -// ResolveAlias | All APIs by task +// To delete an alias, specify the alias ID to be deleted. Related actions All APIs +// by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DeleteAlias(ctx context.Context, params *DeleteAliasInput, optFns ...func(*Options)) (*DeleteAliasOutput, error) { if params == nil { @@ -31,7 +30,6 @@ func (c *Client) DeleteAlias(ctx context.Context, params *DeleteAliasInput, optF return out, nil } -// Represents the input for a request operation. type DeleteAliasInput struct { // A unique identifier of the alias that you want to delete. You can use either the diff --git a/service/gamelift/api_op_DeleteBuild.go b/service/gamelift/api_op_DeleteBuild.go index b7ecaec2f3e..b045604d9b8 100644 --- a/service/gamelift/api_op_DeleteBuild.go +++ b/service/gamelift/api_op_DeleteBuild.go @@ -15,9 +15,8 @@ import ( // fleets using the build, but you can no longer create new fleets with the deleted // build. To delete a build, specify the build ID. Learn more Upload a Custom // Server Build -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html) -// Related actions CreateBuild | ListBuilds | DescribeBuild | UpdateBuild | -// DeleteBuild | All APIs by task +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html)All +// APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DeleteBuild(ctx context.Context, params *DeleteBuildInput, optFns ...func(*Options)) (*DeleteBuildOutput, error) { if params == nil { @@ -34,7 +33,6 @@ func (c *Client) DeleteBuild(ctx context.Context, params *DeleteBuildInput, optF return out, nil } -// Represents the input for a request operation. type DeleteBuildInput struct { // A unique identifier for the build to delete. You can use either the build ID or diff --git a/service/gamelift/api_op_DeleteFleet.go b/service/gamelift/api_op_DeleteFleet.go index 7a90fa14bc0..a3e5fce50dd 100644 --- a/service/gamelift/api_op_DeleteFleet.go +++ b/service/gamelift/api_op_DeleteFleet.go @@ -14,18 +14,14 @@ import ( // instances, including those in remote locations, are shut down. You don't need to // call DeleteFleetLocations separately. If the fleet being deleted has a VPC // peering connection, you first need to get a valid authorization (good for 24 -// hours) by calling CreateVpcPeeringAuthorization. You do not need to explicitly -// delete the VPC peering connection--this is done as part of the delete fleet -// process. To delete a fleet, specify the fleet ID to be terminated. During the -// deletion process the fleet status is changed to DELETING. When completed, the -// status switches to TERMINATED and the fleet event FLEET_DELETED is sent. Learn -// more Setting up GameLift Fleets +// hours) by calling CreateVpcPeeringAuthorization +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateVpcPeeringAuthorization.html). +// You do not need to explicitly delete the VPC peering connection. To delete a +// fleet, specify the fleet ID to be terminated. During the deletion process the +// fleet status is changed to DELETING. When completed, the status switches to +// TERMINATED and the fleet event FLEET_DELETED is sent. Learn more Setting up +// GameLift Fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleetLocations | UpdateFleetAttributes | -// UpdateFleetCapacity | UpdateFleetPortSettings | UpdateRuntimeConfiguration | -// StopFleetActions | StartFleetActions | PutScalingPolicy | DeleteFleet | -// DeleteFleetLocations | DeleteScalingPolicy | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DeleteFleet(ctx context.Context, params *DeleteFleetInput, optFns ...func(*Options)) (*DeleteFleetOutput, error) { if params == nil { params = &DeleteFleetInput{} @@ -41,7 +37,6 @@ func (c *Client) DeleteFleet(ctx context.Context, params *DeleteFleetInput, optF return out, nil } -// Represents the input for a request operation. type DeleteFleetInput struct { // A unique identifier for the fleet to be deleted. You can use either the fleet ID diff --git a/service/gamelift/api_op_DeleteFleetLocations.go b/service/gamelift/api_op_DeleteFleetLocations.go index 2528ffc4225..22071d130da 100644 --- a/service/gamelift/api_op_DeleteFleetLocations.go +++ b/service/gamelift/api_op_DeleteFleetLocations.go @@ -19,11 +19,6 @@ import ( // instances in each location being deleted. When completed, the location status // changes to TERMINATED. Learn more Setting up GameLift fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleetLocations | DescribeFleetLocationAttributes | -// DescribeFleetLocationCapacity | DescribeFleetLocationUtilization | -// DescribeFleetAttributes | DescribeFleetCapacity | DescribeFleetUtilization | -// UpdateFleetCapacity | StopFleetActions | DeleteFleetLocations | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DeleteFleetLocations(ctx context.Context, params *DeleteFleetLocationsInput, optFns ...func(*Options)) (*DeleteFleetLocationsOutput, error) { if params == nil { params = &DeleteFleetLocationsInput{} @@ -39,7 +34,6 @@ func (c *Client) DeleteFleetLocations(ctx context.Context, params *DeleteFleetLo return out, nil } -// Represents the input for a request operation. type DeleteFleetLocationsInput struct { // A unique identifier for the fleet to delete locations for. You can use either @@ -57,7 +51,6 @@ type DeleteFleetLocationsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DeleteFleetLocationsOutput struct { // The Amazon Resource Name (ARN diff --git a/service/gamelift/api_op_DeleteGameServerGroup.go b/service/gamelift/api_op_DeleteGameServerGroup.go index da7c7205578..457566f7263 100644 --- a/service/gamelift/api_op_DeleteGameServerGroup.go +++ b/service/gamelift/api_op_DeleteGameServerGroup.go @@ -36,11 +36,6 @@ import ( // group is placed in ERROR status. GameLift FleetIQ emits delete events to Amazon // CloudWatch. Learn more GameLift FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions CreateGameServerGroup | ListGameServerGroups | -// DescribeGameServerGroup | UpdateGameServerGroup | DeleteGameServerGroup | -// ResumeGameServerGroup | SuspendGameServerGroup | DescribeGameServerInstances | -// All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) DeleteGameServerGroup(ctx context.Context, params *DeleteGameServerGroupInput, optFns ...func(*Options)) (*DeleteGameServerGroupOutput, error) { if params == nil { params = &DeleteGameServerGroupInput{} @@ -58,8 +53,7 @@ func (c *Client) DeleteGameServerGroup(ctx context.Context, params *DeleteGameSe type DeleteGameServerGroupInput struct { - // A unique identifier for the game server group. Use either the GameServerGroup - // name or ARN value. + // A unique identifier for the game server group. Use either the name or ARN value. // // This member is required. GameServerGroupName *string diff --git a/service/gamelift/api_op_DeleteGameSessionQueue.go b/service/gamelift/api_op_DeleteGameSessionQueue.go index d6ecbb6b589..42d0751b747 100644 --- a/service/gamelift/api_op_DeleteGameSessionQueue.go +++ b/service/gamelift/api_op_DeleteGameSessionQueue.go @@ -14,18 +14,7 @@ import ( // StartGameSessionPlacement // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_StartGameSessionPlacement.html) // requests that reference the queue will fail. To delete a queue, specify the -// queue name. Learn more Using Multi-Region Queues -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-intro.html) -// Related actions CreateGameSessionQueue -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateGameSessionQueue.html) -// | DescribeGameSessionQueues -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessionQueues.html) -// | UpdateGameSessionQueue -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSessionQueue.html) -// | DeleteGameSessionQueue -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DeleteGameSessionQueue.html) -// | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// queue name. func (c *Client) DeleteGameSessionQueue(ctx context.Context, params *DeleteGameSessionQueueInput, optFns ...func(*Options)) (*DeleteGameSessionQueueOutput, error) { if params == nil { params = &DeleteGameSessionQueueInput{} @@ -41,7 +30,6 @@ func (c *Client) DeleteGameSessionQueue(ctx context.Context, params *DeleteGameS return out, nil } -// Represents the input for a request operation. type DeleteGameSessionQueueInput struct { // A descriptive label that is associated with game session queue. Queue names must diff --git a/service/gamelift/api_op_DeleteLocation.go b/service/gamelift/api_op_DeleteLocation.go new file mode 100644 index 00000000000..44880957aaf --- /dev/null +++ b/service/gamelift/api_op_DeleteLocation.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package gamelift + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a custom location. Before deleting a custom location, review any fleets +// currently using the custom location and deregister the location if it is in use. +// For more information see, DeregisterCompute +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DeregisterCompute.html). +func (c *Client) DeleteLocation(ctx context.Context, params *DeleteLocationInput, optFns ...func(*Options)) (*DeleteLocationOutput, error) { + if params == nil { + params = &DeleteLocationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteLocation", params, optFns, c.addOperationDeleteLocationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteLocationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteLocationInput struct { + + // The location name of the custom location to be deleted. + // + // This member is required. + LocationName *string + + noSmithyDocumentSerde +} + +type DeleteLocationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteLocationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteLocation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteLocation{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteLocationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLocation(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteLocation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "gamelift", + OperationName: "DeleteLocation", + } +} diff --git a/service/gamelift/api_op_DeleteMatchmakingConfiguration.go b/service/gamelift/api_op_DeleteMatchmakingConfiguration.go index b34c4530f05..c9a33bf8f3c 100644 --- a/service/gamelift/api_op_DeleteMatchmakingConfiguration.go +++ b/service/gamelift/api_op_DeleteMatchmakingConfiguration.go @@ -12,12 +12,7 @@ import ( // Permanently removes a FlexMatch matchmaking configuration. To delete, specify // the configuration name. A matchmaking configuration cannot be deleted if it is -// being used in any active matchmaking tickets. Related actions -// CreateMatchmakingConfiguration | DescribeMatchmakingConfigurations | -// UpdateMatchmakingConfiguration | DeleteMatchmakingConfiguration | -// CreateMatchmakingRuleSet | DescribeMatchmakingRuleSets | -// ValidateMatchmakingRuleSet | DeleteMatchmakingRuleSet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// being used in any active matchmaking tickets. func (c *Client) DeleteMatchmakingConfiguration(ctx context.Context, params *DeleteMatchmakingConfigurationInput, optFns ...func(*Options)) (*DeleteMatchmakingConfigurationOutput, error) { if params == nil { params = &DeleteMatchmakingConfigurationInput{} @@ -33,7 +28,6 @@ func (c *Client) DeleteMatchmakingConfiguration(ctx context.Context, params *Del return out, nil } -// Represents the input for a request operation. type DeleteMatchmakingConfigurationInput struct { // A unique identifier for the matchmaking configuration. You can use either the diff --git a/service/gamelift/api_op_DeleteMatchmakingRuleSet.go b/service/gamelift/api_op_DeleteMatchmakingRuleSet.go index 43371ff0440..7fc5c37a640 100644 --- a/service/gamelift/api_op_DeleteMatchmakingRuleSet.go +++ b/service/gamelift/api_op_DeleteMatchmakingRuleSet.go @@ -16,13 +16,6 @@ import ( // // * Build a rule set // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html) -// -// Related -// actions CreateMatchmakingConfiguration | DescribeMatchmakingConfigurations | -// UpdateMatchmakingConfiguration | DeleteMatchmakingConfiguration | -// CreateMatchmakingRuleSet | DescribeMatchmakingRuleSets | -// ValidateMatchmakingRuleSet | DeleteMatchmakingRuleSet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DeleteMatchmakingRuleSet(ctx context.Context, params *DeleteMatchmakingRuleSetInput, optFns ...func(*Options)) (*DeleteMatchmakingRuleSetOutput, error) { if params == nil { params = &DeleteMatchmakingRuleSetInput{} @@ -38,7 +31,6 @@ func (c *Client) DeleteMatchmakingRuleSet(ctx context.Context, params *DeleteMat return out, nil } -// Represents the input for a request operation. type DeleteMatchmakingRuleSetInput struct { // A unique identifier for the matchmaking rule set to be deleted. (Note: The rule @@ -51,7 +43,6 @@ type DeleteMatchmakingRuleSetInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DeleteMatchmakingRuleSetOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/gamelift/api_op_DeleteScalingPolicy.go b/service/gamelift/api_op_DeleteScalingPolicy.go index e822711a5f2..9079c4f0e62 100644 --- a/service/gamelift/api_op_DeleteScalingPolicy.go +++ b/service/gamelift/api_op_DeleteScalingPolicy.go @@ -13,12 +13,9 @@ import ( // Deletes a fleet scaling policy. Once deleted, the policy is no longer in force // and GameLift removes all record of it. To delete a scaling policy, specify both // the scaling policy name and the fleet ID it is associated with. To temporarily -// suspend scaling policies, call StopFleetActions. This operation suspends all -// policies for the fleet. Related actions DescribeFleetCapacity | -// UpdateFleetCapacity | DescribeEC2InstanceLimits | PutScalingPolicy | -// DescribeScalingPolicies | DeleteScalingPolicy | StopFleetActions | -// StartFleetActions | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// suspend scaling policies, use StopFleetActions +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_StopFleetActions.html). +// This operation suspends all policies for the fleet. func (c *Client) DeleteScalingPolicy(ctx context.Context, params *DeleteScalingPolicyInput, optFns ...func(*Options)) (*DeleteScalingPolicyOutput, error) { if params == nil { params = &DeleteScalingPolicyInput{} @@ -34,7 +31,6 @@ func (c *Client) DeleteScalingPolicy(ctx context.Context, params *DeleteScalingP return out, nil } -// Represents the input for a request operation. type DeleteScalingPolicyInput struct { // A unique identifier for the fleet to be deleted. You can use either the fleet ID diff --git a/service/gamelift/api_op_DeleteScript.go b/service/gamelift/api_op_DeleteScript.go index ee7864d5374..ebf9b8ae5ca 100644 --- a/service/gamelift/api_op_DeleteScript.go +++ b/service/gamelift/api_op_DeleteScript.go @@ -18,8 +18,7 @@ import ( // if the script record no longer exists, the instance will go into an error state // and be unable to host game sessions. Learn more Amazon GameLift Realtime Servers // (https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-intro.html) -// Related actions CreateScript | ListScripts | DescribeScript | UpdateScript | -// DeleteScript | All APIs by task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DeleteScript(ctx context.Context, params *DeleteScriptInput, optFns ...func(*Options)) (*DeleteScriptOutput, error) { if params == nil { diff --git a/service/gamelift/api_op_DeleteVpcPeeringAuthorization.go b/service/gamelift/api_op_DeleteVpcPeeringAuthorization.go index a34d2a81dff..474f322c44e 100644 --- a/service/gamelift/api_op_DeleteVpcPeeringAuthorization.go +++ b/service/gamelift/api_op_DeleteVpcPeeringAuthorization.go @@ -11,10 +11,9 @@ import ( ) // Cancels a pending VPC peering authorization for the specified VPC. If you need -// to delete an existing VPC peering connection, call DeleteVpcPeeringConnection. -// Related actions CreateVpcPeeringAuthorization | DescribeVpcPeeringAuthorizations -// | DeleteVpcPeeringAuthorization | CreateVpcPeeringConnection | -// DescribeVpcPeeringConnections | DeleteVpcPeeringConnection | All APIs by task +// to delete an existing VPC peering connection, use DeleteVpcPeeringConnection +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DeleteVpcPeeringConnection.html). +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DeleteVpcPeeringAuthorization(ctx context.Context, params *DeleteVpcPeeringAuthorizationInput, optFns ...func(*Options)) (*DeleteVpcPeeringAuthorizationOutput, error) { if params == nil { @@ -31,7 +30,6 @@ func (c *Client) DeleteVpcPeeringAuthorization(ctx context.Context, params *Dele return out, nil } -// Represents the input for a request operation. type DeleteVpcPeeringAuthorizationInput struct { // A unique identifier for the Amazon Web Services account that you use to manage diff --git a/service/gamelift/api_op_DeleteVpcPeeringConnection.go b/service/gamelift/api_op_DeleteVpcPeeringConnection.go index b047f556d04..1e4df04e572 100644 --- a/service/gamelift/api_op_DeleteVpcPeeringConnection.go +++ b/service/gamelift/api_op_DeleteVpcPeeringConnection.go @@ -11,16 +11,11 @@ import ( ) // Removes a VPC peering connection. To delete the connection, you must have a -// valid authorization for the VPC peering connection that you want to delete. You -// can check for an authorization by calling DescribeVpcPeeringAuthorizations or -// request a new one using CreateVpcPeeringAuthorization. Once a valid -// authorization exists, call this operation from the Amazon Web Services account -// that is used to manage the Amazon GameLift fleets. Identify the connection to -// delete by the connection ID and fleet ID. If successful, the connection is -// removed. Related actions CreateVpcPeeringAuthorization | -// DescribeVpcPeeringAuthorizations | DeleteVpcPeeringAuthorization | -// CreateVpcPeeringConnection | DescribeVpcPeeringConnections | -// DeleteVpcPeeringConnection | All APIs by task +// valid authorization for the VPC peering connection that you want to delete.. +// Once a valid authorization exists, call this operation from the Amazon Web +// Services account that is used to manage the Amazon GameLift fleets. Identify the +// connection to delete by the connection ID and fleet ID. If successful, the +// connection is removed. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DeleteVpcPeeringConnection(ctx context.Context, params *DeleteVpcPeeringConnectionInput, optFns ...func(*Options)) (*DeleteVpcPeeringConnectionOutput, error) { if params == nil { @@ -37,7 +32,6 @@ func (c *Client) DeleteVpcPeeringConnection(ctx context.Context, params *DeleteV return out, nil } -// Represents the input for a request operation. type DeleteVpcPeeringConnectionInput struct { // A unique identifier for the fleet. This fleet specified must match the fleet @@ -47,9 +41,7 @@ type DeleteVpcPeeringConnectionInput struct { // This member is required. FleetId *string - // A unique identifier for a VPC peering connection. This value is included in the - // VpcPeeringConnection object, which can be retrieved by calling - // DescribeVpcPeeringConnections. + // A unique identifier for a VPC peering connection. // // This member is required. VpcPeeringConnectionId *string diff --git a/service/gamelift/api_op_DeregisterCompute.go b/service/gamelift/api_op_DeregisterCompute.go new file mode 100644 index 00000000000..110a7de1879 --- /dev/null +++ b/service/gamelift/api_op_DeregisterCompute.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package gamelift + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes a compute resource from the specified fleet. Deregister your compute +// resources before you delete the compute. +func (c *Client) DeregisterCompute(ctx context.Context, params *DeregisterComputeInput, optFns ...func(*Options)) (*DeregisterComputeOutput, error) { + if params == nil { + params = &DeregisterComputeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeregisterCompute", params, optFns, c.addOperationDeregisterComputeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeregisterComputeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeregisterComputeInput struct { + + // The name of the compute resource you want to delete. + // + // This member is required. + ComputeName *string + + // >A unique identifier for the fleet the compute resource is registered to. + // + // This member is required. + FleetId *string + + noSmithyDocumentSerde +} + +type DeregisterComputeOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeregisterComputeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterCompute{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterCompute{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeregisterComputeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterCompute(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeregisterCompute(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "gamelift", + OperationName: "DeregisterCompute", + } +} diff --git a/service/gamelift/api_op_DeregisterGameServer.go b/service/gamelift/api_op_DeregisterGameServer.go index 6f8705b8386..496052cea3d 100644 --- a/service/gamelift/api_op_DeregisterGameServer.go +++ b/service/gamelift/api_op_DeregisterGameServer.go @@ -18,9 +18,6 @@ import ( // CloudWatch event with termination timestamp and reason. Learn more GameLift // FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions RegisterGameServer | ListGameServers | ClaimGameServer | -// DescribeGameServer | UpdateGameServer | DeregisterGameServer | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) DeregisterGameServer(ctx context.Context, params *DeregisterGameServerInput, optFns ...func(*Options)) (*DeregisterGameServerOutput, error) { if params == nil { params = &DeregisterGameServerInput{} @@ -39,7 +36,6 @@ func (c *Client) DeregisterGameServer(ctx context.Context, params *DeregisterGam type DeregisterGameServerInput struct { // A unique identifier for the game server group where the game server is running. - // Use either the GameServerGroup name or ARN value. // // This member is required. GameServerGroupName *string diff --git a/service/gamelift/api_op_DescribeAlias.go b/service/gamelift/api_op_DescribeAlias.go index 8a2f5827508..563cc3384f4 100644 --- a/service/gamelift/api_op_DescribeAlias.go +++ b/service/gamelift/api_op_DescribeAlias.go @@ -14,8 +14,7 @@ import ( // Retrieves properties for an alias. This operation returns all alias metadata and // settings. To get an alias's target fleet ID only, use ResolveAlias. To get alias // properties, specify the alias ID. If successful, the requested alias record is -// returned. Related actions CreateAlias | ListAliases | DescribeAlias | -// UpdateAlias | DeleteAlias | ResolveAlias | All APIs by task +// returned. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeAlias(ctx context.Context, params *DescribeAliasInput, optFns ...func(*Options)) (*DescribeAliasOutput, error) { if params == nil { @@ -32,7 +31,6 @@ func (c *Client) DescribeAlias(ctx context.Context, params *DescribeAliasInput, return out, nil } -// Represents the input for a request operation. type DescribeAliasInput struct { // The unique identifier for the fleet alias that you want to retrieve. You can use @@ -44,7 +42,6 @@ type DescribeAliasInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeAliasOutput struct { // The requested alias resource. diff --git a/service/gamelift/api_op_DescribeBuild.go b/service/gamelift/api_op_DescribeBuild.go index b1933679e3f..f138b936462 100644 --- a/service/gamelift/api_op_DescribeBuild.go +++ b/service/gamelift/api_op_DescribeBuild.go @@ -14,9 +14,8 @@ import ( // Retrieves properties for a custom game build. To request a build resource, // specify a build ID. If successful, an object containing the build properties is // returned. Learn more Upload a Custom Server Build -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html) -// Related actions CreateBuild | ListBuilds | DescribeBuild | UpdateBuild | -// DeleteBuild | All APIs by task +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html)All +// APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeBuild(ctx context.Context, params *DescribeBuildInput, optFns ...func(*Options)) (*DescribeBuildOutput, error) { if params == nil { @@ -33,7 +32,6 @@ func (c *Client) DescribeBuild(ctx context.Context, params *DescribeBuildInput, return out, nil } -// Represents the input for a request operation. type DescribeBuildInput struct { // A unique identifier for the build to retrieve properties for. You can use either @@ -45,7 +43,6 @@ type DescribeBuildInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeBuildOutput struct { // Set of properties describing the requested build. diff --git a/service/gamelift/api_op_DescribeCompute.go b/service/gamelift/api_op_DescribeCompute.go new file mode 100644 index 00000000000..c88329551c7 --- /dev/null +++ b/service/gamelift/api_op_DescribeCompute.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package gamelift + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/gamelift/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves properties for a compute resource. To request a compute resource +// specify the fleet ID and compute name. If successful, GameLift returns an object +// containing the build properties. +func (c *Client) DescribeCompute(ctx context.Context, params *DescribeComputeInput, optFns ...func(*Options)) (*DescribeComputeOutput, error) { + if params == nil { + params = &DescribeComputeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeCompute", params, optFns, c.addOperationDescribeComputeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeComputeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeComputeInput struct { + + // A descriptive label that is associated with the compute resource registered to + // your fleet. + // + // This member is required. + ComputeName *string + + // A unique identifier for the fleet the compute is registered to. + // + // This member is required. + FleetId *string + + noSmithyDocumentSerde +} + +type DescribeComputeOutput struct { + + // The details of the compute resource you registered to the specified fleet. + Compute *types.Compute + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeComputeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeCompute{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeCompute{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeComputeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCompute(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeCompute(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "gamelift", + OperationName: "DescribeCompute", + } +} diff --git a/service/gamelift/api_op_DescribeEC2InstanceLimits.go b/service/gamelift/api_op_DescribeEC2InstanceLimits.go index d0e78b4eac6..de5ebce5f90 100644 --- a/service/gamelift/api_op_DescribeEC2InstanceLimits.go +++ b/service/gamelift/api_op_DescribeEC2InstanceLimits.go @@ -60,11 +60,6 @@ import ( // usage data for each requested instance type. Learn more Setting up GameLift // fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleet | UpdateFleetCapacity | PutScalingPolicy | -// DescribeEC2InstanceLimits | DescribeFleetAttributes | -// DescribeFleetLocationAttributes | UpdateFleetAttributes | StopFleetActions | -// DeleteFleet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeEC2InstanceLimits(ctx context.Context, params *DescribeEC2InstanceLimitsInput, optFns ...func(*Options)) (*DescribeEC2InstanceLimitsOutput, error) { if params == nil { params = &DescribeEC2InstanceLimitsInput{} @@ -80,7 +75,6 @@ func (c *Client) DescribeEC2InstanceLimits(ctx context.Context, params *Describe return out, nil } -// Represents the input for a request operation. type DescribeEC2InstanceLimitsInput struct { // Name of an Amazon EC2 instance type that is supported in GameLift. A fleet @@ -96,7 +90,6 @@ type DescribeEC2InstanceLimitsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeEC2InstanceLimitsOutput struct { // The maximum number of instances for the specified instance type. diff --git a/service/gamelift/api_op_DescribeFleetAttributes.go b/service/gamelift/api_op_DescribeFleetAttributes.go index 8dcb5ec1a4d..97b81c334e6 100644 --- a/service/gamelift/api_op_DescribeFleetAttributes.go +++ b/service/gamelift/api_op_DescribeFleetAttributes.go @@ -30,11 +30,6 @@ import ( // this limit, the request fails and the error message contains the maximum allowed // number. Learn more Setting up GameLift fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions ListFleets | DescribeEC2InstanceLimits | DescribeFleetAttributes -// | DescribeFleetCapacity | DescribeFleetEvents | DescribeFleetLocationAttributes -// | DescribeFleetPortSettings | DescribeFleetUtilization | -// DescribeRuntimeConfiguration | DescribeScalingPolicies | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeFleetAttributes(ctx context.Context, params *DescribeFleetAttributesInput, optFns ...func(*Options)) (*DescribeFleetAttributesOutput, error) { if params == nil { params = &DescribeFleetAttributesInput{} @@ -50,7 +45,6 @@ func (c *Client) DescribeFleetAttributes(ctx context.Context, params *DescribeFl return out, nil } -// Represents the input for a request operation. type DescribeFleetAttributesInput struct { // A list of unique fleet identifiers to retrieve attributes for. You can use @@ -72,7 +66,6 @@ type DescribeFleetAttributesInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeFleetAttributesOutput struct { // A collection of objects containing attribute metadata for each requested fleet diff --git a/service/gamelift/api_op_DescribeFleetCapacity.go b/service/gamelift/api_op_DescribeFleetCapacity.go index 6ab2b9e8263..57768e6c2b4 100644 --- a/service/gamelift/api_op_DescribeFleetCapacity.go +++ b/service/gamelift/api_op_DescribeFleetCapacity.go @@ -15,34 +15,27 @@ import ( // Retrieves the resource capacity settings for one or more fleets. The data // returned includes the current fleet capacity (number of EC2 instances), and // settings that can control how capacity scaling. For fleets with remote -// locations, this operation retrieves data for the fleet's home Region only. See -// DescribeFleetLocationCapacity to get capacity settings for a fleet's remote -// locations. This operation can be used in the following ways: +// locations, this operation retrieves data for the fleet's home Region only. This +// operation can be used in the following ways: // -// * To get capacity -// data for one or more specific fleets, provide a list of fleet IDs or fleet -// ARNs. +// * To get capacity data for one or +// more specific fleets, provide a list of fleet IDs or fleet ARNs. // -// * To get capacity data for all fleets, do not provide a fleet -// identifier. +// * To get +// capacity data for all fleets, do not provide a fleet identifier. // -// When requesting multiple fleets, use the pagination parameters to -// retrieve results as a set of sequential pages. If successful, a FleetCapacity -// object is returned for each requested fleet ID. Each FleetCapacity object -// includes a Location property, which is set to the fleet's home Region. When a -// list of fleet IDs is provided, attribute objects are returned only for fleets -// that currently exist. Some API operations may limit the number of fleet IDs that -// are allowed in one request. If a request exceeds this limit, the request fails -// and the error message includes the maximum allowed. Learn more Setting up -// GameLift fleets +// When +// requesting multiple fleets, use the pagination parameters to retrieve results as +// a set of sequential pages. If successful, a FleetCapacity object is returned for +// each requested fleet ID. Each FleetCapacity object includes a Location property, +// which is set to the fleet's home Region. When a list of fleet IDs is provided, +// attribute objects are returned only for fleets that currently exist. Some API +// operations may limit the number of fleet IDs that are allowed in one request. If +// a request exceeds this limit, the request fails and the error message includes +// the maximum allowed. Learn more Setting up GameLift fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html)GameLift // metrics for fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html#gamelift-metrics-fleet) -// Related actions ListFleets | DescribeEC2InstanceLimits | DescribeFleetAttributes -// | DescribeFleetCapacity | DescribeFleetEvents | DescribeFleetLocationAttributes -// | DescribeFleetPortSettings | DescribeFleetUtilization | -// DescribeRuntimeConfiguration | DescribeScalingPolicies | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeFleetCapacity(ctx context.Context, params *DescribeFleetCapacityInput, optFns ...func(*Options)) (*DescribeFleetCapacityOutput, error) { if params == nil { params = &DescribeFleetCapacityInput{} @@ -58,11 +51,10 @@ func (c *Client) DescribeFleetCapacity(ctx context.Context, params *DescribeFlee return out, nil } -// Represents the input for a request operation. type DescribeFleetCapacityInput struct { - // A unique identifier for the fleet(s) to retrieve capacity information for. You - // can use either the fleet ID or ARN value. Leave this parameter empty to retrieve + // A unique identifier for the fleet to retrieve capacity information for. You can + // use either the fleet ID or ARN value. Leave this parameter empty to retrieve // capacity information for all fleets. FleetIds []string @@ -80,7 +72,6 @@ type DescribeFleetCapacityInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeFleetCapacityOutput struct { // A collection of objects that contains capacity information for each requested diff --git a/service/gamelift/api_op_DescribeFleetEvents.go b/service/gamelift/api_op_DescribeFleetEvents.go index 8efa3d67d83..2d99b11465d 100644 --- a/service/gamelift/api_op_DescribeFleetEvents.go +++ b/service/gamelift/api_op_DescribeFleetEvents.go @@ -21,11 +21,6 @@ import ( // set of sequential pages. If successful, a collection of event log entries // matching the request are returned. Learn more Setting up GameLift fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions ListFleets | DescribeEC2InstanceLimits | DescribeFleetAttributes -// | DescribeFleetCapacity | DescribeFleetEvents | DescribeFleetLocationAttributes -// | DescribeFleetPortSettings | DescribeFleetUtilization | -// DescribeRuntimeConfiguration | DescribeScalingPolicies | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeFleetEvents(ctx context.Context, params *DescribeFleetEventsInput, optFns ...func(*Options)) (*DescribeFleetEventsOutput, error) { if params == nil { params = &DescribeFleetEventsInput{} @@ -41,7 +36,6 @@ func (c *Client) DescribeFleetEvents(ctx context.Context, params *DescribeFleetE return out, nil } -// Represents the input for a request operation. type DescribeFleetEventsInput struct { // A unique identifier for the fleet to get event logs for. You can use either the @@ -74,7 +68,6 @@ type DescribeFleetEventsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeFleetEventsOutput struct { // A collection of objects containing event log entries for the specified fleet. diff --git a/service/gamelift/api_op_DescribeFleetLocationAttributes.go b/service/gamelift/api_op_DescribeFleetLocationAttributes.go index 412a5dc577a..184a10865a9 100644 --- a/service/gamelift/api_op_DescribeFleetLocationAttributes.go +++ b/service/gamelift/api_op_DescribeFleetLocationAttributes.go @@ -31,11 +31,6 @@ import ( // information on a fleet's home Region, call DescribeFleetAttributes. Learn more // Setting up GameLift fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleetLocations | DescribeFleetLocationAttributes | -// DescribeFleetLocationCapacity | DescribeFleetLocationUtilization | -// DescribeFleetAttributes | DescribeFleetCapacity | DescribeFleetUtilization | -// UpdateFleetCapacity | StopFleetActions | DeleteFleetLocations | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeFleetLocationAttributes(ctx context.Context, params *DescribeFleetLocationAttributesInput, optFns ...func(*Options)) (*DescribeFleetLocationAttributesOutput, error) { if params == nil { params = &DescribeFleetLocationAttributesInput{} @@ -51,7 +46,6 @@ func (c *Client) DescribeFleetLocationAttributes(ctx context.Context, params *De return out, nil } -// Represents the input for a request operation. type DescribeFleetLocationAttributesInput struct { // A unique identifier for the fleet to retrieve remote locations for. You can use @@ -76,7 +70,6 @@ type DescribeFleetLocationAttributesInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeFleetLocationAttributesOutput struct { // The Amazon Resource Name (ARN diff --git a/service/gamelift/api_op_DescribeFleetLocationCapacity.go b/service/gamelift/api_op_DescribeFleetLocationCapacity.go index 3f528a5e3d3..8bda7862dd1 100644 --- a/service/gamelift/api_op_DescribeFleetLocationCapacity.go +++ b/service/gamelift/api_op_DescribeFleetLocationCapacity.go @@ -22,11 +22,6 @@ import ( // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html)GameLift // metrics for fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html#gamelift-metrics-fleet) -// Related actions CreateFleetLocations | DescribeFleetLocationAttributes | -// DescribeFleetLocationCapacity | DescribeFleetLocationUtilization | -// DescribeFleetAttributes | DescribeFleetCapacity | DescribeFleetUtilization | -// UpdateFleetCapacity | StopFleetActions | DeleteFleetLocations | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeFleetLocationCapacity(ctx context.Context, params *DescribeFleetLocationCapacityInput, optFns ...func(*Options)) (*DescribeFleetLocationCapacityOutput, error) { if params == nil { params = &DescribeFleetLocationCapacityInput{} @@ -42,7 +37,6 @@ func (c *Client) DescribeFleetLocationCapacity(ctx context.Context, params *Desc return out, nil } -// Represents the input for a request operation. type DescribeFleetLocationCapacityInput struct { // A unique identifier for the fleet to request location capacity for. You can use @@ -60,7 +54,6 @@ type DescribeFleetLocationCapacityInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeFleetLocationCapacityOutput struct { // Resource capacity information for the requested fleet location. Capacity objects diff --git a/service/gamelift/api_op_DescribeFleetLocationUtilization.go b/service/gamelift/api_op_DescribeFleetLocationUtilization.go index 09e923d9e3e..78f07390bea 100644 --- a/service/gamelift/api_op_DescribeFleetLocationUtilization.go +++ b/service/gamelift/api_op_DescribeFleetLocationUtilization.go @@ -21,11 +21,6 @@ import ( // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html)GameLift // metrics for fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html#gamelift-metrics-fleet) -// Related actions CreateFleetLocations | DescribeFleetLocationAttributes | -// DescribeFleetLocationCapacity | DescribeFleetLocationUtilization | -// DescribeFleetAttributes | DescribeFleetCapacity | DescribeFleetUtilization | -// UpdateFleetCapacity | StopFleetActions | DeleteFleetLocations | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeFleetLocationUtilization(ctx context.Context, params *DescribeFleetLocationUtilizationInput, optFns ...func(*Options)) (*DescribeFleetLocationUtilizationOutput, error) { if params == nil { params = &DescribeFleetLocationUtilizationInput{} @@ -41,7 +36,6 @@ func (c *Client) DescribeFleetLocationUtilization(ctx context.Context, params *D return out, nil } -// Represents the input for a request operation. type DescribeFleetLocationUtilizationInput struct { // A unique identifier for the fleet to request location utilization for. You can @@ -59,7 +53,6 @@ type DescribeFleetLocationUtilizationInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeFleetLocationUtilizationOutput struct { // Utilization information for the requested fleet location. Utilization objects diff --git a/service/gamelift/api_op_DescribeFleetPortSettings.go b/service/gamelift/api_op_DescribeFleetPortSettings.go index 0d463d74663..c4082847cf8 100644 --- a/service/gamelift/api_op_DescribeFleetPortSettings.go +++ b/service/gamelift/api_op_DescribeFleetPortSettings.go @@ -30,11 +30,6 @@ import ( // If the requested fleet has been deleted, the result set is empty. Learn more // Setting up GameLift fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions ListFleets | DescribeEC2InstanceLimits | DescribeFleetAttributes -// | DescribeFleetCapacity | DescribeFleetEvents | DescribeFleetLocationAttributes -// | DescribeFleetPortSettings | DescribeFleetUtilization | -// DescribeRuntimeConfiguration | DescribeScalingPolicies | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeFleetPortSettings(ctx context.Context, params *DescribeFleetPortSettingsInput, optFns ...func(*Options)) (*DescribeFleetPortSettingsOutput, error) { if params == nil { params = &DescribeFleetPortSettingsInput{} @@ -50,7 +45,6 @@ func (c *Client) DescribeFleetPortSettings(ctx context.Context, params *Describe return out, nil } -// Represents the input for a request operation. type DescribeFleetPortSettingsInput struct { // A unique identifier for the fleet to retrieve port settings for. You can use @@ -66,7 +60,6 @@ type DescribeFleetPortSettingsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeFleetPortSettingsOutput struct { // The Amazon Resource Name (ARN diff --git a/service/gamelift/api_op_DescribeFleetUtilization.go b/service/gamelift/api_op_DescribeFleetUtilization.go index 89ccc5e0701..70509df8641 100644 --- a/service/gamelift/api_op_DescribeFleetUtilization.go +++ b/service/gamelift/api_op_DescribeFleetUtilization.go @@ -15,32 +15,30 @@ import ( // Retrieves utilization statistics for one or more fleets. Utilization data // provides a snapshot of how the fleet's hosting resources are currently being // used. For fleets with remote locations, this operation retrieves data for the -// fleet's home Region only. See DescribeFleetLocationUtilization to get -// utilization statistics for a fleet's remote locations. This operation can be -// used in the following ways: +// fleet's home Region only. See DescribeFleetLocationUtilization +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeFleetLocationUtilization.html) +// to get utilization statistics for a fleet's remote locations. This operation can +// be used in the following ways: // -// * To get utilization data for one or more specific -// fleets, provide a list of fleet IDs or fleet ARNs. +// * To get utilization data for one or more +// specific fleets, provide a list of fleet IDs or fleet ARNs. // -// * To get utilization data -// for all fleets, do not provide a fleet identifier. +// * To get +// utilization data for all fleets, do not provide a fleet identifier. // -// When requesting multiple -// fleets, use the pagination parameters to retrieve results as a set of sequential -// pages. If successful, a FleetUtilization object is returned for each requested -// fleet ID, unless the fleet identifier is not found. Each fleet utilization -// object includes a Location property, which is set to the fleet's home Region. -// Some API operations may limit the number of fleet IDs allowed in one request. If -// a request exceeds this limit, the request fails and the error message includes -// the maximum allowed. Learn more Setting up GameLift Fleets +// When +// requesting multiple fleets, use the pagination parameters to retrieve results as +// a set of sequential pages. If successful, a FleetUtilization +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_FleetUtilization.html) +// object is returned for each requested fleet ID, unless the fleet identifier is +// not found. Each fleet utilization object includes a Location property, which is +// set to the fleet's home Region. Some API operations may limit the number of +// fleet IDs allowed in one request. If a request exceeds this limit, the request +// fails and the error message includes the maximum allowed. Learn more Setting up +// GameLift Fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html)GameLift // Metrics for Fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html#gamelift-metrics-fleet) -// Related actions ListFleets | DescribeEC2InstanceLimits | DescribeFleetAttributes -// | DescribeFleetCapacity | DescribeFleetEvents | DescribeFleetLocationAttributes -// | DescribeFleetPortSettings | DescribeFleetUtilization | -// DescribeRuntimeConfiguration | DescribeScalingPolicies | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeFleetUtilization(ctx context.Context, params *DescribeFleetUtilizationInput, optFns ...func(*Options)) (*DescribeFleetUtilizationOutput, error) { if params == nil { params = &DescribeFleetUtilizationInput{} @@ -56,12 +54,11 @@ func (c *Client) DescribeFleetUtilization(ctx context.Context, params *DescribeF return out, nil } -// Represents the input for a request operation. type DescribeFleetUtilizationInput struct { - // A unique identifier for the fleet(s) to retrieve utilization data for. You can - // use either the fleet ID or ARN value. To retrieve attributes for all current - // fleets, do not include this parameter. + // A unique identifier for the fleet to retrieve utilization data for. You can use + // either the fleet ID or ARN value. To retrieve attributes for all current fleets, + // do not include this parameter. FleetIds []string // The maximum number of results to return. Use this parameter with NextToken to @@ -78,7 +75,6 @@ type DescribeFleetUtilizationInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeFleetUtilizationOutput struct { // A collection of objects containing utilization information for each requested diff --git a/service/gamelift/api_op_DescribeGameServer.go b/service/gamelift/api_op_DescribeGameServer.go index 4ac58a24c8f..478da30048a 100644 --- a/service/gamelift/api_op_DescribeGameServer.go +++ b/service/gamelift/api_op_DescribeGameServer.go @@ -18,9 +18,6 @@ import ( // successful, the requested game server object is returned. Learn more GameLift // FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions RegisterGameServer | ListGameServers | ClaimGameServer | -// DescribeGameServer | UpdateGameServer | DeregisterGameServer | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) DescribeGameServer(ctx context.Context, params *DescribeGameServerInput, optFns ...func(*Options)) (*DescribeGameServerOutput, error) { if params == nil { params = &DescribeGameServerInput{} @@ -39,7 +36,6 @@ func (c *Client) DescribeGameServer(ctx context.Context, params *DescribeGameSer type DescribeGameServerInput struct { // A unique identifier for the game server group where the game server is running. - // Use either the GameServerGroup name or ARN value. // // This member is required. GameServerGroupName *string diff --git a/service/gamelift/api_op_DescribeGameServerGroup.go b/service/gamelift/api_op_DescribeGameServerGroup.go index 961ec0a3990..4712ca42b25 100644 --- a/service/gamelift/api_op_DescribeGameServerGroup.go +++ b/service/gamelift/api_op_DescribeGameServerGroup.go @@ -20,11 +20,6 @@ import ( // value. If successful, a GameServerGroup object is returned. Learn more GameLift // FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions CreateGameServerGroup | ListGameServerGroups | -// DescribeGameServerGroup | UpdateGameServerGroup | DeleteGameServerGroup | -// ResumeGameServerGroup | SuspendGameServerGroup | DescribeGameServerInstances | -// All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) DescribeGameServerGroup(ctx context.Context, params *DescribeGameServerGroupInput, optFns ...func(*Options)) (*DescribeGameServerGroupOutput, error) { if params == nil { params = &DescribeGameServerGroupInput{} @@ -42,8 +37,7 @@ func (c *Client) DescribeGameServerGroup(ctx context.Context, params *DescribeGa type DescribeGameServerGroupInput struct { - // A unique identifier for the game server group. Use either the GameServerGroup - // name or ARN value. + // A unique identifier for the game server group. Use either the name or ARN value. // // This member is required. GameServerGroupName *string diff --git a/service/gamelift/api_op_DescribeGameServerInstances.go b/service/gamelift/api_op_DescribeGameServerInstances.go index 77273dddcba..e2a1660d7a2 100644 --- a/service/gamelift/api_op_DescribeGameServerInstances.go +++ b/service/gamelift/api_op_DescribeGameServerInstances.go @@ -15,23 +15,17 @@ import ( // This operation is used with the GameLift FleetIQ solution and game server // groups. Retrieves status information about the Amazon EC2 instances associated // with a GameLift FleetIQ game server group. Use this operation to detect when -// instances are active or not available to host new game servers. If you are -// looking for instance configuration information, call DescribeGameServerGroup or -// access the corresponding Auto Scaling group properties. To request status for -// all instances in the game server group, provide a game server group ID only. To -// request status for specific instances, provide the game server group ID and one -// or more instance IDs. Use the pagination parameters to retrieve results in -// sequential segments. If successful, a collection of GameServerInstance objects -// is returned. This operation is not designed to be called with every game server -// claim request; this practice can cause you to exceed your API limit, which -// results in errors. Instead, as a best practice, cache the results and refresh -// your cache no more than once every 10 seconds. Learn more GameLift FleetIQ Guide +// instances are active or not available to host new game servers. To request +// status for all instances in the game server group, provide a game server group +// ID only. To request status for specific instances, provide the game server group +// ID and one or more instance IDs. Use the pagination parameters to retrieve +// results in sequential segments. If successful, a collection of +// GameServerInstance objects is returned. This operation is not designed to be +// called with every game server claim request; this practice can cause you to +// exceed your API limit, which results in errors. Instead, as a best practice, +// cache the results and refresh your cache no more than once every 10 seconds. +// Learn more GameLift FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions CreateGameServerGroup | ListGameServerGroups | -// DescribeGameServerGroup | UpdateGameServerGroup | DeleteGameServerGroup | -// ResumeGameServerGroup | SuspendGameServerGroup | DescribeGameServerInstances | -// All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) DescribeGameServerInstances(ctx context.Context, params *DescribeGameServerInstancesInput, optFns ...func(*Options)) (*DescribeGameServerInstancesOutput, error) { if params == nil { params = &DescribeGameServerInstancesInput{} @@ -49,8 +43,7 @@ func (c *Client) DescribeGameServerInstances(ctx context.Context, params *Descri type DescribeGameServerInstancesInput struct { - // A unique identifier for the game server group. Use either the GameServerGroup - // name or ARN value. + // A unique identifier for the game server group. Use either the name or ARN value. // // This member is required. GameServerGroupName *string diff --git a/service/gamelift/api_op_DescribeGameSessionDetails.go b/service/gamelift/api_op_DescribeGameSessionDetails.go index 826825a8243..94115937b09 100644 --- a/service/gamelift/api_op_DescribeGameSessionDetails.go +++ b/service/gamelift/api_op_DescribeGameSessionDetails.go @@ -15,34 +15,29 @@ import ( // Retrieves additional game session properties, including the game session // protection policy in force, a set of one or more game sessions in a specific // fleet location. You can optionally filter the results by current game session -// status. Alternatively, use SearchGameSessions to request a set of active game -// sessions that are filtered by certain criteria. To retrieve all game session -// properties, use DescribeGameSessions. This operation can be used in the -// following ways: +// status. This operation can be used in the following ways: // -// * To retrieve details for all game sessions that are currently -// running on all locations in a fleet, provide a fleet or alias ID, with an -// optional status filter. This approach returns details from the fleet's home -// Region and all remote locations. +// * To retrieve details +// for all game sessions that are currently running on all locations in a fleet, +// provide a fleet or alias ID, with an optional status filter. This approach +// returns details from the fleet's home Region and all remote locations. // -// * To retrieve details for all game sessions -// that are currently running on a specific fleet location, provide a fleet or -// alias ID and a location name, with optional status filter. The location can be -// the fleet's home Region or any remote location. +// * To +// retrieve details for all game sessions that are currently running on a specific +// fleet location, provide a fleet or alias ID and a location name, with optional +// status filter. The location can be the fleet's home Region or any remote +// location. // -// * To retrieve details for a -// specific game session, provide the game session ID. This approach looks for the -// game session ID in all fleets that reside in the Amazon Web Services Region -// defined in the request. +// * To retrieve details for a specific game session, provide the game +// session ID. This approach looks for the game session ID in all fleets that +// reside in the Amazon Web Services Region defined in the request. // -// Use the pagination parameters to retrieve results as a -// set of sequential pages. If successful, a GameSessionDetail object is returned -// for each game session that matches the request. Learn more Find a game session -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#gamelift-sdk-client-api-find) -// Related actions CreateGameSession | DescribeGameSessions | -// DescribeGameSessionDetails | SearchGameSessions | UpdateGameSession | -// GetGameSessionLogUrl | StartGameSessionPlacement | DescribeGameSessionPlacement -// | StopGameSessionPlacement | All APIs by task +// Use the +// pagination parameters to retrieve results as a set of sequential pages. If +// successful, a GameSessionDetail object is returned for each game session that +// matches the request. Learn more Find a game session +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#gamelift-sdk-client-api-find)All +// APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeGameSessionDetails(ctx context.Context, params *DescribeGameSessionDetailsInput, optFns ...func(*Options)) (*DescribeGameSessionDetailsOutput, error) { if params == nil { @@ -59,7 +54,6 @@ func (c *Client) DescribeGameSessionDetails(ctx context.Context, params *Describ return out, nil } -// Represents the input for a request operation. type DescribeGameSessionDetailsInput struct { // A unique identifier for the alias associated with the fleet to retrieve all game @@ -77,9 +71,9 @@ type DescribeGameSessionDetailsInput struct { // get results as a set of sequential pages. Limit *int32 - // A fleet location to get game sessions for. You can specify a fleet's home Region - // or a remote location. Use the Amazon Web Services Region code format, such as - // us-west-2. + // A fleet location to get game session details for. You can specify a fleet's home + // Region or a remote location. Use the Amazon Web Services Region code format, + // such as us-west-2. Location *string // A token that indicates the start of the next sequential page of results. Use the @@ -94,7 +88,6 @@ type DescribeGameSessionDetailsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeGameSessionDetailsOutput struct { // A collection of properties for each game session that matches the request. diff --git a/service/gamelift/api_op_DescribeGameSessionPlacement.go b/service/gamelift/api_op_DescribeGameSessionPlacement.go index e2f900804c0..6bcf8bef11a 100644 --- a/service/gamelift/api_op_DescribeGameSessionPlacement.go +++ b/service/gamelift/api_op_DescribeGameSessionPlacement.go @@ -18,12 +18,7 @@ import ( // Instead, you must configure configure an Amazon Simple Notification Service // (SNS) topic to receive notifications from FlexMatch or queues. Continuously // polling with DescribeGameSessionPlacement should only be used for games in -// development with low game session usage. If successful, a GameSessionPlacement -// object is returned. Related actions CreateGameSession | DescribeGameSessions | -// DescribeGameSessionDetails | SearchGameSessions | UpdateGameSession | -// GetGameSessionLogUrl | StartGameSessionPlacement | DescribeGameSessionPlacement -// | StopGameSessionPlacement | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// development with low game session usage. func (c *Client) DescribeGameSessionPlacement(ctx context.Context, params *DescribeGameSessionPlacementInput, optFns ...func(*Options)) (*DescribeGameSessionPlacementOutput, error) { if params == nil { params = &DescribeGameSessionPlacementInput{} @@ -39,7 +34,6 @@ func (c *Client) DescribeGameSessionPlacement(ctx context.Context, params *Descr return out, nil } -// Represents the input for a request operation. type DescribeGameSessionPlacementInput struct { // A unique identifier for a game session placement to retrieve. @@ -50,7 +44,6 @@ type DescribeGameSessionPlacementInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeGameSessionPlacementOutput struct { // Object that describes the requested game session placement. diff --git a/service/gamelift/api_op_DescribeGameSessionQueues.go b/service/gamelift/api_op_DescribeGameSessionQueues.go index 2cfceed5172..566ad89e831 100644 --- a/service/gamelift/api_op_DescribeGameSessionQueues.go +++ b/service/gamelift/api_op_DescribeGameSessionQueues.go @@ -14,20 +14,9 @@ import ( // Retrieves the properties for one or more game session queues. When requesting // multiple queues, use the pagination parameters to retrieve results as a set of -// sequential pages. If successful, a GameSessionQueue object is returned for each -// requested queue. When specifying a list of queues, objects are returned only for -// queues that currently exist in the Region. Learn more View Your Queues +// sequential pages. When specifying a list of queues, objects are returned only +// for queues that currently exist in the Region. Learn more View Your Queues // (https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-console.html) -// Related actions CreateGameSessionQueue -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateGameSessionQueue.html) -// | DescribeGameSessionQueues -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessionQueues.html) -// | UpdateGameSessionQueue -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSessionQueue.html) -// | DeleteGameSessionQueue -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DeleteGameSessionQueue.html) -// | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeGameSessionQueues(ctx context.Context, params *DescribeGameSessionQueuesInput, optFns ...func(*Options)) (*DescribeGameSessionQueuesOutput, error) { if params == nil { params = &DescribeGameSessionQueuesInput{} @@ -43,7 +32,6 @@ func (c *Client) DescribeGameSessionQueues(ctx context.Context, params *Describe return out, nil } -// Represents the input for a request operation. type DescribeGameSessionQueuesInput struct { // The maximum number of results to return. Use this parameter with NextToken to @@ -62,7 +50,6 @@ type DescribeGameSessionQueuesInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeGameSessionQueuesOutput struct { // A collection of objects that describe the requested game session queues. diff --git a/service/gamelift/api_op_DescribeGameSessions.go b/service/gamelift/api_op_DescribeGameSessions.go index 11265c6cff6..7f2948f0bef 100644 --- a/service/gamelift/api_op_DescribeGameSessions.go +++ b/service/gamelift/api_op_DescribeGameSessions.go @@ -13,48 +13,35 @@ import ( ) // Retrieves a set of one or more game sessions in a specific fleet location. You -// can optionally filter the results by current game session status. Alternatively, -// use SearchGameSessions to request a set of active game sessions that are -// filtered by certain criteria. To retrieve the protection policy for game -// sessions, use DescribeGameSessionDetails. This operation is not designed to be -// continually called to track game session status. This practice can cause you to -// exceed your API limit, which results in errors. Instead, you must configure -// configure an Amazon Simple Notification Service (SNS) topic to receive -// notifications from FlexMatch or queues. Continuously polling with -// DescribeGameSessions should only be used for games in development with low game -// session usage. This operation can be used in the following ways: +// can optionally filter the results by current game session status. This operation +// can be used in the following ways: // -// * To retrieve -// all game sessions that are currently running on all locations in a fleet, -// provide a fleet or alias ID, with an optional status filter. This approach -// returns all game sessions in the fleet's home Region and all remote -// locations. +// * To retrieve all game sessions that are +// currently running on all locations in a fleet, provide a fleet or alias ID, with +// an optional status filter. This approach returns all game sessions in the +// fleet's home Region and all remote locations. // -// * To retrieve all game sessions that are currently running on a -// specific fleet location, provide a fleet or alias ID and a location name, with -// optional status filter. The location can be the fleet's home Region or any -// remote location. +// * To retrieve all game sessions +// that are currently running on a specific fleet location, provide a fleet or +// alias ID and a location name, with optional status filter. The location can be +// the fleet's home Region or any remote location. // -// * To retrieve a specific game session, provide the game -// session ID. This approach looks for the game session ID in all fleets that -// reside in the Amazon Web Services Region defined in the request. +// * To retrieve a specific game +// session, provide the game session ID. This approach looks for the game session +// ID in all fleets that reside in the Amazon Web Services Region defined in the +// request. // -// Use the -// pagination parameters to retrieve results as a set of sequential pages. If -// successful, a GameSession object is returned for each game session that matches -// the request. This operation is not designed to be continually called to track -// matchmaking ticket status. This practice can cause you to exceed your API limit, -// which results in errors. Instead, as a best practice, set up an Amazon Simple -// Notification Service to receive notifications, and provide the topic ARN in the -// matchmaking configuration. Continuously poling ticket status with -// DescribeGameSessions should only be used for games in development with low -// matchmaking usage. Available in Amazon GameLift Local. Learn more Find a game -// session -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#gamelift-sdk-client-api-find) -// Related actions CreateGameSession | DescribeGameSessions | -// DescribeGameSessionDetails | SearchGameSessions | UpdateGameSession | -// GetGameSessionLogUrl | StartGameSessionPlacement | DescribeGameSessionPlacement -// | StopGameSessionPlacement | All APIs by task +// Use the pagination parameters to retrieve results as a set of +// sequential pages. If successful, a GameSession object is returned for each game +// session that matches the request. This operation is not designed to be +// continually called to track game session status. This practice can cause you to +// exceed your API limit, which results in errors. Instead, you must configure an +// Amazon Simple Notification Service (SNS) topic to receive notifications from +// FlexMatch or queues. Continuously polling with DescribeGameSessions should only +// be used for games in development with low game session usage. Available in +// Amazon GameLift Local. Learn more Find a game session +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#gamelift-sdk-client-api-find)All +// APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeGameSessions(ctx context.Context, params *DescribeGameSessionsInput, optFns ...func(*Options)) (*DescribeGameSessionsOutput, error) { if params == nil { @@ -71,7 +58,6 @@ func (c *Client) DescribeGameSessions(ctx context.Context, params *DescribeGameS return out, nil } -// Represents the input for a request operation. type DescribeGameSessionsInput struct { // A unique identifier for the alias associated with the fleet to retrieve game @@ -89,9 +75,9 @@ type DescribeGameSessionsInput struct { // get results as a set of sequential pages. Limit *int32 - // A fleet location to get game session details for. You can specify a fleet's home - // Region or a remote location. Use the Amazon Web Services Region code format, - // such as us-west-2. + // A fleet location to get game sessions for. You can specify a fleet's home Region + // or a remote location. Use the Amazon Web Services Region code format, such as + // us-west-2. Location *string // A token that indicates the start of the next sequential page of results. Use the @@ -107,7 +93,6 @@ type DescribeGameSessionsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeGameSessionsOutput struct { // A collection of properties for each game session that matches the request. diff --git a/service/gamelift/api_op_DescribeInstances.go b/service/gamelift/api_op_DescribeInstances.go index f57cfc8c7fc..f118abd7136 100644 --- a/service/gamelift/api_op_DescribeInstances.go +++ b/service/gamelift/api_op_DescribeInstances.go @@ -33,8 +33,7 @@ import ( // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-remote-access.html)Debug // Fleet Issues // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html) -// Related actions DescribeInstances | GetInstanceAccess | -// DescribeEC2InstanceLimits | All APIs by task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeInstances(ctx context.Context, params *DescribeInstancesInput, optFns ...func(*Options)) (*DescribeInstancesOutput, error) { if params == nil { @@ -51,7 +50,6 @@ func (c *Client) DescribeInstances(ctx context.Context, params *DescribeInstance return out, nil } -// Represents the input for a request operation. type DescribeInstancesInput struct { // A unique identifier for the fleet to retrieve instance information for. You can @@ -80,7 +78,6 @@ type DescribeInstancesInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeInstancesOutput struct { // A collection of objects containing properties for each instance returned. diff --git a/service/gamelift/api_op_DescribeMatchmaking.go b/service/gamelift/api_op_DescribeMatchmaking.go index c01e4d8e73f..a477e5986d2 100644 --- a/service/gamelift/api_op_DescribeMatchmaking.go +++ b/service/gamelift/api_op_DescribeMatchmaking.go @@ -20,15 +20,10 @@ import ( // practice can cause you to exceed your API limit, which results in errors. // Instead, as a best practice, set up an Amazon Simple Notification Service to // receive notifications, and provide the topic ARN in the matchmaking -// configuration. Continuously polling ticket status with DescribeMatchmaking -// should only be used for games in development with low matchmaking usage. Learn -// more Add FlexMatch to a game client +// configuration. Learn more Add FlexMatch to a game client // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-client.html) // Set Up FlexMatch event notification // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-notification.html) -// Related actions StartMatchmaking | DescribeMatchmaking | StopMatchmaking | -// AcceptMatch | StartMatchBackfill | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeMatchmaking(ctx context.Context, params *DescribeMatchmakingInput, optFns ...func(*Options)) (*DescribeMatchmakingOutput, error) { if params == nil { params = &DescribeMatchmakingInput{} @@ -44,7 +39,6 @@ func (c *Client) DescribeMatchmaking(ctx context.Context, params *DescribeMatchm return out, nil } -// Represents the input for a request operation. type DescribeMatchmakingInput struct { // A unique identifier for a matchmaking ticket. You can include up to 10 ID @@ -56,7 +50,6 @@ type DescribeMatchmakingInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeMatchmakingOutput struct { // A collection of existing matchmaking ticket objects matching the request. diff --git a/service/gamelift/api_op_DescribeMatchmakingConfigurations.go b/service/gamelift/api_op_DescribeMatchmakingConfigurations.go index 934cffd4d1e..297f3b21fb1 100644 --- a/service/gamelift/api_op_DescribeMatchmakingConfigurations.go +++ b/service/gamelift/api_op_DescribeMatchmakingConfigurations.go @@ -21,12 +21,6 @@ import ( // a list of names, only configurations that currently exist are returned. Learn // more Setting up FlexMatch matchmakers // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/matchmaker-build.html) -// Related actions CreateMatchmakingConfiguration | -// DescribeMatchmakingConfigurations | UpdateMatchmakingConfiguration | -// DeleteMatchmakingConfiguration | CreateMatchmakingRuleSet | -// DescribeMatchmakingRuleSets | ValidateMatchmakingRuleSet | -// DeleteMatchmakingRuleSet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeMatchmakingConfigurations(ctx context.Context, params *DescribeMatchmakingConfigurationsInput, optFns ...func(*Options)) (*DescribeMatchmakingConfigurationsOutput, error) { if params == nil { params = &DescribeMatchmakingConfigurationsInput{} @@ -42,7 +36,6 @@ func (c *Client) DescribeMatchmakingConfigurations(ctx context.Context, params * return out, nil } -// Represents the input for a request operation. type DescribeMatchmakingConfigurationsInput struct { // The maximum number of results to return. Use this parameter with NextToken to @@ -67,7 +60,6 @@ type DescribeMatchmakingConfigurationsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeMatchmakingConfigurationsOutput struct { // A collection of requested matchmaking configurations. diff --git a/service/gamelift/api_op_DescribeMatchmakingRuleSets.go b/service/gamelift/api_op_DescribeMatchmakingRuleSets.go index c43613049bd..4d14c20f5b4 100644 --- a/service/gamelift/api_op_DescribeMatchmakingRuleSets.go +++ b/service/gamelift/api_op_DescribeMatchmakingRuleSets.go @@ -20,13 +20,6 @@ import ( // // * Build a rule set // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html) -// -// Related -// actions CreateMatchmakingConfiguration | DescribeMatchmakingConfigurations | -// UpdateMatchmakingConfiguration | DeleteMatchmakingConfiguration | -// CreateMatchmakingRuleSet | DescribeMatchmakingRuleSets | -// ValidateMatchmakingRuleSet | DeleteMatchmakingRuleSet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeMatchmakingRuleSets(ctx context.Context, params *DescribeMatchmakingRuleSetsInput, optFns ...func(*Options)) (*DescribeMatchmakingRuleSetsOutput, error) { if params == nil { params = &DescribeMatchmakingRuleSetsInput{} @@ -42,7 +35,6 @@ func (c *Client) DescribeMatchmakingRuleSets(ctx context.Context, params *Descri return out, nil } -// Represents the input for a request operation. type DescribeMatchmakingRuleSetsInput struct { // The maximum number of results to return. Use this parameter with NextToken to @@ -62,7 +54,6 @@ type DescribeMatchmakingRuleSetsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeMatchmakingRuleSetsOutput struct { // A collection of requested matchmaking rule set objects. diff --git a/service/gamelift/api_op_DescribePlayerSessions.go b/service/gamelift/api_op_DescribePlayerSessions.go index 05d325db1a3..e74bdc0620a 100644 --- a/service/gamelift/api_op_DescribePlayerSessions.go +++ b/service/gamelift/api_op_DescribePlayerSessions.go @@ -28,10 +28,7 @@ import ( // player session ID, game session ID, or player ID. You can filter this request by // player session status. Use the pagination parameters to retrieve results as a // set of sequential pages. If successful, a PlayerSession object is returned for -// each session that matches the request. Available in Amazon GameLift Local. -// Related actions CreatePlayerSession | CreatePlayerSessions | -// DescribePlayerSessions | StartGameSessionPlacement | -// DescribeGameSessionPlacement | All APIs by task +// each session that matches the request. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribePlayerSessions(ctx context.Context, params *DescribePlayerSessionsInput, optFns ...func(*Options)) (*DescribePlayerSessionsOutput, error) { if params == nil { @@ -48,7 +45,6 @@ func (c *Client) DescribePlayerSessions(ctx context.Context, params *DescribePla return out, nil } -// Represents the input for a request operation. type DescribePlayerSessionsInput struct { // A unique identifier for the game session to retrieve player sessions for. @@ -71,15 +67,17 @@ type DescribePlayerSessionsInput struct { // A unique identifier for a player session to retrieve. PlayerSessionId *string - // Player session status to filter results on. Possible player session statuses - // include the following: + // Player session status to filter results on. Note that when a PlayerSessionId or + // PlayerId is provided in a DescribePlayerSessions request, then the + // PlayerSessionStatusFilter has no effect on the response. Possible player session + // statuses include the following: // - // * RESERVED -- The player session request has been - // received, but the player has not yet connected to the server process and/or been - // validated. + // * RESERVED -- The player session request has + // been received, but the player has not yet connected to the server process and/or + // been validated. // - // * ACTIVE -- The player has been validated by the server process and - // is currently connected. + // * ACTIVE -- The player has been validated by the server process + // and is currently connected. // // * COMPLETED -- The player connection has been // dropped. @@ -91,7 +89,6 @@ type DescribePlayerSessionsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribePlayerSessionsOutput struct { // A token that indicates where to resume retrieving results on the next call to diff --git a/service/gamelift/api_op_DescribeRuntimeConfiguration.go b/service/gamelift/api_op_DescribeRuntimeConfiguration.go index ea2881a1761..e8fd7bb6871 100644 --- a/service/gamelift/api_op_DescribeRuntimeConfiguration.go +++ b/service/gamelift/api_op_DescribeRuntimeConfiguration.go @@ -20,11 +20,6 @@ import ( // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html)Running // multiple processes on a fleet // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-multiprocess.html) -// Related actions ListFleets | DescribeEC2InstanceLimits | DescribeFleetAttributes -// | DescribeFleetCapacity | DescribeFleetEvents | DescribeFleetLocationAttributes -// | DescribeFleetPortSettings | DescribeFleetUtilization | -// DescribeRuntimeConfiguration | DescribeScalingPolicies | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeRuntimeConfiguration(ctx context.Context, params *DescribeRuntimeConfigurationInput, optFns ...func(*Options)) (*DescribeRuntimeConfigurationOutput, error) { if params == nil { params = &DescribeRuntimeConfigurationInput{} @@ -40,7 +35,6 @@ func (c *Client) DescribeRuntimeConfiguration(ctx context.Context, params *Descr return out, nil } -// Represents the input for a request operation. type DescribeRuntimeConfigurationInput struct { // A unique identifier for the fleet to get the runtime configuration for. You can @@ -52,7 +46,6 @@ type DescribeRuntimeConfigurationInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeRuntimeConfigurationOutput struct { // Instructions that describe how server processes should be launched and diff --git a/service/gamelift/api_op_DescribeScalingPolicies.go b/service/gamelift/api_op_DescribeScalingPolicies.go index be6f329264b..57db9f626e3 100644 --- a/service/gamelift/api_op_DescribeScalingPolicies.go +++ b/service/gamelift/api_op_DescribeScalingPolicies.go @@ -17,14 +17,8 @@ import ( // such as to retrieve only active scaling policies. Use the pagination parameters // to retrieve results as a set of sequential pages. If successful, set of // ScalingPolicy objects is returned for the fleet. A fleet may have all of its -// scaling policies suspended (StopFleetActions). This operation does not affect -// the status of the scaling policies, which remains ACTIVE. To see whether a -// fleet's scaling policies are in force or suspended, call DescribeFleetAttributes -// and check the stopped actions. Related actions DescribeFleetCapacity | -// UpdateFleetCapacity | DescribeEC2InstanceLimits | PutScalingPolicy | -// DescribeScalingPolicies | DeleteScalingPolicy | StopFleetActions | -// StartFleetActions | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// scaling policies suspended. This operation does not affect the status of the +// scaling policies, which remains ACTIVE. func (c *Client) DescribeScalingPolicies(ctx context.Context, params *DescribeScalingPoliciesInput, optFns ...func(*Options)) (*DescribeScalingPoliciesOutput, error) { if params == nil { params = &DescribeScalingPoliciesInput{} @@ -40,7 +34,6 @@ func (c *Client) DescribeScalingPolicies(ctx context.Context, params *DescribeSc return out, nil } -// Represents the input for a request operation. type DescribeScalingPoliciesInput struct { // A unique identifier for the fleet for which to retrieve scaling policies. You @@ -89,7 +82,6 @@ type DescribeScalingPoliciesInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeScalingPoliciesOutput struct { // A token that indicates where to resume retrieving results on the next call to diff --git a/service/gamelift/api_op_DescribeScript.go b/service/gamelift/api_op_DescribeScript.go index c696a0bb964..a91e5bea4fe 100644 --- a/service/gamelift/api_op_DescribeScript.go +++ b/service/gamelift/api_op_DescribeScript.go @@ -15,8 +15,7 @@ import ( // the script ID. If successful, an object containing the script properties is // returned. Learn more Amazon GameLift Realtime Servers // (https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-intro.html) -// Related actions CreateScript | ListScripts | DescribeScript | UpdateScript | -// DeleteScript | All APIs by task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeScript(ctx context.Context, params *DescribeScriptInput, optFns ...func(*Options)) (*DescribeScriptOutput, error) { if params == nil { diff --git a/service/gamelift/api_op_DescribeVpcPeeringAuthorizations.go b/service/gamelift/api_op_DescribeVpcPeeringAuthorizations.go index e1918c91534..99c3df1936b 100644 --- a/service/gamelift/api_op_DescribeVpcPeeringAuthorizations.go +++ b/service/gamelift/api_op_DescribeVpcPeeringAuthorizations.go @@ -14,10 +14,7 @@ import ( // Retrieves valid VPC peering authorizations that are pending for the Amazon Web // Services account. This operation returns all VPC peering authorizations and // requests for peering. This includes those initiated and received by this -// account. Related actions CreateVpcPeeringAuthorization | -// DescribeVpcPeeringAuthorizations | DeleteVpcPeeringAuthorization | -// CreateVpcPeeringConnection | DescribeVpcPeeringConnections | -// DeleteVpcPeeringConnection | All APIs by task +// account. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeVpcPeeringAuthorizations(ctx context.Context, params *DescribeVpcPeeringAuthorizationsInput, optFns ...func(*Options)) (*DescribeVpcPeeringAuthorizationsOutput, error) { if params == nil { diff --git a/service/gamelift/api_op_DescribeVpcPeeringConnections.go b/service/gamelift/api_op_DescribeVpcPeeringConnections.go index 0c4a9f94a49..5e2882206d9 100644 --- a/service/gamelift/api_op_DescribeVpcPeeringConnections.go +++ b/service/gamelift/api_op_DescribeVpcPeeringConnections.go @@ -18,9 +18,7 @@ import ( // the parameter empty to retrieve all connection records. If successful, the // retrieved information includes both active and pending connections. Active // connections identify the IpV4 CIDR block that the VPC uses to connect. Related -// actions CreateVpcPeeringAuthorization | DescribeVpcPeeringAuthorizations | -// DeleteVpcPeeringAuthorization | CreateVpcPeeringConnection | -// DescribeVpcPeeringConnections | DeleteVpcPeeringConnection | All APIs by task +// actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) DescribeVpcPeeringConnections(ctx context.Context, params *DescribeVpcPeeringConnectionsInput, optFns ...func(*Options)) (*DescribeVpcPeeringConnectionsOutput, error) { if params == nil { @@ -37,7 +35,6 @@ func (c *Client) DescribeVpcPeeringConnections(ctx context.Context, params *Desc return out, nil } -// Represents the input for a request operation. type DescribeVpcPeeringConnectionsInput struct { // A unique identifier for the fleet. You can use either the fleet ID or ARN value. @@ -46,7 +43,6 @@ type DescribeVpcPeeringConnectionsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type DescribeVpcPeeringConnectionsOutput struct { // A collection of VPC peering connection records that match the request. diff --git a/service/gamelift/api_op_GetComputeAccess.go b/service/gamelift/api_op_GetComputeAccess.go new file mode 100644 index 00000000000..9fcfd5e8f56 --- /dev/null +++ b/service/gamelift/api_op_GetComputeAccess.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package gamelift + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/gamelift/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Requests remote access to a fleet instance. Remote access is useful for +// debugging, gathering benchmarking data, or observing activity in real time. To +// remotely access an instance, you need credentials that match the operating +// system of the instance. For a Windows instance, GameLift returns a user name and +// password as strings for use with a Windows Remote Desktop client. For a Linux +// instance, GameLift returns a user name and RSA private key, also as strings, for +// use with an SSH client. The private key must be saved in the proper format to a +// .pem file before using. If you're making this request using the CLI, saving the +// secret can be handled as part of the GetInstanceAccess request, as shown in one +// of the examples for this operation. To request access to a specific instance, +// specify the IDs of both the instance and the fleet it belongs to. Learn more +// Remotely Access Fleet Instances +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-remote-access.html)Debug +// Fleet Issues +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html) +func (c *Client) GetComputeAccess(ctx context.Context, params *GetComputeAccessInput, optFns ...func(*Options)) (*GetComputeAccessOutput, error) { + if params == nil { + params = &GetComputeAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetComputeAccess", params, optFns, c.addOperationGetComputeAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetComputeAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetComputeAccessInput struct { + + // The name of the compute resource you are requesting credentials for. + // + // This member is required. + ComputeName *string + + // A unique identifier for the fleet that the compute resource is registered to. + // + // This member is required. + FleetId *string + + noSmithyDocumentSerde +} + +type GetComputeAccessOutput struct { + + // The Amazon Resource Name (ARN + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) that is + // assigned to a GameLift compute resource and uniquely identifies it. ARNs are + // unique across all Regions. Format is + // arn:aws:gamelift:::compute/compute-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912. + ComputeArn *string + + // The name of the compute resource you requested credentials for. + ComputeName *string + + // The access credentials for the compute resource. + Credentials *types.AwsCredentials + + // The Amazon Resource Name (ARN + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) that is + // assigned to a GameLift fleet resource and uniquely identifies it. ARNs are + // unique across all Regions. Format is + // arn:aws:gamelift:::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912. + FleetArn *string + + // The fleet ID of compute resource. + FleetId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetComputeAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetComputeAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetComputeAccess{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetComputeAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetComputeAccess(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetComputeAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "gamelift", + OperationName: "GetComputeAccess", + } +} diff --git a/service/gamelift/api_op_GetComputeAuthToken.go b/service/gamelift/api_op_GetComputeAuthToken.go new file mode 100644 index 00000000000..88b17bc7bba --- /dev/null +++ b/service/gamelift/api_op_GetComputeAuthToken.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package gamelift + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Requests an authorization token from GameLift. The authorization token is used +// by your game server to authenticate with GameLift. Each authentication token has +// an expiration token. To continue using the compute resource to host your game +// server, regularly retrieve a new authorization token. +func (c *Client) GetComputeAuthToken(ctx context.Context, params *GetComputeAuthTokenInput, optFns ...func(*Options)) (*GetComputeAuthTokenOutput, error) { + if params == nil { + params = &GetComputeAuthTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetComputeAuthToken", params, optFns, c.addOperationGetComputeAuthTokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetComputeAuthTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetComputeAuthTokenInput struct { + + // The name of the compute resource you are requesting the authorization token for. + // + // This member is required. + ComputeName *string + + // A unique identifier for the fleet that the compute is registered to. + // + // This member is required. + FleetId *string + + noSmithyDocumentSerde +} + +type GetComputeAuthTokenOutput struct { + + // The authorization token that your game server uses to authenticate with + // GameLift. + AuthToken *string + + // The Amazon Resource Name (ARN + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) that is + // assigned to a GameLift compute resource and uniquely identifies it. ARNs are + // unique across all Regions. Format is + // arn:aws:gamelift:::compute/compute-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912 + ComputeArn *string + + // The name of the compute resource you are requesting the authorization token for. + ComputeName *string + + // The amount of time until the authorization token is no longer valid. To continue + // using the compute resource for game server hosting, renew the authorization + // token by using this operation again. + ExpirationTimestamp *time.Time + + // The Amazon Resource Name (ARN + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) that is + // assigned to a GameLift fleet resource and uniquely identifies it. ARNs are + // unique across all Regions. Format is + // arn:aws:gamelift:::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912. + FleetArn *string + + // A unique identifier for the fleet that the compute is registered to. + FleetId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetComputeAuthTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetComputeAuthToken{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetComputeAuthToken{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetComputeAuthTokenValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetComputeAuthToken(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetComputeAuthToken(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "gamelift", + OperationName: "GetComputeAuthToken", + } +} diff --git a/service/gamelift/api_op_GetGameSessionLogUrl.go b/service/gamelift/api_op_GetGameSessionLogUrl.go index 34749fcadad..05fbc1c4240 100644 --- a/service/gamelift/api_op_GetGameSessionLogUrl.go +++ b/service/gamelift/api_op_GetGameSessionLogUrl.go @@ -16,10 +16,7 @@ import ( // the Amazon Web Services Service Limits // (https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_gamelift) // page for maximum log file sizes. Log files that exceed this limit are not saved. -// Related actions CreateGameSession | DescribeGameSessions | -// DescribeGameSessionDetails | SearchGameSessions | UpdateGameSession | -// GetGameSessionLogUrl | StartGameSessionPlacement | DescribeGameSessionPlacement -// | StopGameSessionPlacement | All APIs by task +// All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) GetGameSessionLogUrl(ctx context.Context, params *GetGameSessionLogUrlInput, optFns ...func(*Options)) (*GetGameSessionLogUrlOutput, error) { if params == nil { @@ -36,7 +33,6 @@ func (c *Client) GetGameSessionLogUrl(ctx context.Context, params *GetGameSessio return out, nil } -// Represents the input for a request operation. type GetGameSessionLogUrlInput struct { // A unique identifier for the game session to get logs for. @@ -47,7 +43,6 @@ type GetGameSessionLogUrlInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type GetGameSessionLogUrlOutput struct { // Location of the requested game session logs, available for download. This URL is diff --git a/service/gamelift/api_op_GetInstanceAccess.go b/service/gamelift/api_op_GetInstanceAccess.go index 26aac359118..922470837ea 100644 --- a/service/gamelift/api_op_GetInstanceAccess.go +++ b/service/gamelift/api_op_GetInstanceAccess.go @@ -22,14 +22,13 @@ import ( // secret can be handled as part of the GetInstanceAccess request, as shown in one // of the examples for this operation. To request access to a specific instance, // specify the IDs of both the instance and the fleet it belongs to. You can -// retrieve a fleet's instance IDs by calling DescribeInstances. If successful, an -// InstanceAccess object is returned that contains the instance's IP address and a -// set of credentials. Learn more Remotely Access Fleet Instances +// retrieve a fleet's instance IDs by calling DescribeInstances +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeInstances.html). +// Learn more Remotely Access Fleet Instances // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-remote-access.html)Debug // Fleet Issues // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html) -// Related actions DescribeInstances | GetInstanceAccess | -// DescribeEC2InstanceLimits | All APIs by task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) GetInstanceAccess(ctx context.Context, params *GetInstanceAccessInput, optFns ...func(*Options)) (*GetInstanceAccessOutput, error) { if params == nil { @@ -46,7 +45,6 @@ func (c *Client) GetInstanceAccess(ctx context.Context, params *GetInstanceAcces return out, nil } -// Represents the input for a request operation. type GetInstanceAccessInput struct { // A unique identifier for the fleet that contains the instance you want access to. @@ -66,7 +64,6 @@ type GetInstanceAccessInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type GetInstanceAccessOutput struct { // The connection information for a fleet instance, including IP address and access diff --git a/service/gamelift/api_op_ListAliases.go b/service/gamelift/api_op_ListAliases.go index 598c369a7cb..6750cd2d682 100644 --- a/service/gamelift/api_op_ListAliases.go +++ b/service/gamelift/api_op_ListAliases.go @@ -15,8 +15,7 @@ import ( // Retrieves all aliases for this Amazon Web Services account. You can filter the // result set by alias name and/or routing strategy type. Use the pagination // parameters to retrieve results in sequential pages. Returned aliases are not -// listed in any particular order. Related actions CreateAlias | ListAliases | -// DescribeAlias | UpdateAlias | DeleteAlias | ResolveAlias | All APIs by task +// listed in any particular order. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) ListAliases(ctx context.Context, params *ListAliasesInput, optFns ...func(*Options)) (*ListAliasesOutput, error) { if params == nil { @@ -33,7 +32,6 @@ func (c *Client) ListAliases(ctx context.Context, params *ListAliasesInput, optF return out, nil } -// Represents the input for a request operation. type ListAliasesInput struct { // The maximum number of results to return. Use this parameter with NextToken to @@ -59,13 +57,14 @@ type ListAliasesInput struct { // // * TERMINAL -- The alias does not resolve to a fleet but instead can be // used to display a message to the user. A terminal alias throws a - // TerminalRoutingStrategyException with the RoutingStrategy message embedded. + // TerminalRoutingStrategyException with the RoutingStrategy + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_RoutingStrategy.html) + // message embedded. RoutingStrategyType types.RoutingStrategyType noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type ListAliasesOutput struct { // A collection of alias resources that match the request parameters. diff --git a/service/gamelift/api_op_ListBuilds.go b/service/gamelift/api_op_ListBuilds.go index a2f38312e75..4f2406476b0 100644 --- a/service/gamelift/api_op_ListBuilds.go +++ b/service/gamelift/api_op_ListBuilds.go @@ -17,9 +17,8 @@ import ( // using the Status parameter. Use the pagination parameters to retrieve results in // a set of sequential pages. Build resources are not listed in any particular // order. Learn more Upload a Custom Server Build -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html) -// Related actions CreateBuild | ListBuilds | DescribeBuild | UpdateBuild | -// DeleteBuild | All APIs by task +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html)All +// APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) ListBuilds(ctx context.Context, params *ListBuildsInput, optFns ...func(*Options)) (*ListBuildsOutput, error) { if params == nil { @@ -36,7 +35,6 @@ func (c *Client) ListBuilds(ctx context.Context, params *ListBuildsInput, optFns return out, nil } -// Represents the input for a request operation. type ListBuildsInput struct { // The maximum number of results to return. Use this parameter with NextToken to @@ -66,7 +64,6 @@ type ListBuildsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type ListBuildsOutput struct { // A collection of build resources that match the request. diff --git a/service/gamelift/api_op_ListCompute.go b/service/gamelift/api_op_ListCompute.go new file mode 100644 index 00000000000..886eda52181 --- /dev/null +++ b/service/gamelift/api_op_ListCompute.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package gamelift + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/gamelift/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves all compute resources registered to a fleet in your Amazon Web +// Services account. You can filter the result set by location. +func (c *Client) ListCompute(ctx context.Context, params *ListComputeInput, optFns ...func(*Options)) (*ListComputeOutput, error) { + if params == nil { + params = &ListComputeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCompute", params, optFns, c.addOperationListComputeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListComputeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListComputeInput struct { + + // A unique identifier for the fleet the compute resources are registered to. + // + // This member is required. + FleetId *string + + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // The name of the custom location that the compute resources are assigned to. + Location *string + + // A token that indicates the start of the next sequential page of results. Use the + // token that is returned with a previous call to this operation. To start at the + // beginning of the result set, do not specify a value. + NextToken *string + + noSmithyDocumentSerde +} + +type ListComputeOutput struct { + + // A list of compute resources registered to the fleet you specified. + ComputeList []types.Compute + + // A token that indicates where to resume retrieving results on the next call to + // this operation. If no token is returned, these results represent the end of the + // list. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListComputeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCompute{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCompute{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListComputeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCompute(options.Region), middleware.Before); 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 + } + return nil +} + +// ListComputeAPIClient is a client that implements the ListCompute operation. +type ListComputeAPIClient interface { + ListCompute(context.Context, *ListComputeInput, ...func(*Options)) (*ListComputeOutput, error) +} + +var _ ListComputeAPIClient = (*Client)(nil) + +// ListComputePaginatorOptions is the paginator options for ListCompute +type ListComputePaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// ListComputePaginator is a paginator for ListCompute +type ListComputePaginator struct { + options ListComputePaginatorOptions + client ListComputeAPIClient + params *ListComputeInput + nextToken *string + firstPage bool +} + +// NewListComputePaginator returns a new ListComputePaginator +func NewListComputePaginator(client ListComputeAPIClient, params *ListComputeInput, optFns ...func(*ListComputePaginatorOptions)) *ListComputePaginator { + if params == nil { + params = &ListComputeInput{} + } + + options := ListComputePaginatorOptions{} + if params.Limit != nil { + options.Limit = *params.Limit + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListComputePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComputePaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCompute page. +func (p *ListComputePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComputeOutput, 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.Limit = limit + + result, err := p.client.ListCompute(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 +} + +func newServiceMetadataMiddleware_opListCompute(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "gamelift", + OperationName: "ListCompute", + } +} diff --git a/service/gamelift/api_op_ListFleets.go b/service/gamelift/api_op_ListFleets.go index 0a5cf8bc914..a4eccd0a374 100644 --- a/service/gamelift/api_op_ListFleets.go +++ b/service/gamelift/api_op_ListFleets.go @@ -37,11 +37,6 @@ import ( // returned if there are more result pages to retrieve. Fleet resources are not // listed in a particular order. Learn more Setting up GameLift fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleet | UpdateFleetCapacity | PutScalingPolicy | -// DescribeEC2InstanceLimits | DescribeFleetAttributes | -// DescribeFleetLocationAttributes | UpdateFleetAttributes | StopFleetActions | -// DeleteFleet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) ListFleets(ctx context.Context, params *ListFleetsInput, optFns ...func(*Options)) (*ListFleetsOutput, error) { if params == nil { params = &ListFleetsInput{} @@ -57,7 +52,6 @@ func (c *Client) ListFleets(ctx context.Context, params *ListFleetsInput, optFns return out, nil } -// Represents the input for a request operation. type ListFleetsInput struct { // A unique identifier for the build to request fleets for. Use this parameter to @@ -82,13 +76,9 @@ type ListFleetsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type ListFleetsOutput struct { - // A set of fleet IDs that match the list request. You can retrieve additional - // information about all returned fleets by passing this result set to a - // DescribeFleetAttributes, DescribeFleetCapacity, or DescribeFleetUtilization - // call. + // A set of fleet IDs that match the list request. FleetIds []string // A token that indicates where to resume retrieving results on the next call to diff --git a/service/gamelift/api_op_ListGameServerGroups.go b/service/gamelift/api_op_ListGameServerGroups.go index c2bf4cb14ec..a04de13391e 100644 --- a/service/gamelift/api_op_ListGameServerGroups.go +++ b/service/gamelift/api_op_ListGameServerGroups.go @@ -12,17 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is used with the GameLift FleetIQ solution and game server -// groups. Retrieves information on all game servers groups that exist in the -// current Amazon Web Services account for the selected Region. Use the pagination -// parameters to retrieve results in a set of sequential segments. Learn more -// GameLift FleetIQ Guide -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions CreateGameServerGroup | ListGameServerGroups | -// DescribeGameServerGroup | UpdateGameServerGroup | DeleteGameServerGroup | -// ResumeGameServerGroup | SuspendGameServerGroup | DescribeGameServerInstances | -// All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) +// Lists a game server groups. func (c *Client) ListGameServerGroups(ctx context.Context, params *ListGameServerGroupsInput, optFns ...func(*Options)) (*ListGameServerGroupsOutput, error) { if params == nil { params = &ListGameServerGroupsInput{} @@ -40,13 +30,11 @@ func (c *Client) ListGameServerGroups(ctx context.Context, params *ListGameServe type ListGameServerGroupsInput struct { - // The maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The game server groups' limit. Limit *int32 - // A token that indicates the start of the next sequential page of results. Use the - // token that is returned with a previous call to this operation. To start at the - // beginning of the result set, do not specify a value. + // Specify the pagination token from a previous request to retrieve the next page + // of results. NextToken *string noSmithyDocumentSerde @@ -54,12 +42,11 @@ type ListGameServerGroupsInput struct { type ListGameServerGroupsOutput struct { - // A collection of game server group objects that match the request. + // The game server groups' game server groups. GameServerGroups []types.GameServerGroup - // A token that indicates where to resume retrieving results on the next call to - // this operation. If no token is returned, these results represent the end of the - // list. + // Specify the pagination token from a previous request to retrieve the next page + // of results. NextToken *string // Metadata pertaining to the operation's result. @@ -139,8 +126,7 @@ var _ ListGameServerGroupsAPIClient = (*Client)(nil) // ListGameServerGroupsPaginatorOptions is the paginator options for // ListGameServerGroups type ListGameServerGroupsPaginatorOptions struct { - // The maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The game server groups' limit. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/gamelift/api_op_ListGameServers.go b/service/gamelift/api_op_ListGameServers.go index 5a8dfdac4d2..8490d411f4a 100644 --- a/service/gamelift/api_op_ListGameServers.go +++ b/service/gamelift/api_op_ListGameServers.go @@ -18,9 +18,6 @@ import ( // Use the pagination parameters to retrieve results in a set of sequential // segments. Learn more GameLift FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions RegisterGameServer | ListGameServers | ClaimGameServer | -// DescribeGameServer | UpdateGameServer | DeregisterGameServer | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) ListGameServers(ctx context.Context, params *ListGameServersInput, optFns ...func(*Options)) (*ListGameServersOutput, error) { if params == nil { params = &ListGameServersInput{} @@ -39,7 +36,7 @@ func (c *Client) ListGameServers(ctx context.Context, params *ListGameServersInp type ListGameServersInput struct { // An identifier for the game server group to retrieve a list of game servers from. - // Use either the GameServerGroup name or ARN value. + // Use either the name or ARN value. // // This member is required. GameServerGroupName *string diff --git a/service/gamelift/api_op_ListLocations.go b/service/gamelift/api_op_ListLocations.go new file mode 100644 index 00000000000..264b5a025fc --- /dev/null +++ b/service/gamelift/api_op_ListLocations.go @@ -0,0 +1,221 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package gamelift + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/gamelift/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all custom and Amazon Web Services locations. +func (c *Client) ListLocations(ctx context.Context, params *ListLocationsInput, optFns ...func(*Options)) (*ListLocationsOutput, error) { + if params == nil { + params = &ListLocationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListLocations", params, optFns, c.addOperationListLocationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListLocationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListLocationsInput struct { + + // Filters the list for AWS or CUSTOM locations. + Filters []types.LocationFilter + + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // A token that indicates the start of the next sequential page of results. Use the + // token that is returned with a previous call to this operation. To start at the + // beginning of the result set, do not specify a value. + NextToken *string + + noSmithyDocumentSerde +} + +type ListLocationsOutput struct { + + // A collection of locations. + Locations []types.LocationModel + + // A token that indicates where to resume retrieving results on the next call to + // this operation. If no token is returned, these results represent the end of the + // list. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListLocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLocations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLocations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLocations(options.Region), middleware.Before); 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 + } + return nil +} + +// ListLocationsAPIClient is a client that implements the ListLocations operation. +type ListLocationsAPIClient interface { + ListLocations(context.Context, *ListLocationsInput, ...func(*Options)) (*ListLocationsOutput, error) +} + +var _ ListLocationsAPIClient = (*Client)(nil) + +// ListLocationsPaginatorOptions is the paginator options for ListLocations +type ListLocationsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// ListLocationsPaginator is a paginator for ListLocations +type ListLocationsPaginator struct { + options ListLocationsPaginatorOptions + client ListLocationsAPIClient + params *ListLocationsInput + nextToken *string + firstPage bool +} + +// NewListLocationsPaginator returns a new ListLocationsPaginator +func NewListLocationsPaginator(client ListLocationsAPIClient, params *ListLocationsInput, optFns ...func(*ListLocationsPaginatorOptions)) *ListLocationsPaginator { + if params == nil { + params = &ListLocationsInput{} + } + + options := ListLocationsPaginatorOptions{} + if params.Limit != nil { + options.Limit = *params.Limit + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListLocationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLocationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListLocations page. +func (p *ListLocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLocationsOutput, 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.Limit = limit + + result, err := p.client.ListLocations(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 +} + +func newServiceMetadataMiddleware_opListLocations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "gamelift", + OperationName: "ListLocations", + } +} diff --git a/service/gamelift/api_op_ListScripts.go b/service/gamelift/api_op_ListScripts.go index f07491aef6a..fd3c5dcc73d 100644 --- a/service/gamelift/api_op_ListScripts.go +++ b/service/gamelift/api_op_ListScripts.go @@ -15,8 +15,7 @@ import ( // Retrieves script records for all Realtime scripts that are associated with the // Amazon Web Services account in use. Learn more Amazon GameLift Realtime Servers // (https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-intro.html) -// Related actions CreateScript | ListScripts | DescribeScript | UpdateScript | -// DeleteScript | All APIs by task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) ListScripts(ctx context.Context, params *ListScriptsInput, optFns ...func(*Options)) (*ListScriptsOutput, error) { if params == nil { diff --git a/service/gamelift/api_op_ListTagsForResource.go b/service/gamelift/api_op_ListTagsForResource.go index dbe4f45ad41..b7b507e2460 100644 --- a/service/gamelift/api_op_ListTagsForResource.go +++ b/service/gamelift/api_op_ListTagsForResource.go @@ -37,8 +37,7 @@ import ( // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon // Web Services General Reference Amazon Web Services Tagging Strategies // (http://aws.amazon.com/answers/account-management/aws-tagging-strategies/) -// Related actions TagResource | UntagResource | ListTagsForResource | All APIs by -// task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { diff --git a/service/gamelift/api_op_PutScalingPolicy.go b/service/gamelift/api_op_PutScalingPolicy.go index 311cff4494d..3b1df2521c7 100644 --- a/service/gamelift/api_op_PutScalingPolicy.go +++ b/service/gamelift/api_op_PutScalingPolicy.go @@ -22,12 +22,8 @@ import ( // policies of each type in force at the same time; you can have one target-based // policy, one or multiple rule-based scaling policies, or both. We recommend // caution, however, because multiple auto-scaling policies can have unintended -// consequences. You can temporarily suspend all scaling policies for a fleet by -// calling StopFleetActions with the fleet action AUTO_SCALING. To resume scaling -// policies, call StartFleetActions with the same fleet action. To stop just one -// scaling policy--or to permanently remove it, you must delete the policy with -// DeleteScalingPolicy. Learn more about how to work with auto-scaling in Set Up -// Fleet Automatic Scaling +// consequences. Learn more about how to work with auto-scaling in Set Up Fleet +// Automatic Scaling // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-autoscaling.html). // Target-based policy A target-based policy tracks a single metric: // PercentAvailableGameSessions. This metric tells us how much of a fleet's hosting @@ -65,10 +61,7 @@ import ( // policy name is returned. Scaling policies are automatically in force as soon as // they're successfully created. If the fleet's auto-scaling actions are // temporarily suspended, the new policy will be in force once the fleet actions -// are restarted. Related actions DescribeFleetCapacity | UpdateFleetCapacity | -// DescribeEC2InstanceLimits | PutScalingPolicy | DescribeScalingPolicies | -// DeleteScalingPolicy | StopFleetActions | StartFleetActions | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// are restarted. func (c *Client) PutScalingPolicy(ctx context.Context, params *PutScalingPolicyInput, optFns ...func(*Options)) (*PutScalingPolicyOutput, error) { if params == nil { params = &PutScalingPolicyInput{} @@ -84,7 +77,6 @@ func (c *Client) PutScalingPolicy(ctx context.Context, params *PutScalingPolicyI return out, nil } -// Represents the input for a request operation. type PutScalingPolicyInput struct { // A unique identifier for the fleet to apply this policy to. You can use either @@ -167,20 +159,20 @@ type PutScalingPolicyInput struct { // Amount of adjustment to make, based on the scaling adjustment type. ScalingAdjustment int32 - // The type of adjustment to make to a fleet's instance count (see - // FleetCapacity): + // The type of adjustment to make to a fleet's instance count: // - // * ChangeInCapacity -- add (or subtract) the scaling adjustment - // value from the current instance count. Positive values scale up while negative - // values scale down. + // * ChangeInCapacity + // -- add (or subtract) the scaling adjustment value from the current instance + // count. Positive values scale up while negative values scale down. // - // * ExactCapacity -- set the instance count to the scaling - // adjustment value. + // * + // ExactCapacity -- set the instance count to the scaling adjustment value. // - // * PercentChangeInCapacity -- increase or reduce the current - // instance count by the scaling adjustment, read as a percentage. Positive values - // scale up while negative values scale down; for example, a value of "-10" scales - // the fleet down by 10%. + // * + // PercentChangeInCapacity -- increase or reduce the current instance count by the + // scaling adjustment, read as a percentage. Positive values scale up while + // negative values scale down; for example, a value of "-10" scales the fleet down + // by 10%. ScalingAdjustmentType types.ScalingAdjustmentType // An object that contains settings for a target-based scaling policy. @@ -192,7 +184,6 @@ type PutScalingPolicyInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type PutScalingPolicyOutput struct { // A descriptive label that is associated with a fleet's scaling policy. Policy diff --git a/service/gamelift/api_op_RegisterCompute.go b/service/gamelift/api_op_RegisterCompute.go new file mode 100644 index 00000000000..699d85b1a27 --- /dev/null +++ b/service/gamelift/api_op_RegisterCompute.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package gamelift + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/gamelift/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Registers your compute resources in a fleet you previously created. After you +// register a compute to your fleet, you can monitor and manage your compute using +// GameLift. The operation returns the compute resource containing SDK endpoint you +// can use to connect your game server to GameLift. Learn more +// +// * Create an +// Anywhere fleet +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-anywhere.html) +// +// * +// Test your integration +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-testing.html) +func (c *Client) RegisterCompute(ctx context.Context, params *RegisterComputeInput, optFns ...func(*Options)) (*RegisterComputeOutput, error) { + if params == nil { + params = &RegisterComputeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RegisterCompute", params, optFns, c.addOperationRegisterComputeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RegisterComputeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RegisterComputeInput struct { + + // A descriptive label that is associated with the compute resource registered to + // your fleet. + // + // This member is required. + ComputeName *string + + // A unique identifier for the fleet to register the compute to. You can use either + // the fleet ID or ARN value. + // + // This member is required. + FleetId *string + + // The path to the TLS certificate on your compute resource. The path and + // certificate are not validated by GameLift. + CertificatePath *string + + // The DNS name of the compute resource. GameLift requires the DNS name or IP + // address to manage your compute resource. + DnsName *string + + // The IP address of the compute resource. GameLift requires the DNS name or IP + // address to manage your compute resource. + IpAddress *string + + // The name of the custom location you added to the fleet you are registering this + // compute resource to. + Location *string + + noSmithyDocumentSerde +} + +type RegisterComputeOutput struct { + + // The details of the compute resource you registered to the specified fleet. + Compute *types.Compute + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRegisterComputeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterCompute{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRegisterCompute{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpRegisterComputeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterCompute(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opRegisterCompute(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "gamelift", + OperationName: "RegisterCompute", + } +} diff --git a/service/gamelift/api_op_RegisterGameServer.go b/service/gamelift/api_op_RegisterGameServer.go index 8a59a5e57bd..6f53e64d064 100644 --- a/service/gamelift/api_op_RegisterGameServer.go +++ b/service/gamelift/api_op_RegisterGameServer.go @@ -19,16 +19,12 @@ import ( // servers and enables game clients and services to claim a game server for a new // game session. To register a game server, identify the game server group and // instance where the game server is running, and provide a unique identifier for -// the game server. You can also include connection and game server data. When a -// game client or service requests a game server by calling ClaimGameServer, this -// information is returned in the response. Once a game server is successfully -// registered, it is put in status AVAILABLE. A request to register a game server -// may fail if the instance it is running on is in the process of shutting down as -// part of instance balancing or scale-down activity. Learn more GameLift FleetIQ -// Guide (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions RegisterGameServer | ListGameServers | ClaimGameServer | -// DescribeGameServer | UpdateGameServer | DeregisterGameServer | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) +// the game server. You can also include connection and game server data. Once a +// game server is successfully registered, it is put in status AVAILABLE. A request +// to register a game server may fail if the instance it is running on is in the +// process of shutting down as part of instance balancing or scale-down activity. +// Learn more GameLift FleetIQ Guide +// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) func (c *Client) RegisterGameServer(ctx context.Context, params *RegisterGameServerInput, optFns ...func(*Options)) (*RegisterGameServerOutput, error) { if params == nil { params = &RegisterGameServerInput{} @@ -47,7 +43,6 @@ func (c *Client) RegisterGameServer(ctx context.Context, params *RegisterGameSer type RegisterGameServerInput struct { // A unique identifier for the game server group where the game server is running. - // Use either the GameServerGroup name or ARN value. // // This member is required. GameServerGroupName *string @@ -73,7 +68,7 @@ type RegisterGameServerInput struct { // A set of custom game server properties, formatted as a single string value. This // data is passed to a game client or service when it requests information on game - // servers using ListGameServers or ClaimGameServer. + // servers. GameServerData *string noSmithyDocumentSerde diff --git a/service/gamelift/api_op_RequestUploadCredentials.go b/service/gamelift/api_op_RequestUploadCredentials.go index 12cb7a87a17..78c2c5092d3 100644 --- a/service/gamelift/api_op_RequestUploadCredentials.go +++ b/service/gamelift/api_op_RequestUploadCredentials.go @@ -13,13 +13,14 @@ import ( // Retrieves a fresh set of credentials for use when uploading a new set of game // build files to Amazon GameLift's Amazon S3. This is done as part of the build -// creation process; see CreateBuild. To request new credentials, specify the build -// ID as returned with an initial CreateBuild request. If successful, a new set of -// credentials are returned, along with the S3 storage location associated with the -// build ID. Learn more Create a Build with Files in S3 -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html#gamelift-build-cli-uploading-create-build) -// Related actions CreateBuild | ListBuilds | DescribeBuild | UpdateBuild | -// DeleteBuild | All APIs by task +// creation process; see GameSession +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateBuild.html). +// To request new credentials, specify the build ID as returned with an initial +// CreateBuild request. If successful, a new set of credentials are returned, along +// with the S3 storage location associated with the build ID. Learn more Create a +// Build with Files in S3 +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html#gamelift-build-cli-uploading-create-build)All +// APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) RequestUploadCredentials(ctx context.Context, params *RequestUploadCredentialsInput, optFns ...func(*Options)) (*RequestUploadCredentialsOutput, error) { if params == nil { @@ -36,7 +37,6 @@ func (c *Client) RequestUploadCredentials(ctx context.Context, params *RequestUp return out, nil } -// Represents the input for a request operation. type RequestUploadCredentialsInput struct { // A unique identifier for the build to get credentials for. You can use either the @@ -48,7 +48,6 @@ type RequestUploadCredentialsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type RequestUploadCredentialsOutput struct { // Amazon S3 path and key, identifying where the game build files are stored. diff --git a/service/gamelift/api_op_ResolveAlias.go b/service/gamelift/api_op_ResolveAlias.go index 69321a986cf..2e6fa9f7244 100644 --- a/service/gamelift/api_op_ResolveAlias.go +++ b/service/gamelift/api_op_ResolveAlias.go @@ -11,8 +11,7 @@ import ( ) // Retrieves the fleet ID that an alias is currently pointing to. Related actions -// CreateAlias | ListAliases | DescribeAlias | UpdateAlias | DeleteAlias | -// ResolveAlias | All APIs by task +// All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) ResolveAlias(ctx context.Context, params *ResolveAliasInput, optFns ...func(*Options)) (*ResolveAliasOutput, error) { if params == nil { @@ -29,7 +28,6 @@ func (c *Client) ResolveAlias(ctx context.Context, params *ResolveAliasInput, op return out, nil } -// Represents the input for a request operation. type ResolveAliasInput struct { // The unique identifier of the alias that you want to retrieve a fleet ID for. You @@ -41,7 +39,6 @@ type ResolveAliasInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type ResolveAliasOutput struct { // The Amazon Resource Name (ARN diff --git a/service/gamelift/api_op_ResumeGameServerGroup.go b/service/gamelift/api_op_ResumeGameServerGroup.go index 64622686b98..0b0442eb76a 100644 --- a/service/gamelift/api_op_ResumeGameServerGroup.go +++ b/service/gamelift/api_op_ResumeGameServerGroup.go @@ -13,7 +13,7 @@ import ( // This operation is used with the GameLift FleetIQ solution and game server // groups. Reinstates activity on a game server group after it has been suspended. -// A game server group might be suspended by theSuspendGameServerGroup operation, +// A game server group might be suspended by the SuspendGameServerGroup operation, // or it might be suspended involuntarily due to a configuration problem. In the // second case, you can manually resume activity on the group once the // configuration problem has been resolved. Refer to the game server group status @@ -23,11 +23,6 @@ import ( // resumed activity is no longer listed in SuspendedActions. Learn more GameLift // FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions CreateGameServerGroup | ListGameServerGroups | -// DescribeGameServerGroup | UpdateGameServerGroup | DeleteGameServerGroup | -// ResumeGameServerGroup | SuspendGameServerGroup | DescribeGameServerInstances | -// All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) ResumeGameServerGroup(ctx context.Context, params *ResumeGameServerGroupInput, optFns ...func(*Options)) (*ResumeGameServerGroupOutput, error) { if params == nil { params = &ResumeGameServerGroupInput{} @@ -45,8 +40,7 @@ func (c *Client) ResumeGameServerGroup(ctx context.Context, params *ResumeGameSe type ResumeGameServerGroupInput struct { - // A unique identifier for the game server group. Use either the GameServerGroup - // name or ARN value. + // A unique identifier for the game server group. Use either the name or ARN value. // // This member is required. GameServerGroupName *string diff --git a/service/gamelift/api_op_SearchGameSessions.go b/service/gamelift/api_op_SearchGameSessions.go index f74ba09c512..df2f7f5fb10 100644 --- a/service/gamelift/api_op_SearchGameSessions.go +++ b/service/gamelift/api_op_SearchGameSessions.go @@ -38,51 +38,46 @@ import ( // retrieve results as a set of sequential pages. If successful, a GameSession // object is returned for each game session that matches the request. Search finds // game sessions that are in ACTIVE status only. To retrieve information on game -// sessions in other statuses, use DescribeGameSessions. You can search or sort by -// the following game session attributes: +// sessions in other statuses, use DescribeGameSessions +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessions.html) +// . You can search or sort by the following game session attributes: // -// * gameSessionId -- A unique identifier -// for the game session. You can use either a GameSessionId or GameSessionArn -// value. +// * +// gameSessionId -- A unique identifier for the game session. You can use either a +// GameSessionId or GameSessionArn value. // -// * gameSessionName -- Name assigned to a game session. This value is set -// when requesting a new game session with CreateGameSession or updating with -// UpdateGameSession. Game session names do not need to be unique to a game -// session. +// * gameSessionName -- Name assigned to a +// game session. Game session names do not need to be unique to a game session. // -// * gameSessionProperties -- Custom data defined in a game session's -// GameProperty parameter. GameProperty values are stored as key:value pairs; the -// filter expression must indicate the key and a string to search the data values -// for. For example, to search for game sessions with custom data containing the -// key:value pair "gameMode:brawl", specify the following: -// gameSessionProperties.gameMode = "brawl". All custom data values are searched as -// strings. +// * +// gameSessionProperties -- Custom data defined in a game session's GameProperty +// parameter. GameProperty values are stored as key:value pairs; the filter +// expression must indicate the key and a string to search the data values for. For +// example, to search for game sessions with custom data containing the key:value +// pair "gameMode:brawl", specify the following: gameSessionProperties.gameMode = +// "brawl". All custom data values are searched as strings. // -// * maximumSessions -- Maximum number of player sessions allowed for a -// game session. This value is set when requesting a new game session with -// CreateGameSession or updating with UpdateGameSession. +// * maximumSessions -- +// Maximum number of player sessions allowed for a game session. // -// * creationTimeMillis -- -// Value indicating when a game session was created. It is expressed in Unix time -// as milliseconds. +// * +// creationTimeMillis -- Value indicating when a game session was created. It is +// expressed in Unix time as milliseconds. // -// * playerSessionCount -- Number of players currently connected -// to a game session. This value changes rapidly as players join the session or -// drop out. +// * playerSessionCount -- Number of +// players currently connected to a game session. This value changes rapidly as +// players join the session or drop out. // -// * hasAvailablePlayerSessions -- Boolean value indicating whether a -// game session has reached its maximum number of players. It is highly recommended -// that all search requests include this filter attribute to optimize search -// performance and return only sessions that players can join. +// * hasAvailablePlayerSessions -- Boolean +// value indicating whether a game session has reached its maximum number of +// players. It is highly recommended that all search requests include this filter +// attribute to optimize search performance and return only sessions that players +// can join. // -// Returned values for -// playerSessionCount and hasAvailablePlayerSessions change quickly as players join -// sessions and others drop out. Results should be considered a snapshot in time. -// Be sure to refresh search results often, and handle sessions that fill up before -// a player can join. Related actions CreateGameSession | DescribeGameSessions | -// DescribeGameSessionDetails | SearchGameSessions | UpdateGameSession | -// GetGameSessionLogUrl | StartGameSessionPlacement | DescribeGameSessionPlacement -// | StopGameSessionPlacement | All APIs by task +// Returned values for playerSessionCount and hasAvailablePlayerSessions +// change quickly as players join sessions and others drop out. Results should be +// considered a snapshot in time. Be sure to refresh search results often, and +// handle sessions that fill up before a player can join. All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) SearchGameSessions(ctx context.Context, params *SearchGameSessionsInput, optFns ...func(*Options)) (*SearchGameSessionsOutput, error) { if params == nil { @@ -99,7 +94,6 @@ func (c *Client) SearchGameSessions(ctx context.Context, params *SearchGameSessi return out, nil } -// Represents the input for a request operation. type SearchGameSessionsInput struct { // A unique identifier for the alias associated with the fleet to search for active @@ -189,7 +183,6 @@ type SearchGameSessionsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type SearchGameSessionsOutput struct { // A collection of objects containing game session properties for each session that diff --git a/service/gamelift/api_op_StartFleetActions.go b/service/gamelift/api_op_StartFleetActions.go index 0493b28ba7c..9aef1857e5f 100644 --- a/service/gamelift/api_op_StartFleetActions.go +++ b/service/gamelift/api_op_StartFleetActions.go @@ -12,29 +12,25 @@ import ( ) // Resumes certain types of activity on fleet instances that were suspended with -// StopFleetActions. For multi-location fleets, fleet actions are managed -// separately for each location. Currently, this operation is used to restart a -// fleet's auto-scaling activity. This operation can be used in the following -// ways: +// StopFleetActions +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_StopFleetActions.html). +// For multi-location fleets, fleet actions are managed separately for each +// location. Currently, this operation is used to restart a fleet's auto-scaling +// activity. This operation can be used in the following ways: // -// * To restart actions on instances in the fleet's home Region, provide a -// fleet ID and the type of actions to resume. +// * To restart +// actions on instances in the fleet's home Region, provide a fleet ID and the type +// of actions to resume. // -// * To restart actions on instances -// in one of the fleet's remote locations, provide a fleet ID, a location name, and -// the type of actions to resume. +// * To restart actions on instances in one of the fleet's +// remote locations, provide a fleet ID, a location name, and the type of actions +// to resume. // -// If successful, GameLift once again initiates -// scaling events as triggered by the fleet's scaling policies. If actions on the -// fleet location were never stopped, this operation will have no effect. You can -// view a fleet's stopped actions using DescribeFleetAttributes or -// DescribeFleetLocationAttributes. Learn more Setting up GameLift fleets +// If successful, GameLift once again initiates scaling events as +// triggered by the fleet's scaling policies. If actions on the fleet location were +// never stopped, this operation will have no effect. Learn more Setting up +// GameLift fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleet | UpdateFleetCapacity | PutScalingPolicy | -// DescribeEC2InstanceLimits | DescribeFleetAttributes | -// DescribeFleetLocationAttributes | UpdateFleetAttributes | StopFleetActions | -// DeleteFleet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) StartFleetActions(ctx context.Context, params *StartFleetActionsInput, optFns ...func(*Options)) (*StartFleetActionsOutput, error) { if params == nil { params = &StartFleetActionsInput{} @@ -50,7 +46,6 @@ func (c *Client) StartFleetActions(ctx context.Context, params *StartFleetAction return out, nil } -// Represents the input for a request operation. type StartFleetActionsInput struct { // List of actions to restart on the fleet. @@ -71,7 +66,6 @@ type StartFleetActionsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type StartFleetActionsOutput struct { // The Amazon Resource Name (ARN diff --git a/service/gamelift/api_op_StartGameSessionPlacement.go b/service/gamelift/api_op_StartGameSessionPlacement.go index 13e17a53a07..2d14212450c 100644 --- a/service/gamelift/api_op_StartGameSessionPlacement.go +++ b/service/gamelift/api_op_StartGameSessionPlacement.go @@ -11,48 +11,45 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Places a request for a new game session in a queue (see CreateGameSessionQueue). -// When processing a placement request, Amazon GameLift searches for available -// resources on the queue's destinations, scanning each until it finds resources or -// the placement request times out. A game session placement request can also -// request player sessions. When a new game session is successfully created, Amazon -// GameLift creates a player session for each player included in the request. When -// placing a game session, by default Amazon GameLift tries each fleet in the order -// they are listed in the queue configuration. Ideally, a queue's destinations are -// listed in preference order. Alternatively, when requesting a game session with -// players, you can also provide latency data for each player in relevant Regions. -// Latency data indicates the performance lag a player experiences when connected -// to a fleet in the Region. Amazon GameLift uses latency data to reorder the list -// of destinations to place the game session in a Region with minimal lag. If -// latency data is provided for multiple players, Amazon GameLift calculates each -// Region's average lag for all players and reorders to get the best game play -// across all players. To place a new game session request, specify the -// following: +// Places a request for a new game session in a queue. When processing a placement +// request, Amazon GameLift searches for available resources on the queue's +// destinations, scanning each until it finds resources or the placement request +// times out. A game session placement request can also request player sessions. +// When a new game session is successfully created, Amazon GameLift creates a +// player session for each player included in the request. When placing a game +// session, by default Amazon GameLift tries each fleet in the order they are +// listed in the queue configuration. Ideally, a queue's destinations are listed in +// preference order. Alternatively, when requesting a game session with players, +// you can also provide latency data for each player in relevant Regions. Latency +// data indicates the performance lag a player experiences when connected to a +// fleet in the Region. Amazon GameLift uses latency data to reorder the list of +// destinations to place the game session in a Region with minimal lag. If latency +// data is provided for multiple players, Amazon GameLift calculates each Region's +// average lag for all players and reorders to get the best game play across all +// players. To place a new game session request, specify the following: // -// * The queue name and a set of game session properties and -// settings +// * The +// queue name and a set of game session properties and settings // -// * A unique ID (such as a UUID) for the placement. You use this ID to -// track the status of the placement request +// * A unique ID +// (such as a UUID) for the placement. You use this ID to track the status of the +// placement request // -// * (Optional) A set of player data and -// a unique player ID for each player that you are joining to the new game session -// (player data is optional, but if you include it, you must also provide a unique -// ID for each player) +// * (Optional) A set of player data and a unique player ID for +// each player that you are joining to the new game session (player data is +// optional, but if you include it, you must also provide a unique ID for each +// player) // -// * Latency data for all players (if you want to optimize -// game play for the players) +// * Latency data for all players (if you want to optimize game play for +// the players) // -// If successful, a new game session placement is -// created. To track the status of a placement request, call -// DescribeGameSessionPlacement and check the request's status. If the status is -// FULFILLED, a new game session has been created and a game session ARN and Region -// are referenced. If the placement request times out, you can resubmit the request -// or retry it with a different queue. Related actions CreateGameSession | -// DescribeGameSessions | DescribeGameSessionDetails | SearchGameSessions | -// UpdateGameSession | GetGameSessionLogUrl | StartGameSessionPlacement | -// DescribeGameSessionPlacement | StopGameSessionPlacement | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// If successful, a new game session placement is created. To track +// the status of a placement request, call DescribeGameSessionPlacement +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessionPlacement.html) +// and check the request's status. If the status is FULFILLED, a new game session +// has been created and a game session ARN and Region are referenced. If the +// placement request times out, you can resubmit the request or retry it with a +// different queue. func (c *Client) StartGameSessionPlacement(ctx context.Context, params *StartGameSessionPlacementInput, optFns ...func(*Options)) (*StartGameSessionPlacementOutput, error) { if params == nil { params = &StartGameSessionPlacementInput{} @@ -68,7 +65,6 @@ func (c *Client) StartGameSessionPlacement(ctx context.Context, params *StartGam return out, nil } -// Represents the input for a request operation. type StartGameSessionPlacementInput struct { // Name of the queue to use to place the new game session. You can use either the @@ -85,7 +81,7 @@ type StartGameSessionPlacementInput struct { // A unique identifier to assign to the new game session placement. This value is // developer-defined. The value must be unique across all Regions and cannot be - // reused unless you are resubmitting a canceled or timed-out placement request. + // reused. // // This member is required. PlacementId *string @@ -94,8 +90,8 @@ type StartGameSessionPlacementInput struct { DesiredPlayerSessions []types.DesiredPlayerSession // A set of custom properties for a game session, formatted as key:value pairs. - // These properties are passed to a game server process in the GameSession object - // with a request to start a new game session (see Start a Game Session + // These properties are passed to a game server process with a request to start a + // new game session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). GameProperties []types.GameProperty @@ -110,15 +106,14 @@ type StartGameSessionPlacementInput struct { GameSessionName *string // A set of values, expressed in milliseconds, that indicates the amount of latency - // that a player experiences when connected to @aws; Regions. This information is - // used to try to place the new game session where it can offer the best possible - // gameplay experience for the players. + // that a player experiences when connected to Amazon Web Services Regions. This + // information is used to try to place the new game session where it can offer the + // best possible gameplay experience for the players. PlayerLatencies []types.PlayerLatency noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type StartGameSessionPlacementOutput struct { // Object that describes the newly created game session placement. This object diff --git a/service/gamelift/api_op_StartMatchBackfill.go b/service/gamelift/api_op_StartMatchBackfill.go index bbf02731e1b..498f7d30d32 100644 --- a/service/gamelift/api_op_StartMatchBackfill.go +++ b/service/gamelift/api_op_StartMatchBackfill.go @@ -18,8 +18,8 @@ import ( // the game session. FlexMatch uses this information to select new players so that // backfilled match continues to meet the original match requirements. When using // FlexMatch with GameLift managed hosting, you can request a backfill match from a -// client service by calling this operation with a GameSession identifier. You also -// have the option of making backfill requests directly from your game server. In +// client service by calling this operation with a GameSessions ID. You also have +// the option of making backfill requests directly from your game server. In // response to a request, FlexMatch creates player sessions for the new players, // updates the GameSession resource, and sends updated matchmaking data to the game // server. You can request a backfill match at any point after a game session is @@ -41,9 +41,6 @@ import ( // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-events.html) // (reference) How GameLift FlexMatch works // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/gamelift-match.html) -// Related actions StartMatchmaking | DescribeMatchmaking | StopMatchmaking | -// AcceptMatch | StartMatchBackfill | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) StartMatchBackfill(ctx context.Context, params *StartMatchBackfillInput, optFns ...func(*Options)) (*StartMatchBackfillOutput, error) { if params == nil { params = &StartMatchBackfillInput{} @@ -59,7 +56,6 @@ func (c *Client) StartMatchBackfill(ctx context.Context, params *StartMatchBackf return out, nil } -// Represents the input for a request operation. type StartMatchBackfillInput struct { // Name of the matchmaker to use for this request. You can use either the @@ -72,7 +68,8 @@ type StartMatchBackfillInput struct { // Match information on all players that are currently assigned to the game // session. This information is used by the matchmaker to find new players and add - // them to the existing game. + // them to the existing game. You can include up to 199 Players in a + // StartMatchBackfill request. // // * PlayerID, PlayerAttributes, Team -- This // information is maintained in the GameSession object, MatchmakerData property, @@ -102,7 +99,6 @@ type StartMatchBackfillInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type StartMatchBackfillOutput struct { // Ticket representing the backfill matchmaking request. This object includes the diff --git a/service/gamelift/api_op_StartMatchmaking.go b/service/gamelift/api_op_StartMatchmaking.go index b62e955fb77..729a73e106c 100644 --- a/service/gamelift/api_op_StartMatchmaking.go +++ b/service/gamelift/api_op_StartMatchmaking.go @@ -32,9 +32,6 @@ import ( // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-notification.html) // How GameLift FlexMatch works // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/gamelift-match.html) -// Related actions StartMatchmaking | DescribeMatchmaking | StopMatchmaking | -// AcceptMatch | StartMatchBackfill | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) StartMatchmaking(ctx context.Context, params *StartMatchmakingInput, optFns ...func(*Options)) (*StartMatchmakingOutput, error) { if params == nil { params = &StartMatchmakingInput{} @@ -50,7 +47,6 @@ func (c *Client) StartMatchmaking(ctx context.Context, params *StartMatchmakingI return out, nil } -// Represents the input for a request operation. type StartMatchmakingInput struct { // Name of the matchmaking configuration to use for this request. Matchmaking @@ -63,7 +59,8 @@ type StartMatchmakingInput struct { // Information on each player to be matched. This information must include a player // ID, and may contain player attributes and latency data to be used in the // matchmaking process. After a successful match, Player objects contain the name - // of the team the player is assigned to. + // of the team the player is assigned to. You can include up to 10 Players in a + // StartMatchmaking request. // // This member is required. Players []types.Player @@ -76,7 +73,6 @@ type StartMatchmakingInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type StartMatchmakingOutput struct { // Ticket representing the matchmaking request. This object include the information diff --git a/service/gamelift/api_op_StopFleetActions.go b/service/gamelift/api_op_StopFleetActions.go index 365e657eb90..7e054a5de73 100644 --- a/service/gamelift/api_op_StopFleetActions.go +++ b/service/gamelift/api_op_StopFleetActions.go @@ -28,16 +28,10 @@ import ( // the type of actions to suspend. // // If successful, GameLift no longer initiates -// scaling events except in response to manual changes using UpdateFleetCapacity. -// You can view a fleet's stopped actions using DescribeFleetAttributes or -// DescribeFleetLocationAttributes. Suspended activity can be restarted using -// StartFleetActions. Learn more Setting up GameLift Fleets +// scaling events except in response to manual changes using UpdateFleetCapacity +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateFleetCapacity.html). +// Learn more Setting up GameLift Fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleet | UpdateFleetCapacity | PutScalingPolicy | -// DescribeEC2InstanceLimits | DescribeFleetAttributes | -// DescribeFleetLocationAttributes | UpdateFleetAttributes | StopFleetActions | -// DeleteFleet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) StopFleetActions(ctx context.Context, params *StopFleetActionsInput, optFns ...func(*Options)) (*StopFleetActionsOutput, error) { if params == nil { params = &StopFleetActionsInput{} @@ -53,7 +47,6 @@ func (c *Client) StopFleetActions(ctx context.Context, params *StopFleetActionsI return out, nil } -// Represents the input for a request operation. type StopFleetActionsInput struct { // List of actions to suspend on the fleet. @@ -74,7 +67,6 @@ type StopFleetActionsInput struct { noSmithyDocumentSerde } -// Represents the input for a request operation. type StopFleetActionsOutput struct { // The Amazon Resource Name (ARN diff --git a/service/gamelift/api_op_StopGameSessionPlacement.go b/service/gamelift/api_op_StopGameSessionPlacement.go index 013091b9163..1e55078bc73 100644 --- a/service/gamelift/api_op_StopGameSessionPlacement.go +++ b/service/gamelift/api_op_StopGameSessionPlacement.go @@ -13,11 +13,7 @@ import ( // Cancels a game session placement that is in PENDING status. To stop a placement, // provide the placement ID values. If successful, the placement is moved to -// CANCELLED status. Related actions CreateGameSession | DescribeGameSessions | -// DescribeGameSessionDetails | SearchGameSessions | UpdateGameSession | -// GetGameSessionLogUrl | StartGameSessionPlacement | DescribeGameSessionPlacement -// | StopGameSessionPlacement | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// CANCELLED status. func (c *Client) StopGameSessionPlacement(ctx context.Context, params *StopGameSessionPlacementInput, optFns ...func(*Options)) (*StopGameSessionPlacementOutput, error) { if params == nil { params = &StopGameSessionPlacementInput{} @@ -33,10 +29,9 @@ func (c *Client) StopGameSessionPlacement(ctx context.Context, params *StopGameS return out, nil } -// Represents the input for a request operation. type StopGameSessionPlacementInput struct { - // A unique identifier for a game session placement to cancel. + // A unique identifier for a game session placement to stop. // // This member is required. PlacementId *string @@ -44,7 +39,6 @@ type StopGameSessionPlacementInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type StopGameSessionPlacementOutput struct { // Object that describes the canceled game session placement, with CANCELLED status diff --git a/service/gamelift/api_op_StopMatchmaking.go b/service/gamelift/api_op_StopMatchmaking.go index 8187cac2cc9..3d752ecb24d 100644 --- a/service/gamelift/api_op_StopMatchmaking.go +++ b/service/gamelift/api_op_StopMatchmaking.go @@ -21,9 +21,6 @@ import ( // back an empty JSON struct with the HTTP 200 response (not an empty HTTP body). // Learn more Add FlexMatch to a game client // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-client.html) -// Related actions StartMatchmaking | DescribeMatchmaking | StopMatchmaking | -// AcceptMatch | StartMatchBackfill | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) StopMatchmaking(ctx context.Context, params *StopMatchmakingInput, optFns ...func(*Options)) (*StopMatchmakingOutput, error) { if params == nil { params = &StopMatchmakingInput{} @@ -39,7 +36,6 @@ func (c *Client) StopMatchmaking(ctx context.Context, params *StopMatchmakingInp return out, nil } -// Represents the input for a request operation. type StopMatchmakingInput struct { // A unique identifier for a matchmaking ticket. diff --git a/service/gamelift/api_op_SuspendGameServerGroup.go b/service/gamelift/api_op_SuspendGameServerGroup.go index 70ca6d727be..3cf73116378 100644 --- a/service/gamelift/api_op_SuspendGameServerGroup.go +++ b/service/gamelift/api_op_SuspendGameServerGroup.go @@ -31,11 +31,6 @@ import ( // returned showing that the activity is listed in SuspendedActions. Learn more // GameLift FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions CreateGameServerGroup | ListGameServerGroups | -// DescribeGameServerGroup | UpdateGameServerGroup | DeleteGameServerGroup | -// ResumeGameServerGroup | SuspendGameServerGroup | DescribeGameServerInstances | -// All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) SuspendGameServerGroup(ctx context.Context, params *SuspendGameServerGroupInput, optFns ...func(*Options)) (*SuspendGameServerGroupOutput, error) { if params == nil { params = &SuspendGameServerGroupInput{} @@ -53,8 +48,7 @@ func (c *Client) SuspendGameServerGroup(ctx context.Context, params *SuspendGame type SuspendGameServerGroupInput struct { - // A unique identifier for the game server group. Use either the GameServerGroup - // name or ARN value. + // A unique identifier for the game server group. Use either the name or ARN value. // // This member is required. GameServerGroupName *string diff --git a/service/gamelift/api_op_TagResource.go b/service/gamelift/api_op_TagResource.go index 6ada67b423a..08fb75beef8 100644 --- a/service/gamelift/api_op_TagResource.go +++ b/service/gamelift/api_op_TagResource.go @@ -41,8 +41,7 @@ import ( // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon // Web Services General Reference Amazon Web Services Tagging Strategies // (http://aws.amazon.com/answers/account-management/aws-tagging-strategies/) -// Related actions TagResource | UntagResource | ListTagsForResource | All APIs by -// task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { diff --git a/service/gamelift/api_op_UntagResource.go b/service/gamelift/api_op_UntagResource.go index b1fb5884b53..7fcb9ab3615 100644 --- a/service/gamelift/api_op_UntagResource.go +++ b/service/gamelift/api_op_UntagResource.go @@ -38,8 +38,7 @@ import ( // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon // Web Services General Reference Amazon Web Services Tagging Strategies // (http://aws.amazon.com/answers/account-management/aws-tagging-strategies/) -// Related actions TagResource | UntagResource | ListTagsForResource | All APIs by -// task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { diff --git a/service/gamelift/api_op_UpdateAlias.go b/service/gamelift/api_op_UpdateAlias.go index 2a1dda4c203..76a111ec84d 100644 --- a/service/gamelift/api_op_UpdateAlias.go +++ b/service/gamelift/api_op_UpdateAlias.go @@ -14,8 +14,7 @@ import ( // Updates properties for an alias. To update properties, specify the alias ID to // be updated and provide the information to be changed. To reassign an alias to // another fleet, provide an updated routing strategy. If successful, the updated -// alias record is returned. Related actions CreateAlias | ListAliases | -// DescribeAlias | UpdateAlias | DeleteAlias | ResolveAlias | All APIs by task +// alias record is returned. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) UpdateAlias(ctx context.Context, params *UpdateAliasInput, optFns ...func(*Options)) (*UpdateAliasOutput, error) { if params == nil { @@ -32,7 +31,6 @@ func (c *Client) UpdateAlias(ctx context.Context, params *UpdateAliasInput, optF return out, nil } -// Represents the input for a request operation. type UpdateAliasInput struct { // A unique identifier for the alias that you want to update. You can use either @@ -55,7 +53,6 @@ type UpdateAliasInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type UpdateAliasOutput struct { // The updated alias resource. diff --git a/service/gamelift/api_op_UpdateBuild.go b/service/gamelift/api_op_UpdateBuild.go index 940261696c7..79c2cbec057 100644 --- a/service/gamelift/api_op_UpdateBuild.go +++ b/service/gamelift/api_op_UpdateBuild.go @@ -15,9 +15,8 @@ import ( // update the metadata, specify the build ID to update and provide the new values. // If successful, a build object containing the updated metadata is returned. Learn // more Upload a Custom Server Build -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html) -// Related actions CreateBuild | ListBuilds | DescribeBuild | UpdateBuild | -// DeleteBuild | All APIs by task +// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html)All +// APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) UpdateBuild(ctx context.Context, params *UpdateBuildInput, optFns ...func(*Options)) (*UpdateBuildOutput, error) { if params == nil { @@ -34,7 +33,6 @@ func (c *Client) UpdateBuild(ctx context.Context, params *UpdateBuildInput, optF return out, nil } -// Represents the input for a request operation. type UpdateBuildInput struct { // A unique identifier for the build to update. You can use either the build ID or @@ -43,18 +41,17 @@ type UpdateBuildInput struct { // This member is required. BuildId *string - // A descriptive label that is associated with a build. Build names do not need to - // be unique. + // A descriptive label associated with a build. Build names do not need to be + // unique. Name *string - // Version information that is associated with a build or script. Version strings - // do not need to be unique. + // Version information associated with a build or script. Version strings do not + // need to be unique. Version *string noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type UpdateBuildOutput struct { // The updated build resource. diff --git a/service/gamelift/api_op_UpdateFleetAttributes.go b/service/gamelift/api_op_UpdateFleetAttributes.go index d64839fa9aa..1655fa8184a 100644 --- a/service/gamelift/api_op_UpdateFleetAttributes.go +++ b/service/gamelift/api_op_UpdateFleetAttributes.go @@ -16,11 +16,6 @@ import ( // the property values that you want to change. If successful, an updated // FleetAttributes object is returned. Learn more Setting up GameLift fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleetLocations | UpdateFleetAttributes | -// UpdateFleetCapacity | UpdateFleetPortSettings | UpdateRuntimeConfiguration | -// StopFleetActions | StartFleetActions | PutScalingPolicy | DeleteFleet | -// DeleteFleetLocations | DeleteScalingPolicy | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) UpdateFleetAttributes(ctx context.Context, params *UpdateFleetAttributesInput, optFns ...func(*Options)) (*UpdateFleetAttributesOutput, error) { if params == nil { params = &UpdateFleetAttributesInput{} @@ -36,7 +31,6 @@ func (c *Client) UpdateFleetAttributes(ctx context.Context, params *UpdateFleetA return out, nil } -// Represents the input for a request operation. type UpdateFleetAttributesInput struct { // A unique identifier for the fleet to update attribute metadata for. You can use @@ -45,6 +39,9 @@ type UpdateFleetAttributesInput struct { // This member is required. FleetId *string + // GameLift Anywhere configuration options. + AnywhereConfiguration *types.AnywhereConfiguration + // A human-readable description of a fleet. Description *string @@ -60,14 +57,15 @@ type UpdateFleetAttributesInput struct { // The game session protection policy to apply to all new instances created in this // fleet. Instances that already exist are not affected. You can set protection for - // individual instances using UpdateGameSession. - // - // * NoProtection -- The game - // session can be terminated during a scale-down event. + // individual instances using UpdateGameSession + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSession.html) + // . // - // * FullProtection -- If the - // game session is in an ACTIVE status, it cannot be terminated during a scale-down + // * NoProtection -- The game session can be terminated during a scale-down // event. + // + // * FullProtection -- If the game session is in an ACTIVE status, it + // cannot be terminated during a scale-down event. NewGameSessionProtectionPolicy types.ProtectionPolicy // Policy settings that limit the number of game sessions an individual player can @@ -77,9 +75,15 @@ type UpdateFleetAttributesInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type UpdateFleetAttributesOutput struct { + // The Amazon Resource Name (ARN + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) that is + // assigned to a GameLift fleet resource and uniquely identifies it. ARNs are + // unique across all Regions. Format is + // arn:aws:gamelift:::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912. + FleetArn *string + // A unique identifier for the fleet that was updated. FleetId *string diff --git a/service/gamelift/api_op_UpdateFleetCapacity.go b/service/gamelift/api_op_UpdateFleetCapacity.go index 871ed1bd11e..bc2501c08ba 100644 --- a/service/gamelift/api_op_UpdateFleetCapacity.go +++ b/service/gamelift/api_op_UpdateFleetCapacity.go @@ -23,35 +23,34 @@ import ( // * // Desired capacity: Manually set the number of Amazon EC2 instances to be // maintained in a fleet location. Before changing a fleet's desired capacity, you -// may want to call DescribeEC2InstanceLimits to get the maximum capacity of the -// fleet's Amazon EC2 instance type. Alternatively, consider using automatic -// scaling to adjust capacity based on player demand. +// may want to call DescribeEC2InstanceLimits +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeEC2InstanceLimits.html) +// to get the maximum capacity of the fleet's Amazon EC2 instance type. +// Alternatively, consider using automatic scaling to adjust capacity based on +// player demand. // -// This operation can be used -// in the following ways: +// This operation can be used in the following ways: // -// * To update capacity for a fleet's home Region, or if -// the fleet has no remote locations, omit the Location parameter. The fleet must -// be in ACTIVE status. +// * To update +// capacity for a fleet's home Region, or if the fleet has no remote locations, +// omit the Location parameter. The fleet must be in ACTIVE status. // -// * To update capacity for a fleet's remote location, -// include the Location parameter set to the location to be updated. The location -// must be in ACTIVE status. +// * To update +// capacity for a fleet's remote location, include the Location parameter set to +// the location to be updated. The location must be in ACTIVE status. // -// If successful, capacity settings are updated -// immediately. In response a change in desired capacity, GameLift initiates steps -// to start new instances or terminate existing instances in the requested fleet -// location. This continues until the location's active instance count matches the -// new desired instance count. You can track a fleet's current capacity by calling -// DescribeFleetCapacity or DescribeFleetLocationCapacity. If the requested desired -// instance count is higher than the instance type's limit, the LimitExceeded -// exception occurs. Learn more Scaling fleet capacity +// If +// successful, capacity settings are updated immediately. In response a change in +// desired capacity, GameLift initiates steps to start new instances or terminate +// existing instances in the requested fleet location. This continues until the +// location's active instance count matches the new desired instance count. You can +// track a fleet's current capacity by calling DescribeFleetCapacity +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeFleetCapacity.html) +// or DescribeFleetLocationCapacity +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeFleetLocationCapacity.html). +// If the requested desired instance count is higher than the instance type's +// limit, the LimitExceeded exception occurs. Learn more Scaling fleet capacity // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-manage-capacity.html) -// Related actions CreateFleetLocations | UpdateFleetAttributes | -// UpdateFleetCapacity | UpdateFleetPortSettings | UpdateRuntimeConfiguration | -// StopFleetActions | StartFleetActions | PutScalingPolicy | DeleteFleet | -// DeleteFleetLocations | DeleteScalingPolicy | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) UpdateFleetCapacity(ctx context.Context, params *UpdateFleetCapacityInput, optFns ...func(*Options)) (*UpdateFleetCapacityOutput, error) { if params == nil { params = &UpdateFleetCapacityInput{} @@ -67,7 +66,6 @@ func (c *Client) UpdateFleetCapacity(ctx context.Context, params *UpdateFleetCap return out, nil } -// Represents the input for a request operation. type UpdateFleetCapacityInput struct { // A unique identifier for the fleet to update capacity settings for. You can use @@ -95,7 +93,6 @@ type UpdateFleetCapacityInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type UpdateFleetCapacityOutput struct { // The Amazon Resource Name (ARN diff --git a/service/gamelift/api_op_UpdateFleetPortSettings.go b/service/gamelift/api_op_UpdateFleetPortSettings.go index 07c59f98bf1..67ab7b1cec7 100644 --- a/service/gamelift/api_op_UpdateFleetPortSettings.go +++ b/service/gamelift/api_op_UpdateFleetPortSettings.go @@ -22,11 +22,6 @@ import ( // location by calling DescribeFleetPortSettings with a location name. Learn more // Setting up GameLift fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleetLocations | UpdateFleetAttributes | -// UpdateFleetCapacity | UpdateFleetPortSettings | UpdateRuntimeConfiguration | -// StopFleetActions | StartFleetActions | PutScalingPolicy | DeleteFleet | -// DeleteFleetLocations | DeleteScalingPolicy | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) UpdateFleetPortSettings(ctx context.Context, params *UpdateFleetPortSettingsInput, optFns ...func(*Options)) (*UpdateFleetPortSettingsOutput, error) { if params == nil { params = &UpdateFleetPortSettingsInput{} @@ -42,7 +37,6 @@ func (c *Client) UpdateFleetPortSettings(ctx context.Context, params *UpdateFlee return out, nil } -// Represents the input for a request operation. type UpdateFleetPortSettingsInput struct { // A unique identifier for the fleet to update port settings for. You can use @@ -60,9 +54,15 @@ type UpdateFleetPortSettingsInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type UpdateFleetPortSettingsOutput struct { + // The Amazon Resource Name (ARN + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) that is + // assigned to a GameLift fleet resource and uniquely identifies it. ARNs are + // unique across all Regions. Format is + // arn:aws:gamelift:::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912. + FleetArn *string + // A unique identifier for the fleet that was updated. FleetId *string diff --git a/service/gamelift/api_op_UpdateGameServer.go b/service/gamelift/api_op_UpdateGameServer.go index d4c82064395..85e030dabf5 100644 --- a/service/gamelift/api_op_UpdateGameServer.go +++ b/service/gamelift/api_op_UpdateGameServer.go @@ -37,9 +37,6 @@ import ( // Once a game server is successfully updated, the relevant statuses and // timestamps are updated. Learn more GameLift FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions RegisterGameServer | ListGameServers | ClaimGameServer | -// DescribeGameServer | UpdateGameServer | DeregisterGameServer | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) UpdateGameServer(ctx context.Context, params *UpdateGameServerInput, optFns ...func(*Options)) (*UpdateGameServerOutput, error) { if params == nil { params = &UpdateGameServerInput{} @@ -58,7 +55,6 @@ func (c *Client) UpdateGameServer(ctx context.Context, params *UpdateGameServerI type UpdateGameServerInput struct { // A unique identifier for the game server group where the game server is running. - // Use either the GameServerGroup name or ARN value. // // This member is required. GameServerGroupName *string @@ -70,7 +66,7 @@ type UpdateGameServerInput struct { // A set of custom game server properties, formatted as a single string value. This // data is passed to a game client or service when it requests information on game - // servers using ListGameServers or ClaimGameServer. + // servers. GameServerData *string // Indicates health status of the game server. A request that includes this diff --git a/service/gamelift/api_op_UpdateGameServerGroup.go b/service/gamelift/api_op_UpdateGameServerGroup.go index d066442c826..45ecebc17b9 100644 --- a/service/gamelift/api_op_UpdateGameServerGroup.go +++ b/service/gamelift/api_op_UpdateGameServerGroup.go @@ -21,11 +21,6 @@ import ( // continue to perform instance balancing activity. If successful, a // GameServerGroup object is returned. Learn more GameLift FleetIQ Guide // (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html) -// Related actions CreateGameServerGroup | ListGameServerGroups | -// DescribeGameServerGroup | UpdateGameServerGroup | DeleteGameServerGroup | -// ResumeGameServerGroup | SuspendGameServerGroup | DescribeGameServerInstances | -// All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) func (c *Client) UpdateGameServerGroup(ctx context.Context, params *UpdateGameServerGroupInput, optFns ...func(*Options)) (*UpdateGameServerGroupOutput, error) { if params == nil { params = &UpdateGameServerGroupInput{} @@ -43,8 +38,7 @@ func (c *Client) UpdateGameServerGroup(ctx context.Context, params *UpdateGameSe type UpdateGameServerGroupInput struct { - // A unique identifier for the game server group. Use either the GameServerGroup - // name or ARN value. + // A unique identifier for the game server group. Use either the name or ARN value. // // This member is required. GameServerGroupName *string diff --git a/service/gamelift/api_op_UpdateGameSession.go b/service/gamelift/api_op_UpdateGameSession.go index 9f8a543618b..86a595cab82 100644 --- a/service/gamelift/api_op_UpdateGameSession.go +++ b/service/gamelift/api_op_UpdateGameSession.go @@ -13,10 +13,7 @@ import ( // Updates the mutable properties of a game session. To update a game session, // specify the game session ID and the values you want to change. If successful, -// the updated GameSession object is returned. Related actions CreateGameSession | -// DescribeGameSessions | DescribeGameSessionDetails | SearchGameSessions | -// UpdateGameSession | GetGameSessionLogUrl | StartGameSessionPlacement | -// DescribeGameSessionPlacement | StopGameSessionPlacement | All APIs by task +// the updated GameSession object is returned. All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) UpdateGameSession(ctx context.Context, params *UpdateGameSessionInput, optFns ...func(*Options)) (*UpdateGameSessionOutput, error) { if params == nil { @@ -33,7 +30,6 @@ func (c *Client) UpdateGameSession(ctx context.Context, params *UpdateGameSessio return out, nil } -// Represents the input for a request operation. type UpdateGameSessionInput struct { // A unique identifier for the game session to update. @@ -65,7 +61,6 @@ type UpdateGameSessionInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type UpdateGameSessionOutput struct { // The updated game session properties. diff --git a/service/gamelift/api_op_UpdateGameSessionQueue.go b/service/gamelift/api_op_UpdateGameSessionQueue.go index c97be6a781e..9a37ce2af66 100644 --- a/service/gamelift/api_op_UpdateGameSessionQueue.go +++ b/service/gamelift/api_op_UpdateGameSessionQueue.go @@ -16,16 +16,6 @@ import ( // name to be updated and provide the new settings. When updating destinations, // provide a complete list of destinations. Learn more Using Multi-Region Queues // (https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-intro.html) -// Related actions CreateGameSessionQueue -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateGameSessionQueue.html) -// | DescribeGameSessionQueues -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessionQueues.html) -// | UpdateGameSessionQueue -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSessionQueue.html) -// | DeleteGameSessionQueue -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DeleteGameSessionQueue.html) -// | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) UpdateGameSessionQueue(ctx context.Context, params *UpdateGameSessionQueueInput, optFns ...func(*Options)) (*UpdateGameSessionQueueOutput, error) { if params == nil { params = &UpdateGameSessionQueueInput{} @@ -41,7 +31,6 @@ func (c *Client) UpdateGameSessionQueue(ctx context.Context, params *UpdateGameS return out, nil } -// Represents the input for a request operation. type UpdateGameSessionQueueInput struct { // A descriptive label that is associated with game session queue. Queue names must @@ -96,7 +85,6 @@ type UpdateGameSessionQueueInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type UpdateGameSessionQueueOutput struct { // An object that describes the newly updated game session queue. diff --git a/service/gamelift/api_op_UpdateMatchmakingConfiguration.go b/service/gamelift/api_op_UpdateMatchmakingConfiguration.go index 6ee69ba01ef..660760f889f 100644 --- a/service/gamelift/api_op_UpdateMatchmakingConfiguration.go +++ b/service/gamelift/api_op_UpdateMatchmakingConfiguration.go @@ -16,12 +16,6 @@ import ( // settings, specify the configuration name to be updated and provide the new // settings. Learn more Design a FlexMatch matchmaker // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-configuration.html) -// Related actions CreateMatchmakingConfiguration | -// DescribeMatchmakingConfigurations | UpdateMatchmakingConfiguration | -// DeleteMatchmakingConfiguration | CreateMatchmakingRuleSet | -// DescribeMatchmakingRuleSets | ValidateMatchmakingRuleSet | -// DeleteMatchmakingRuleSet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) UpdateMatchmakingConfiguration(ctx context.Context, params *UpdateMatchmakingConfigurationInput, optFns ...func(*Options)) (*UpdateMatchmakingConfigurationOutput, error) { if params == nil { params = &UpdateMatchmakingConfigurationInput{} @@ -37,7 +31,6 @@ func (c *Client) UpdateMatchmakingConfiguration(ctx context.Context, params *Upd return out, nil } -// Represents the input for a request operation. type UpdateMatchmakingConfigurationInput struct { // A unique identifier for the matchmaking configuration to update. You can use @@ -66,7 +59,7 @@ type UpdateMatchmakingConfigurationInput struct { // The method that is used to backfill game sessions created with this matchmaking // configuration. Specify MANUAL when your game manages backfill requests manually // or does not use the match backfill feature. Specify AUTOMATIC to have GameLift - // create a StartMatchBackfill request whenever a game session has one or more open + // create a match backfill request whenever a game session has one or more open // slots. Learn more about manual and automatic backfill in Backfill Existing Games // with FlexMatch // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-backfill.html). @@ -76,7 +69,7 @@ type UpdateMatchmakingConfigurationInput struct { // Information to add to all events related to the matchmaking configuration. CustomEventData *string - // A descriptive label that is associated with matchmaking configuration. + // A description for the matchmaking configuration. Description *string // Indicates whether this matchmaking configuration is being used with GameLift @@ -93,8 +86,8 @@ type UpdateMatchmakingConfigurationInput struct { FlexMatchMode types.FlexMatchMode // A set of custom properties for a game session, formatted as key:value pairs. - // These properties are passed to a game server process in the GameSession object - // with a request to start a new game session (see Start a Game Session + // These properties are passed to a game server process with a request to start a + // new game session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). // This information is added to the new GameSession object that is created for a // successful match. This parameter is not used if FlexMatchMode is set to @@ -102,12 +95,11 @@ type UpdateMatchmakingConfigurationInput struct { GameProperties []types.GameProperty // A set of custom game session properties, formatted as a single string value. - // This data is passed to a game server process in the GameSession object with a - // request to start a new game session (see Start a Game Session + // This data is passed to a game server process with a request to start a new game + // session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). - // This information is added to the new GameSession object that is created for a - // successful match. This parameter is not used if FlexMatchMode is set to - // STANDALONE. + // This information is added to the game session that is created for a successful + // match. This parameter is not used if FlexMatchMode is set to STANDALONE. GameSessionData *string // The Amazon Resource Name (ARN @@ -139,7 +131,6 @@ type UpdateMatchmakingConfigurationInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type UpdateMatchmakingConfigurationOutput struct { // The updated matchmaking configuration. diff --git a/service/gamelift/api_op_UpdateRuntimeConfiguration.go b/service/gamelift/api_op_UpdateRuntimeConfiguration.go index 61a4acdb118..e8bb2034146 100644 --- a/service/gamelift/api_op_UpdateRuntimeConfiguration.go +++ b/service/gamelift/api_op_UpdateRuntimeConfiguration.go @@ -23,11 +23,6 @@ import ( // existing processes when they shut down. Updating a fleet's runtime configuration // never affects existing server processes. Learn more Setting up GameLift fleets // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) -// Related actions CreateFleetLocations | UpdateFleetAttributes | -// UpdateFleetCapacity | UpdateFleetPortSettings | UpdateRuntimeConfiguration | -// StopFleetActions | StartFleetActions | PutScalingPolicy | DeleteFleet | -// DeleteFleetLocations | DeleteScalingPolicy | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) UpdateRuntimeConfiguration(ctx context.Context, params *UpdateRuntimeConfigurationInput, optFns ...func(*Options)) (*UpdateRuntimeConfigurationOutput, error) { if params == nil { params = &UpdateRuntimeConfigurationInput{} @@ -43,7 +38,6 @@ func (c *Client) UpdateRuntimeConfiguration(ctx context.Context, params *UpdateR return out, nil } -// Represents the input for a request operation. type UpdateRuntimeConfigurationInput struct { // A unique identifier for the fleet to update runtime configuration for. You can @@ -52,7 +46,7 @@ type UpdateRuntimeConfigurationInput struct { // This member is required. FleetId *string - // Instructions for launching server processes on each instance in the fleet. + // Instructions for alaunching server processes on each instance in the fleet. // Server processes run either a custom game build executable or a Realtime Servers // script. The runtime configuration lists the types of server processes to run on // an instance, how to launch them, and the number of processes to run @@ -64,7 +58,6 @@ type UpdateRuntimeConfigurationInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type UpdateRuntimeConfigurationOutput struct { // The runtime configuration currently in use by all instances in the fleet. If the diff --git a/service/gamelift/api_op_UpdateScript.go b/service/gamelift/api_op_UpdateScript.go index 598be696dbf..8a32d7bd340 100644 --- a/service/gamelift/api_op_UpdateScript.go +++ b/service/gamelift/api_op_UpdateScript.go @@ -21,8 +21,7 @@ import ( // script is updated and acquired by a fleet instance, the new version is used for // all new game sessions. Learn more Amazon GameLift Realtime Servers // (https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-intro.html) -// Related actions CreateScript | ListScripts | DescribeScript | UpdateScript | -// DeleteScript | All APIs by task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) UpdateScript(ctx context.Context, params *UpdateScriptInput, optFns ...func(*Options)) (*UpdateScriptOutput, error) { if params == nil { @@ -61,8 +60,8 @@ type UpdateScriptInput struct { // version. StorageLocation *types.S3Location - // Version information that is associated with a build or script. Version strings - // do not need to be unique. + // Version information associated with a build or script. Version strings do not + // need to be unique. Version *string // A data object containing your Realtime scripts and dependencies as a zip file. diff --git a/service/gamelift/api_op_ValidateMatchmakingRuleSet.go b/service/gamelift/api_op_ValidateMatchmakingRuleSet.go index 5c40b1053b5..eb597e0a85d 100644 --- a/service/gamelift/api_op_ValidateMatchmakingRuleSet.go +++ b/service/gamelift/api_op_ValidateMatchmakingRuleSet.go @@ -17,13 +17,6 @@ import ( // // * Build a rule set // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html) -// -// Related -// actions CreateMatchmakingConfiguration | DescribeMatchmakingConfigurations | -// UpdateMatchmakingConfiguration | DeleteMatchmakingConfiguration | -// CreateMatchmakingRuleSet | DescribeMatchmakingRuleSets | -// ValidateMatchmakingRuleSet | DeleteMatchmakingRuleSet | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) func (c *Client) ValidateMatchmakingRuleSet(ctx context.Context, params *ValidateMatchmakingRuleSetInput, optFns ...func(*Options)) (*ValidateMatchmakingRuleSetOutput, error) { if params == nil { params = &ValidateMatchmakingRuleSetInput{} @@ -39,7 +32,6 @@ func (c *Client) ValidateMatchmakingRuleSet(ctx context.Context, params *Validat return out, nil } -// Represents the input for a request operation. type ValidateMatchmakingRuleSetInput struct { // A collection of matchmaking rules to validate, formatted as a JSON string. @@ -50,7 +42,6 @@ type ValidateMatchmakingRuleSetInput struct { noSmithyDocumentSerde } -// Represents the returned data in response to a request operation. type ValidateMatchmakingRuleSetOutput struct { // A response indicating whether the rule set is valid. diff --git a/service/gamelift/deserializers.go b/service/gamelift/deserializers.go index e4d1943a000..53dd666b0e8 100644 --- a/service/gamelift/deserializers.go +++ b/service/gamelift/deserializers.go @@ -746,6 +746,9 @@ func awsAwsjson11_deserializeOpErrorCreateFleetLocations(response *smithyhttp.Re } switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServiceException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) @@ -1164,6 +1167,132 @@ func awsAwsjson11_deserializeOpErrorCreateGameSessionQueue(response *smithyhttp. } } +type awsAwsjson11_deserializeOpCreateLocation struct { +} + +func (*awsAwsjson11_deserializeOpCreateLocation) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateLocation) 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, awsAwsjson11_deserializeOpErrorCreateLocation(response, &metadata) + } + output := &CreateLocationOutput{} + 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 = awsAwsjson11_deserializeOpDocumentCreateLocationOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorCreateLocation(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("TaggingFailedException", errorCode): + return awsAwsjson11_deserializeErrorTaggingFailedException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateMatchmakingConfiguration struct { } @@ -1394,6 +1523,9 @@ func awsAwsjson11_deserializeOpErrorCreateMatchmakingRuleSet(response *smithyhtt case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("TaggingFailedException", errorCode): return awsAwsjson11_deserializeErrorTaggingFailedException(response, errorBody) @@ -2703,6 +2835,126 @@ func awsAwsjson11_deserializeOpErrorDeleteGameSessionQueue(response *smithyhttp. } } +type awsAwsjson11_deserializeOpDeleteLocation struct { +} + +func (*awsAwsjson11_deserializeOpDeleteLocation) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteLocation) 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, awsAwsjson11_deserializeOpErrorDeleteLocation(response, &metadata) + } + output := &DeleteLocationOutput{} + 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 = awsAwsjson11_deserializeOpDocumentDeleteLocationOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteLocation(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeleteMatchmakingConfiguration struct { } @@ -3388,14 +3640,14 @@ func awsAwsjson11_deserializeOpErrorDeleteVpcPeeringConnection(response *smithyh } } -type awsAwsjson11_deserializeOpDeregisterGameServer struct { +type awsAwsjson11_deserializeOpDeregisterCompute struct { } -func (*awsAwsjson11_deserializeOpDeregisterGameServer) ID() string { +func (*awsAwsjson11_deserializeOpDeregisterCompute) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeregisterGameServer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeregisterCompute) 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) @@ -3409,23 +3661,143 @@ func (m *awsAwsjson11_deserializeOpDeregisterGameServer) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterGameServer(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterCompute(response, &metadata) } - output := &DeregisterGameServerOutput{} + output := &DeregisterComputeOutput{} 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 -} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -func awsAwsjson11_deserializeOpErrorDeregisterGameServer(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + 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 = awsAwsjson11_deserializeOpDocumentDeregisterComputeOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeregisterCompute(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeregisterGameServer struct { +} + +func (*awsAwsjson11_deserializeOpDeregisterGameServer) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeregisterGameServer) 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, awsAwsjson11_deserializeOpErrorDeregisterGameServer(response, &metadata) + } + output := &DeregisterGameServerOutput{} + 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 awsAwsjson11_deserializeOpErrorDeregisterGameServer(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()) @@ -3726,6 +4098,126 @@ func awsAwsjson11_deserializeOpErrorDescribeBuild(response *smithyhttp.Response, } } +type awsAwsjson11_deserializeOpDescribeCompute struct { +} + +func (*awsAwsjson11_deserializeOpDescribeCompute) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeCompute) 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, awsAwsjson11_deserializeOpErrorDescribeCompute(response, &metadata) + } + output := &DescribeComputeOutput{} + 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 = awsAwsjson11_deserializeOpDocumentDescribeComputeOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDescribeCompute(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDescribeEC2InstanceLimits struct { } @@ -4685,6 +5177,9 @@ func awsAwsjson11_deserializeOpErrorDescribeFleetPortSettings(response *smithyht case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("UnsupportedRegionException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6864,14 +7359,14 @@ func awsAwsjson11_deserializeOpErrorDescribeVpcPeeringConnections(response *smit } } -type awsAwsjson11_deserializeOpGetGameSessionLogUrl struct { +type awsAwsjson11_deserializeOpGetComputeAccess struct { } -func (*awsAwsjson11_deserializeOpGetGameSessionLogUrl) ID() string { +func (*awsAwsjson11_deserializeOpGetComputeAccess) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetGameSessionLogUrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetComputeAccess) 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) @@ -6885,9 +7380,9 @@ func (m *awsAwsjson11_deserializeOpGetGameSessionLogUrl) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetGameSessionLogUrl(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetComputeAccess(response, &metadata) } - output := &GetGameSessionLogUrlOutput{} + output := &GetComputeAccessOutput{} out.Result = output var buff [1024]byte @@ -6907,7 +7402,7 @@ func (m *awsAwsjson11_deserializeOpGetGameSessionLogUrl) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetGameSessionLogUrlOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetComputeAccessOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6921,7 +7416,7 @@ func (m *awsAwsjson11_deserializeOpGetGameSessionLogUrl) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetGameSessionLogUrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetComputeAccess(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)} @@ -6984,14 +7479,14 @@ func awsAwsjson11_deserializeOpErrorGetGameSessionLogUrl(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpGetInstanceAccess struct { +type awsAwsjson11_deserializeOpGetComputeAuthToken struct { } -func (*awsAwsjson11_deserializeOpGetInstanceAccess) ID() string { +func (*awsAwsjson11_deserializeOpGetComputeAuthToken) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetInstanceAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetComputeAuthToken) 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) @@ -7005,9 +7500,9 @@ func (m *awsAwsjson11_deserializeOpGetInstanceAccess) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetInstanceAccess(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetComputeAuthToken(response, &metadata) } - output := &GetInstanceAccessOutput{} + output := &GetComputeAuthTokenOutput{} out.Result = output var buff [1024]byte @@ -7027,7 +7522,7 @@ func (m *awsAwsjson11_deserializeOpGetInstanceAccess) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetInstanceAccessOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetComputeAuthTokenOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7041,7 +7536,7 @@ func (m *awsAwsjson11_deserializeOpGetInstanceAccess) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetInstanceAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetComputeAuthToken(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)} @@ -7104,14 +7599,14 @@ func awsAwsjson11_deserializeOpErrorGetInstanceAccess(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpListAliases struct { +type awsAwsjson11_deserializeOpGetGameSessionLogUrl struct { } -func (*awsAwsjson11_deserializeOpListAliases) ID() string { +func (*awsAwsjson11_deserializeOpGetGameSessionLogUrl) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetGameSessionLogUrl) 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) @@ -7125,9 +7620,9 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAliases(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetGameSessionLogUrl(response, &metadata) } - output := &ListAliasesOutput{} + output := &GetGameSessionLogUrlOutput{} out.Result = output var buff [1024]byte @@ -7147,7 +7642,7 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListAliasesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetGameSessionLogUrlOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7161,7 +7656,7 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetGameSessionLogUrl(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)} @@ -7208,6 +7703,9 @@ func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, m case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) @@ -7221,14 +7719,14 @@ func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpListBuilds struct { +type awsAwsjson11_deserializeOpGetInstanceAccess struct { } -func (*awsAwsjson11_deserializeOpListBuilds) ID() string { +func (*awsAwsjson11_deserializeOpGetInstanceAccess) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListBuilds) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetInstanceAccess) 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) @@ -7242,9 +7740,9 @@ func (m *awsAwsjson11_deserializeOpListBuilds) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListBuilds(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetInstanceAccess(response, &metadata) } - output := &ListBuildsOutput{} + output := &GetInstanceAccessOutput{} out.Result = output var buff [1024]byte @@ -7264,7 +7762,7 @@ func (m *awsAwsjson11_deserializeOpListBuilds) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListBuildsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetInstanceAccessOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7278,7 +7776,7 @@ func (m *awsAwsjson11_deserializeOpListBuilds) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListBuilds(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetInstanceAccess(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)} @@ -7325,6 +7823,9 @@ func awsAwsjson11_deserializeOpErrorListBuilds(response *smithyhttp.Response, me case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) @@ -7338,14 +7839,14 @@ func awsAwsjson11_deserializeOpErrorListBuilds(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpListFleets struct { +type awsAwsjson11_deserializeOpListAliases struct { } -func (*awsAwsjson11_deserializeOpListFleets) ID() string { +func (*awsAwsjson11_deserializeOpListAliases) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListFleets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAliases) 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) @@ -7359,9 +7860,9 @@ func (m *awsAwsjson11_deserializeOpListFleets) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListFleets(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAliases(response, &metadata) } - output := &ListFleetsOutput{} + output := &ListAliasesOutput{} out.Result = output var buff [1024]byte @@ -7381,7 +7882,7 @@ func (m *awsAwsjson11_deserializeOpListFleets) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListFleetsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAliasesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7395,7 +7896,7 @@ func (m *awsAwsjson11_deserializeOpListFleets) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListFleets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAliases(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)} @@ -7442,9 +7943,6 @@ func awsAwsjson11_deserializeOpErrorListFleets(response *smithyhttp.Response, me case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) @@ -7458,14 +7956,14 @@ func awsAwsjson11_deserializeOpErrorListFleets(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpListGameServerGroups struct { +type awsAwsjson11_deserializeOpListBuilds struct { } -func (*awsAwsjson11_deserializeOpListGameServerGroups) ID() string { +func (*awsAwsjson11_deserializeOpListBuilds) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListGameServerGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListBuilds) 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) @@ -7479,9 +7977,9 @@ func (m *awsAwsjson11_deserializeOpListGameServerGroups) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListGameServerGroups(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListBuilds(response, &metadata) } - output := &ListGameServerGroupsOutput{} + output := &ListBuildsOutput{} out.Result = output var buff [1024]byte @@ -7501,7 +7999,7 @@ func (m *awsAwsjson11_deserializeOpListGameServerGroups) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListGameServerGroupsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListBuildsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7515,7 +8013,7 @@ func (m *awsAwsjson11_deserializeOpListGameServerGroups) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListGameServerGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListBuilds(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)} @@ -7575,14 +8073,14 @@ func awsAwsjson11_deserializeOpErrorListGameServerGroups(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpListGameServers struct { +type awsAwsjson11_deserializeOpListCompute struct { } -func (*awsAwsjson11_deserializeOpListGameServers) ID() string { +func (*awsAwsjson11_deserializeOpListCompute) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListGameServers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCompute) 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) @@ -7596,9 +8094,9 @@ func (m *awsAwsjson11_deserializeOpListGameServers) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListGameServers(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCompute(response, &metadata) } - output := &ListGameServersOutput{} + output := &ListComputeOutput{} out.Result = output var buff [1024]byte @@ -7618,7 +8116,7 @@ func (m *awsAwsjson11_deserializeOpListGameServers) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListGameServersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListComputeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7632,7 +8130,7 @@ func (m *awsAwsjson11_deserializeOpListGameServers) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListGameServers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCompute(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)} @@ -7692,14 +8190,14 @@ func awsAwsjson11_deserializeOpErrorListGameServers(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpListScripts struct { +type awsAwsjson11_deserializeOpListFleets struct { } -func (*awsAwsjson11_deserializeOpListScripts) ID() string { +func (*awsAwsjson11_deserializeOpListFleets) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListScripts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListFleets) 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) @@ -7713,9 +8211,9 @@ func (m *awsAwsjson11_deserializeOpListScripts) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListScripts(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListFleets(response, &metadata) } - output := &ListScriptsOutput{} + output := &ListFleetsOutput{} out.Result = output var buff [1024]byte @@ -7735,7 +8233,7 @@ func (m *awsAwsjson11_deserializeOpListScripts) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListScriptsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListFleetsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7749,7 +8247,7 @@ func (m *awsAwsjson11_deserializeOpListScripts) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListScripts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListFleets(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)} @@ -7796,6 +8294,9 @@ func awsAwsjson11_deserializeOpErrorListScripts(response *smithyhttp.Response, m case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) @@ -7809,14 +8310,14 @@ func awsAwsjson11_deserializeOpErrorListScripts(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpListTagsForResource struct { +type awsAwsjson11_deserializeOpListGameServerGroups struct { } -func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_deserializeOpListGameServerGroups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListGameServerGroups) 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) @@ -7830,9 +8331,9 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListGameServerGroups(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListGameServerGroupsOutput{} out.Result = output var buff [1024]byte @@ -7852,7 +8353,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListGameServerGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7866,7 +8367,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListGameServerGroups(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)} @@ -7913,11 +8414,8 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - - case strings.EqualFold("TaggingFailedException", errorCode): - return awsAwsjson11_deserializeErrorTaggingFailedException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7929,14 +8427,14 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpPutScalingPolicy struct { +type awsAwsjson11_deserializeOpListGameServers struct { } -func (*awsAwsjson11_deserializeOpPutScalingPolicy) ID() string { +func (*awsAwsjson11_deserializeOpListGameServers) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutScalingPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListGameServers) 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) @@ -7950,9 +8448,9 @@ func (m *awsAwsjson11_deserializeOpPutScalingPolicy) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutScalingPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListGameServers(response, &metadata) } - output := &PutScalingPolicyOutput{} + output := &ListGameServersOutput{} out.Result = output var buff [1024]byte @@ -7972,7 +8470,7 @@ func (m *awsAwsjson11_deserializeOpPutScalingPolicy) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutScalingPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListGameServersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7986,7 +8484,7 @@ func (m *awsAwsjson11_deserializeOpPutScalingPolicy) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutScalingPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListGameServers(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)} @@ -8033,9 +8531,6 @@ func awsAwsjson11_deserializeOpErrorPutScalingPolicy(response *smithyhttp.Respon case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) @@ -8049,14 +8544,14 @@ func awsAwsjson11_deserializeOpErrorPutScalingPolicy(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpRegisterGameServer struct { +type awsAwsjson11_deserializeOpListLocations struct { } -func (*awsAwsjson11_deserializeOpRegisterGameServer) ID() string { +func (*awsAwsjson11_deserializeOpListLocations) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpRegisterGameServer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListLocations) 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) @@ -8070,9 +8565,9 @@ func (m *awsAwsjson11_deserializeOpRegisterGameServer) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorRegisterGameServer(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListLocations(response, &metadata) } - output := &RegisterGameServerOutput{} + output := &ListLocationsOutput{} out.Result = output var buff [1024]byte @@ -8092,7 +8587,7 @@ func (m *awsAwsjson11_deserializeOpRegisterGameServer) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentRegisterGameServerOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListLocationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8106,7 +8601,7 @@ func (m *awsAwsjson11_deserializeOpRegisterGameServer) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorRegisterGameServer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListLocations(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)} @@ -8147,18 +8642,12 @@ func awsAwsjson11_deserializeOpErrorRegisterGameServer(response *smithyhttp.Resp } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson11_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) @@ -8172,14 +8661,14 @@ func awsAwsjson11_deserializeOpErrorRegisterGameServer(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpRequestUploadCredentials struct { +type awsAwsjson11_deserializeOpListScripts struct { } -func (*awsAwsjson11_deserializeOpRequestUploadCredentials) ID() string { +func (*awsAwsjson11_deserializeOpListScripts) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpRequestUploadCredentials) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListScripts) 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) @@ -8193,9 +8682,9 @@ func (m *awsAwsjson11_deserializeOpRequestUploadCredentials) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorRequestUploadCredentials(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListScripts(response, &metadata) } - output := &RequestUploadCredentialsOutput{} + output := &ListScriptsOutput{} out.Result = output var buff [1024]byte @@ -8215,7 +8704,7 @@ func (m *awsAwsjson11_deserializeOpRequestUploadCredentials) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentRequestUploadCredentialsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListScriptsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8229,7 +8718,7 @@ func (m *awsAwsjson11_deserializeOpRequestUploadCredentials) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorRequestUploadCredentials(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListScripts(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)} @@ -8276,9 +8765,6 @@ func awsAwsjson11_deserializeOpErrorRequestUploadCredentials(response *smithyhtt case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) @@ -8292,14 +8778,14 @@ func awsAwsjson11_deserializeOpErrorRequestUploadCredentials(response *smithyhtt } } -type awsAwsjson11_deserializeOpResolveAlias struct { +type awsAwsjson11_deserializeOpListTagsForResource struct { } -func (*awsAwsjson11_deserializeOpResolveAlias) ID() string { +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpResolveAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_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) @@ -8313,9 +8799,9 @@ func (m *awsAwsjson11_deserializeOpResolveAlias) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorResolveAlias(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &ResolveAliasOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -8335,7 +8821,7 @@ func (m *awsAwsjson11_deserializeOpResolveAlias) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentResolveAliasOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8349,7 +8835,7 @@ func (m *awsAwsjson11_deserializeOpResolveAlias) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorResolveAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_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)} @@ -8399,11 +8885,8 @@ func awsAwsjson11_deserializeOpErrorResolveAlias(response *smithyhttp.Response, case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("TerminalRoutingStrategyException", errorCode): - return awsAwsjson11_deserializeErrorTerminalRoutingStrategyException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("TaggingFailedException", errorCode): + return awsAwsjson11_deserializeErrorTaggingFailedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8415,14 +8898,14 @@ func awsAwsjson11_deserializeOpErrorResolveAlias(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpResumeGameServerGroup struct { +type awsAwsjson11_deserializeOpPutScalingPolicy struct { } -func (*awsAwsjson11_deserializeOpResumeGameServerGroup) ID() string { +func (*awsAwsjson11_deserializeOpPutScalingPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpResumeGameServerGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutScalingPolicy) 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) @@ -8436,9 +8919,9 @@ func (m *awsAwsjson11_deserializeOpResumeGameServerGroup) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorResumeGameServerGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutScalingPolicy(response, &metadata) } - output := &ResumeGameServerGroupOutput{} + output := &PutScalingPolicyOutput{} out.Result = output var buff [1024]byte @@ -8458,7 +8941,7 @@ func (m *awsAwsjson11_deserializeOpResumeGameServerGroup) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentResumeGameServerGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutScalingPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8472,7 +8955,7 @@ func (m *awsAwsjson11_deserializeOpResumeGameServerGroup) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorResumeGameServerGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutScalingPolicy(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)} @@ -8535,14 +9018,14 @@ func awsAwsjson11_deserializeOpErrorResumeGameServerGroup(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpSearchGameSessions struct { +type awsAwsjson11_deserializeOpRegisterCompute struct { } -func (*awsAwsjson11_deserializeOpSearchGameSessions) ID() string { +func (*awsAwsjson11_deserializeOpRegisterCompute) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpSearchGameSessions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpRegisterCompute) 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) @@ -8556,9 +9039,9 @@ func (m *awsAwsjson11_deserializeOpSearchGameSessions) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorSearchGameSessions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorRegisterCompute(response, &metadata) } - output := &SearchGameSessionsOutput{} + output := &RegisterComputeOutput{} out.Result = output var buff [1024]byte @@ -8578,7 +9061,7 @@ func (m *awsAwsjson11_deserializeOpSearchGameSessions) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentSearchGameSessionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentRegisterComputeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8592,7 +9075,7 @@ func (m *awsAwsjson11_deserializeOpSearchGameSessions) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorSearchGameSessions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorRegisterCompute(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)} @@ -8633,24 +9116,18 @@ func awsAwsjson11_deserializeOpErrorSearchGameSessions(response *smithyhttp.Resp } switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServiceException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - - case strings.EqualFold("TerminalRoutingStrategyException", errorCode): - return awsAwsjson11_deserializeErrorTerminalRoutingStrategyException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) - case strings.EqualFold("UnsupportedRegionException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8661,14 +9138,14 @@ func awsAwsjson11_deserializeOpErrorSearchGameSessions(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpStartFleetActions struct { +type awsAwsjson11_deserializeOpRegisterGameServer struct { } -func (*awsAwsjson11_deserializeOpStartFleetActions) ID() string { +func (*awsAwsjson11_deserializeOpRegisterGameServer) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartFleetActions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpRegisterGameServer) 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) @@ -8682,9 +9159,9 @@ func (m *awsAwsjson11_deserializeOpStartFleetActions) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartFleetActions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorRegisterGameServer(response, &metadata) } - output := &StartFleetActionsOutput{} + output := &RegisterGameServerOutput{} out.Result = output var buff [1024]byte @@ -8704,7 +9181,7 @@ func (m *awsAwsjson11_deserializeOpStartFleetActions) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartFleetActionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentRegisterGameServerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8718,7 +9195,7 @@ func (m *awsAwsjson11_deserializeOpStartFleetActions) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartFleetActions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorRegisterGameServer(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)} @@ -8759,21 +9236,21 @@ func awsAwsjson11_deserializeOpErrorStartFleetActions(response *smithyhttp.Respo } switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServiceException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) - case strings.EqualFold("UnsupportedRegionException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8784,14 +9261,14 @@ func awsAwsjson11_deserializeOpErrorStartFleetActions(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpStartGameSessionPlacement struct { +type awsAwsjson11_deserializeOpRequestUploadCredentials struct { } -func (*awsAwsjson11_deserializeOpStartGameSessionPlacement) ID() string { +func (*awsAwsjson11_deserializeOpRequestUploadCredentials) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartGameSessionPlacement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpRequestUploadCredentials) 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) @@ -8805,9 +9282,9 @@ func (m *awsAwsjson11_deserializeOpStartGameSessionPlacement) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartGameSessionPlacement(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorRequestUploadCredentials(response, &metadata) } - output := &StartGameSessionPlacementOutput{} + output := &RequestUploadCredentialsOutput{} out.Result = output var buff [1024]byte @@ -8827,7 +9304,7 @@ func (m *awsAwsjson11_deserializeOpStartGameSessionPlacement) HandleDeserialize( return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartGameSessionPlacementOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentRequestUploadCredentialsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8841,7 +9318,7 @@ func (m *awsAwsjson11_deserializeOpStartGameSessionPlacement) HandleDeserialize( return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartGameSessionPlacement(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorRequestUploadCredentials(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)} @@ -8904,14 +9381,14 @@ func awsAwsjson11_deserializeOpErrorStartGameSessionPlacement(response *smithyht } } -type awsAwsjson11_deserializeOpStartMatchBackfill struct { +type awsAwsjson11_deserializeOpResolveAlias struct { } -func (*awsAwsjson11_deserializeOpStartMatchBackfill) ID() string { +func (*awsAwsjson11_deserializeOpResolveAlias) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartMatchBackfill) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpResolveAlias) 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) @@ -8925,9 +9402,9 @@ func (m *awsAwsjson11_deserializeOpStartMatchBackfill) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartMatchBackfill(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorResolveAlias(response, &metadata) } - output := &StartMatchBackfillOutput{} + output := &ResolveAliasOutput{} out.Result = output var buff [1024]byte @@ -8947,7 +9424,7 @@ func (m *awsAwsjson11_deserializeOpStartMatchBackfill) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartMatchBackfillOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentResolveAliasOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8961,7 +9438,7 @@ func (m *awsAwsjson11_deserializeOpStartMatchBackfill) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartMatchBackfill(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorResolveAlias(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)} @@ -9011,8 +9488,11 @@ func awsAwsjson11_deserializeOpErrorStartMatchBackfill(response *smithyhttp.Resp case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnsupportedRegionException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) + case strings.EqualFold("TerminalRoutingStrategyException", errorCode): + return awsAwsjson11_deserializeErrorTerminalRoutingStrategyException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9024,14 +9504,14 @@ func awsAwsjson11_deserializeOpErrorStartMatchBackfill(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpStartMatchmaking struct { +type awsAwsjson11_deserializeOpResumeGameServerGroup struct { } -func (*awsAwsjson11_deserializeOpStartMatchmaking) ID() string { +func (*awsAwsjson11_deserializeOpResumeGameServerGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartMatchmaking) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpResumeGameServerGroup) 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) @@ -9045,9 +9525,9 @@ func (m *awsAwsjson11_deserializeOpStartMatchmaking) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartMatchmaking(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorResumeGameServerGroup(response, &metadata) } - output := &StartMatchmakingOutput{} + output := &ResumeGameServerGroupOutput{} out.Result = output var buff [1024]byte @@ -9067,7 +9547,7 @@ func (m *awsAwsjson11_deserializeOpStartMatchmaking) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartMatchmakingOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentResumeGameServerGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9081,7 +9561,7 @@ func (m *awsAwsjson11_deserializeOpStartMatchmaking) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartMatchmaking(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorResumeGameServerGroup(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)} @@ -9131,8 +9611,8 @@ func awsAwsjson11_deserializeOpErrorStartMatchmaking(response *smithyhttp.Respon case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnsupportedRegionException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9144,14 +9624,14 @@ func awsAwsjson11_deserializeOpErrorStartMatchmaking(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpStopFleetActions struct { +type awsAwsjson11_deserializeOpSearchGameSessions struct { } -func (*awsAwsjson11_deserializeOpStopFleetActions) ID() string { +func (*awsAwsjson11_deserializeOpSearchGameSessions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStopFleetActions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpSearchGameSessions) 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) @@ -9165,9 +9645,9 @@ func (m *awsAwsjson11_deserializeOpStopFleetActions) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStopFleetActions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorSearchGameSessions(response, &metadata) } - output := &StopFleetActionsOutput{} + output := &SearchGameSessionsOutput{} out.Result = output var buff [1024]byte @@ -9187,7 +9667,7 @@ func (m *awsAwsjson11_deserializeOpStopFleetActions) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStopFleetActionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentSearchGameSessionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9201,7 +9681,7 @@ func (m *awsAwsjson11_deserializeOpStopFleetActions) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStopFleetActions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorSearchGameSessions(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)} @@ -9251,6 +9731,9 @@ func awsAwsjson11_deserializeOpErrorStopFleetActions(response *smithyhttp.Respon case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("TerminalRoutingStrategyException", errorCode): + return awsAwsjson11_deserializeErrorTerminalRoutingStrategyException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) @@ -9267,14 +9750,14 @@ func awsAwsjson11_deserializeOpErrorStopFleetActions(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpStopGameSessionPlacement struct { +type awsAwsjson11_deserializeOpStartFleetActions struct { } -func (*awsAwsjson11_deserializeOpStopGameSessionPlacement) ID() string { +func (*awsAwsjson11_deserializeOpStartFleetActions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStopGameSessionPlacement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStartFleetActions) 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) @@ -9288,9 +9771,9 @@ func (m *awsAwsjson11_deserializeOpStopGameSessionPlacement) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStopGameSessionPlacement(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStartFleetActions(response, &metadata) } - output := &StopGameSessionPlacementOutput{} + output := &StartFleetActionsOutput{} out.Result = output var buff [1024]byte @@ -9310,7 +9793,7 @@ func (m *awsAwsjson11_deserializeOpStopGameSessionPlacement) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStopGameSessionPlacementOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStartFleetActionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9324,7 +9807,7 @@ func (m *awsAwsjson11_deserializeOpStopGameSessionPlacement) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStopGameSessionPlacement(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStartFleetActions(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)} @@ -9377,6 +9860,9 @@ func awsAwsjson11_deserializeOpErrorStopGameSessionPlacement(response *smithyhtt case strings.EqualFold("UnauthorizedException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("UnsupportedRegionException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9387,14 +9873,14 @@ func awsAwsjson11_deserializeOpErrorStopGameSessionPlacement(response *smithyhtt } } -type awsAwsjson11_deserializeOpStopMatchmaking struct { +type awsAwsjson11_deserializeOpStartGameSessionPlacement struct { } -func (*awsAwsjson11_deserializeOpStopMatchmaking) ID() string { +func (*awsAwsjson11_deserializeOpStartGameSessionPlacement) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStopMatchmaking) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStartGameSessionPlacement) 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) @@ -9408,9 +9894,9 @@ func (m *awsAwsjson11_deserializeOpStopMatchmaking) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStopMatchmaking(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStartGameSessionPlacement(response, &metadata) } - output := &StopMatchmakingOutput{} + output := &StartGameSessionPlacementOutput{} out.Result = output var buff [1024]byte @@ -9430,7 +9916,7 @@ func (m *awsAwsjson11_deserializeOpStopMatchmaking) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStopMatchmakingOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStartGameSessionPlacementOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9444,7 +9930,7 @@ func (m *awsAwsjson11_deserializeOpStopMatchmaking) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStopMatchmaking(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStartGameSessionPlacement(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)} @@ -9494,8 +9980,8 @@ func awsAwsjson11_deserializeOpErrorStopMatchmaking(response *smithyhttp.Respons case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnsupportedRegionException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9507,14 +9993,14 @@ func awsAwsjson11_deserializeOpErrorStopMatchmaking(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpSuspendGameServerGroup struct { +type awsAwsjson11_deserializeOpStartMatchBackfill struct { } -func (*awsAwsjson11_deserializeOpSuspendGameServerGroup) ID() string { +func (*awsAwsjson11_deserializeOpStartMatchBackfill) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpSuspendGameServerGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStartMatchBackfill) 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) @@ -9528,9 +10014,9 @@ func (m *awsAwsjson11_deserializeOpSuspendGameServerGroup) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorSuspendGameServerGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStartMatchBackfill(response, &metadata) } - output := &SuspendGameServerGroupOutput{} + output := &StartMatchBackfillOutput{} out.Result = output var buff [1024]byte @@ -9550,7 +10036,7 @@ func (m *awsAwsjson11_deserializeOpSuspendGameServerGroup) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentSuspendGameServerGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStartMatchBackfillOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9564,7 +10050,7 @@ func (m *awsAwsjson11_deserializeOpSuspendGameServerGroup) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorSuspendGameServerGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStartMatchBackfill(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)} @@ -9614,8 +10100,8 @@ func awsAwsjson11_deserializeOpErrorSuspendGameServerGroup(response *smithyhttp. case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("UnsupportedRegionException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9627,14 +10113,14 @@ func awsAwsjson11_deserializeOpErrorSuspendGameServerGroup(response *smithyhttp. } } -type awsAwsjson11_deserializeOpTagResource struct { +type awsAwsjson11_deserializeOpStartMatchmaking struct { } -func (*awsAwsjson11_deserializeOpTagResource) ID() string { +func (*awsAwsjson11_deserializeOpStartMatchmaking) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStartMatchmaking) 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) @@ -9648,9 +10134,9 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStartMatchmaking(response, &metadata) } - output := &TagResourceOutput{} + output := &StartMatchmakingOutput{} out.Result = output var buff [1024]byte @@ -9670,7 +10156,7 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStartMatchmakingOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9684,7 +10170,7 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStartMatchmaking(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)} @@ -9734,8 +10220,8 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("TaggingFailedException", errorCode): - return awsAwsjson11_deserializeErrorTaggingFailedException(response, errorBody) + case strings.EqualFold("UnsupportedRegionException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9747,14 +10233,14 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpUntagResource struct { +type awsAwsjson11_deserializeOpStopFleetActions struct { } -func (*awsAwsjson11_deserializeOpUntagResource) ID() string { +func (*awsAwsjson11_deserializeOpStopFleetActions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStopFleetActions) 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) @@ -9768,9 +10254,9 @@ func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStopFleetActions(response, &metadata) } - output := &UntagResourceOutput{} + output := &StopFleetActionsOutput{} out.Result = output var buff [1024]byte @@ -9790,7 +10276,7 @@ func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStopFleetActionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9804,7 +10290,7 @@ func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStopFleetActions(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)} @@ -9854,8 +10340,11 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("TaggingFailedException", errorCode): - return awsAwsjson11_deserializeErrorTaggingFailedException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("UnsupportedRegionException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9867,14 +10356,14 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpUpdateAlias struct { +type awsAwsjson11_deserializeOpStopGameSessionPlacement struct { } -func (*awsAwsjson11_deserializeOpUpdateAlias) ID() string { +func (*awsAwsjson11_deserializeOpStopGameSessionPlacement) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStopGameSessionPlacement) 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) @@ -9888,9 +10377,9 @@ func (m *awsAwsjson11_deserializeOpUpdateAlias) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAlias(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStopGameSessionPlacement(response, &metadata) } - output := &UpdateAliasOutput{} + output := &StopGameSessionPlacementOutput{} out.Result = output var buff [1024]byte @@ -9910,7 +10399,7 @@ func (m *awsAwsjson11_deserializeOpUpdateAlias) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateAliasOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStopGameSessionPlacementOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9924,7 +10413,7 @@ func (m *awsAwsjson11_deserializeOpUpdateAlias) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStopGameSessionPlacement(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)} @@ -9987,14 +10476,14 @@ func awsAwsjson11_deserializeOpErrorUpdateAlias(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpUpdateBuild struct { +type awsAwsjson11_deserializeOpStopMatchmaking struct { } -func (*awsAwsjson11_deserializeOpUpdateBuild) ID() string { +func (*awsAwsjson11_deserializeOpStopMatchmaking) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateBuild) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStopMatchmaking) 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) @@ -10008,9 +10497,9 @@ func (m *awsAwsjson11_deserializeOpUpdateBuild) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateBuild(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStopMatchmaking(response, &metadata) } - output := &UpdateBuildOutput{} + output := &StopMatchmakingOutput{} out.Result = output var buff [1024]byte @@ -10030,7 +10519,7 @@ func (m *awsAwsjson11_deserializeOpUpdateBuild) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateBuildOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStopMatchmakingOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10044,7 +10533,7 @@ func (m *awsAwsjson11_deserializeOpUpdateBuild) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateBuild(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStopMatchmaking(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)} @@ -10094,8 +10583,8 @@ func awsAwsjson11_deserializeOpErrorUpdateBuild(response *smithyhttp.Response, m case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("UnsupportedRegionException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -10107,14 +10596,14 @@ func awsAwsjson11_deserializeOpErrorUpdateBuild(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpUpdateFleetAttributes struct { +type awsAwsjson11_deserializeOpSuspendGameServerGroup struct { } -func (*awsAwsjson11_deserializeOpUpdateFleetAttributes) ID() string { +func (*awsAwsjson11_deserializeOpSuspendGameServerGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateFleetAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpSuspendGameServerGroup) 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) @@ -10128,9 +10617,9 @@ func (m *awsAwsjson11_deserializeOpUpdateFleetAttributes) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateFleetAttributes(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorSuspendGameServerGroup(response, &metadata) } - output := &UpdateFleetAttributesOutput{} + output := &SuspendGameServerGroupOutput{} out.Result = output var buff [1024]byte @@ -10150,7 +10639,7 @@ func (m *awsAwsjson11_deserializeOpUpdateFleetAttributes) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateFleetAttributesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentSuspendGameServerGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10164,7 +10653,7 @@ func (m *awsAwsjson11_deserializeOpUpdateFleetAttributes) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateFleetAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorSuspendGameServerGroup(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)} @@ -10205,21 +10694,12 @@ func awsAwsjson11_deserializeOpErrorUpdateFleetAttributes(response *smithyhttp.R } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson11_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) - case strings.EqualFold("InvalidFleetStatusException", errorCode): - return awsAwsjson11_deserializeErrorInvalidFleetStatusException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) @@ -10236,14 +10716,14 @@ func awsAwsjson11_deserializeOpErrorUpdateFleetAttributes(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpUpdateFleetCapacity struct { +type awsAwsjson11_deserializeOpTagResource struct { } -func (*awsAwsjson11_deserializeOpUpdateFleetCapacity) ID() string { +func (*awsAwsjson11_deserializeOpTagResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateFleetCapacity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_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) @@ -10257,9 +10737,9 @@ func (m *awsAwsjson11_deserializeOpUpdateFleetCapacity) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateFleetCapacity(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) } - output := &UpdateFleetCapacityOutput{} + output := &TagResourceOutput{} out.Result = output var buff [1024]byte @@ -10279,7 +10759,7 @@ func (m *awsAwsjson11_deserializeOpUpdateFleetCapacity) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateFleetCapacityOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10293,7 +10773,7 @@ func (m *awsAwsjson11_deserializeOpUpdateFleetCapacity) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateFleetCapacity(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_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)} @@ -10334,29 +10814,17 @@ func awsAwsjson11_deserializeOpErrorUpdateFleetCapacity(response *smithyhttp.Res } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson11_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) - case strings.EqualFold("InvalidFleetStatusException", errorCode): - return awsAwsjson11_deserializeErrorInvalidFleetStatusException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) - - case strings.EqualFold("UnsupportedRegionException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) + case strings.EqualFold("TaggingFailedException", errorCode): + return awsAwsjson11_deserializeErrorTaggingFailedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -10368,14 +10836,14 @@ func awsAwsjson11_deserializeOpErrorUpdateFleetCapacity(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpUpdateFleetPortSettings struct { +type awsAwsjson11_deserializeOpUntagResource struct { } -func (*awsAwsjson11_deserializeOpUpdateFleetPortSettings) ID() string { +func (*awsAwsjson11_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateFleetPortSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_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) @@ -10389,9 +10857,9 @@ func (m *awsAwsjson11_deserializeOpUpdateFleetPortSettings) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateFleetPortSettings(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) } - output := &UpdateFleetPortSettingsOutput{} + output := &UntagResourceOutput{} out.Result = output var buff [1024]byte @@ -10411,7 +10879,7 @@ func (m *awsAwsjson11_deserializeOpUpdateFleetPortSettings) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateFleetPortSettingsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10425,7 +10893,7 @@ func (m *awsAwsjson11_deserializeOpUpdateFleetPortSettings) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateFleetPortSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_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)} @@ -10466,26 +10934,17 @@ func awsAwsjson11_deserializeOpErrorUpdateFleetPortSettings(response *smithyhttp } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson11_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) - case strings.EqualFold("InvalidFleetStatusException", errorCode): - return awsAwsjson11_deserializeErrorInvalidFleetStatusException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("TaggingFailedException", errorCode): + return awsAwsjson11_deserializeErrorTaggingFailedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -10497,7 +10956,637 @@ func awsAwsjson11_deserializeOpErrorUpdateFleetPortSettings(response *smithyhttp } } -type awsAwsjson11_deserializeOpUpdateGameServer struct { +type awsAwsjson11_deserializeOpUpdateAlias struct { +} + +func (*awsAwsjson11_deserializeOpUpdateAlias) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateAlias) 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, awsAwsjson11_deserializeOpErrorUpdateAlias(response, &metadata) + } + output := &UpdateAliasOutput{} + 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 = awsAwsjson11_deserializeOpDocumentUpdateAliasOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateAlias(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateBuild struct { +} + +func (*awsAwsjson11_deserializeOpUpdateBuild) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateBuild) 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, awsAwsjson11_deserializeOpErrorUpdateBuild(response, &metadata) + } + output := &UpdateBuildOutput{} + 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 = awsAwsjson11_deserializeOpDocumentUpdateBuildOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateBuild(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateFleetAttributes struct { +} + +func (*awsAwsjson11_deserializeOpUpdateFleetAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateFleetAttributes) 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, awsAwsjson11_deserializeOpErrorUpdateFleetAttributes(response, &metadata) + } + output := &UpdateFleetAttributesOutput{} + 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 = awsAwsjson11_deserializeOpDocumentUpdateFleetAttributesOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateFleetAttributes(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidFleetStatusException", errorCode): + return awsAwsjson11_deserializeErrorInvalidFleetStatusException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateFleetCapacity struct { +} + +func (*awsAwsjson11_deserializeOpUpdateFleetCapacity) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateFleetCapacity) 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, awsAwsjson11_deserializeOpErrorUpdateFleetCapacity(response, &metadata) + } + output := &UpdateFleetCapacityOutput{} + 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 = awsAwsjson11_deserializeOpDocumentUpdateFleetCapacityOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateFleetCapacity(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidFleetStatusException", errorCode): + return awsAwsjson11_deserializeErrorInvalidFleetStatusException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("UnsupportedRegionException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedRegionException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateFleetPortSettings struct { +} + +func (*awsAwsjson11_deserializeOpUpdateFleetPortSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateFleetPortSettings) 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, awsAwsjson11_deserializeOpErrorUpdateFleetPortSettings(response, &metadata) + } + output := &UpdateFleetPortSettingsOutput{} + 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 = awsAwsjson11_deserializeOpDocumentUpdateFleetPortSettingsOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateFleetPortSettings(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidFleetStatusException", errorCode): + return awsAwsjson11_deserializeErrorInvalidFleetStatusException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsAwsjson11_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsAwsjson11_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateGameServer struct { } func (*awsAwsjson11_deserializeOpUpdateGameServer) ID() string { @@ -12126,6 +13215,46 @@ func awsAwsjson11_deserializeDocumentAliasList(v *[]types.Alias, value interface return nil } +func awsAwsjson11_deserializeDocumentAnywhereConfiguration(v **types.AnywhereConfiguration, 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.AnywhereConfiguration + if *v == nil { + sv = &types.AnywhereConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Cost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonNegativeLimitedLengthDouble to be of type string, got %T instead", value) + } + sv.Cost = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentAttributeValue(v **types.AttributeValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12186,18 +13315,18 @@ func awsAwsjson11_deserializeDocumentAttributeValue(v **types.AttributeValue, va if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonZeroAndMaxString to be of type string, got %T instead", value) + return fmt.Errorf("expected PlayerAttributeString to be of type string, got %T instead", value) } sv.S = ptr.String(jtv) } case "SDM": - if err := awsAwsjson11_deserializeDocumentStringDoubleMap(&sv.SDM, value); err != nil { + if err := awsAwsjson11_deserializeDocumentPlayerAttributeStringDoubleMap(&sv.SDM, value); err != nil { return err } case "SL": - if err := awsAwsjson11_deserializeDocumentStringList(&sv.SL, value); err != nil { + if err := awsAwsjson11_deserializeDocumentPlayerAttributeStringList(&sv.SL, value); err != nil { return err } @@ -12342,6 +13471,15 @@ func awsAwsjson11_deserializeDocumentBuild(v **types.Build, value interface{}) e sv.OperatingSystem = types.OperatingSystem(jtv) } + case "ServerSdkVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServerSdkVersion to be of type string, got %T instead", value) + } + sv.ServerSdkVersion = ptr.String(jtv) + } + case "SizeOnDisk": if value != nil { jtv, ok := value.(json.Number) @@ -12382,7 +13520,227 @@ func awsAwsjson11_deserializeDocumentBuild(v **types.Build, value interface{}) e return nil } -func awsAwsjson11_deserializeDocumentBuildList(v *[]types.Build, value interface{}) error { +func awsAwsjson11_deserializeDocumentBuildList(v *[]types.Build, 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.Build + if *v == nil { + cv = []types.Build{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Build + destAddr := &col + if err := awsAwsjson11_deserializeDocumentBuild(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentCertificateConfiguration(v **types.CertificateConfiguration, 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.CertificateConfiguration + if *v == nil { + sv = &types.CertificateConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CertificateType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateType to be of type string, got %T instead", value) + } + sv.CertificateType = types.CertificateType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentCompute(v **types.Compute, 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.Compute + if *v == nil { + sv = &types.Compute{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ComputeArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComputeArn to be of type string, got %T instead", value) + } + sv.ComputeArn = ptr.String(jtv) + } + + case "ComputeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComputeName to be of type string, got %T instead", value) + } + sv.ComputeName = ptr.String(jtv) + } + + case "ComputeStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComputeStatus to be of type string, got %T instead", value) + } + sv.ComputeStatus = types.ComputeStatus(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DnsName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DnsName to be of type string, got %T instead", value) + } + sv.DnsName = ptr.String(jtv) + } + + case "FleetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetArn to be of type string, got %T instead", value) + } + sv.FleetArn = ptr.String(jtv) + } + + case "FleetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetId to be of type string, got %T instead", value) + } + sv.FleetId = ptr.String(jtv) + } + + case "GameLiftServiceSdkEndpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GameLiftServiceSdkEndpointOutput to be of type string, got %T instead", value) + } + sv.GameLiftServiceSdkEndpoint = ptr.String(jtv) + } + + case "IpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IpAddress to be of type string, got %T instead", value) + } + sv.IpAddress = ptr.String(jtv) + } + + case "Location": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LocationStringModel to be of type string, got %T instead", value) + } + sv.Location = ptr.String(jtv) + } + + case "OperatingSystem": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperatingSystem to be of type string, got %T instead", value) + } + sv.OperatingSystem = types.OperatingSystem(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EC2InstanceType to be of type string, got %T instead", value) + } + sv.Type = types.EC2InstanceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentComputeList(v *[]types.Compute, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12395,17 +13753,17 @@ func awsAwsjson11_deserializeDocumentBuildList(v *[]types.Build, value interface return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Build + var cv []types.Compute if *v == nil { - cv = []types.Build{} + cv = []types.Compute{} } else { cv = *v } for _, value := range shape { - var col types.Build + var col types.Compute destAddr := &col - if err := awsAwsjson11_deserializeDocumentBuild(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentCompute(&destAddr, value); err != nil { return err } col = *destAddr @@ -12416,46 +13774,6 @@ func awsAwsjson11_deserializeDocumentBuildList(v *[]types.Build, value interface return nil } -func awsAwsjson11_deserializeDocumentCertificateConfiguration(v **types.CertificateConfiguration, 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.CertificateConfiguration - if *v == nil { - sv = &types.CertificateConfiguration{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CertificateType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateType to be of type string, got %T instead", value) - } - sv.CertificateType = types.CertificateType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12947,6 +14265,11 @@ func awsAwsjson11_deserializeDocumentFleetAttributes(v **types.FleetAttributes, for key, value := range shape { switch key { + case "AnywhereConfiguration": + if err := awsAwsjson11_deserializeDocumentAnywhereConfiguration(&sv.AnywhereConfiguration, value); err != nil { + return err + } + case "BuildArn": if value != nil { jtv, ok := value.(string) @@ -12970,6 +14293,15 @@ func awsAwsjson11_deserializeDocumentFleetAttributes(v **types.FleetAttributes, return err } + case "ComputeType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComputeType to be of type string, got %T instead", value) + } + sv.ComputeType = types.ComputeType(jtv) + } + case "CreationTime": if value != nil { switch jtv := value.(type) { @@ -14369,7 +15701,7 @@ func awsAwsjson11_deserializeDocumentGameSessionConnectionInfo(v **types.GameSes if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected StringModel to be of type string, got %T instead", value) + return fmt.Errorf("expected IpAddress to be of type string, got %T instead", value) } sv.IpAddress = ptr.String(jtv) } @@ -15840,6 +17172,89 @@ func awsAwsjson11_deserializeDocumentLocationList(v *[]string, value interface{} return nil } +func awsAwsjson11_deserializeDocumentLocationModel(v **types.LocationModel, 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.LocationModel + if *v == nil { + sv = &types.LocationModel{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LocationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LocationArnModel to be of type string, got %T instead", value) + } + sv.LocationArn = ptr.String(jtv) + } + + case "LocationName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LocationStringModel to be of type string, got %T instead", value) + } + sv.LocationName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentLocationModelList(v *[]types.LocationModel, 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.LocationModel + if *v == nil { + cv = []types.LocationModel{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LocationModel + destAddr := &col + if err := awsAwsjson11_deserializeDocumentLocationModel(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentLocationState(v **types.LocationState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16810,6 +18225,103 @@ func awsAwsjson11_deserializeDocumentPlayerAttributeMap(v *map[string]types.Attr return nil } +func awsAwsjson11_deserializeDocumentPlayerAttributeStringDoubleMap(v *map[string]float64, 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]float64 + if *v == nil { + mv = map[string]float64{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal float64 + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + parsedVal = f64 + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + parsedVal = f64 + + default: + return fmt.Errorf("expected DoubleObject to be a JSON Number, got %T instead", value) + + } + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsAwsjson11_deserializeDocumentPlayerAttributeStringList(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 PlayerAttributeString to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentPlayerLatency(v **types.PlayerLatency, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18009,49 +19521,15 @@ func awsAwsjson11_deserializeDocumentServerProcess(v **types.ServerProcess, valu } default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentServerProcessList(v *[]types.ServerProcess, 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.ServerProcess - if *v == nil { - cv = []types.ServerProcess{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ServerProcess - destAddr := &col - if err := awsAwsjson11_deserializeDocumentServerProcess(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentStringDoubleMap(v *map[string]float64, value interface{}) error { +func awsAwsjson11_deserializeDocumentServerProcessList(v *[]types.ServerProcess, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -18059,56 +19537,29 @@ func awsAwsjson11_deserializeDocumentStringDoubleMap(v *map[string]float64, valu return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]float64 + var cv []types.ServerProcess if *v == nil { - mv = map[string]float64{} + cv = []types.ServerProcess{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal float64 - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - parsedVal = f64 - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - parsedVal = f64 - - default: - return fmt.Errorf("expected DoubleObject to be a JSON Number, got %T instead", value) - - } + for _, value := range shape { + var col types.ServerProcess + destAddr := &col + if err := awsAwsjson11_deserializeDocumentServerProcess(&destAddr, value); err != nil { + return err } - mv[key] = parsedVal + col = *destAddr + cv = append(cv, col) } - *v = mv + *v = cv return nil } @@ -19105,6 +20556,42 @@ func awsAwsjson11_deserializeOpDocumentCreateGameSessionQueueOutput(v **CreateGa return nil } +func awsAwsjson11_deserializeOpDocumentCreateLocationOutput(v **CreateLocationOutput, 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 *CreateLocationOutput + if *v == nil { + sv = &CreateLocationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Location": + if err := awsAwsjson11_deserializeDocumentLocationModel(&sv.Location, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateMatchmakingConfigurationOutput(v **CreateMatchmakingConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -19473,6 +20960,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteGameSessionQueueOutput(v **DeleteGa return nil } +func awsAwsjson11_deserializeOpDocumentDeleteLocationOutput(v **DeleteLocationOutput, 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 *DeleteLocationOutput + if *v == nil { + sv = &DeleteLocationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteMatchmakingConfigurationOutput(v **DeleteMatchmakingConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -19597,6 +21115,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteVpcPeeringConnectionOutput(v **Dele return nil } +func awsAwsjson11_deserializeOpDocumentDeregisterComputeOutput(v **DeregisterComputeOutput, 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 *DeregisterComputeOutput + if *v == nil { + sv = &DeregisterComputeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeAliasOutput(v **DescribeAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -19669,6 +21218,42 @@ func awsAwsjson11_deserializeOpDocumentDescribeBuildOutput(v **DescribeBuildOutp return nil } +func awsAwsjson11_deserializeOpDocumentDescribeComputeOutput(v **DescribeComputeOutput, 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 *DescribeComputeOutput + if *v == nil { + sv = &DescribeComputeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Compute": + if err := awsAwsjson11_deserializeDocumentCompute(&sv.Compute, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeEC2InstanceLimitsOutput(v **DescribeEC2InstanceLimitsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -20609,17 +22194,98 @@ func awsAwsjson11_deserializeOpDocumentDescribeRuntimeConfigurationOutput(v **De return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeRuntimeConfigurationOutput + var sv *DescribeRuntimeConfigurationOutput + if *v == nil { + sv = &DescribeRuntimeConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RuntimeConfiguration": + if err := awsAwsjson11_deserializeDocumentRuntimeConfiguration(&sv.RuntimeConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDescribeScalingPoliciesOutput(v **DescribeScalingPoliciesOutput, 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 *DescribeScalingPoliciesOutput + if *v == nil { + sv = &DescribeScalingPoliciesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonZeroAndMaxString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ScalingPolicies": + if err := awsAwsjson11_deserializeDocumentScalingPolicyList(&sv.ScalingPolicies, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDescribeScriptOutput(v **DescribeScriptOutput, 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 *DescribeScriptOutput if *v == nil { - sv = &DescribeRuntimeConfigurationOutput{} + sv = &DescribeScriptOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "RuntimeConfiguration": - if err := awsAwsjson11_deserializeDocumentRuntimeConfiguration(&sv.RuntimeConfiguration, value); err != nil { + case "Script": + if err := awsAwsjson11_deserializeDocumentScript(&sv.Script, value); err != nil { return err } @@ -20632,7 +22298,7 @@ func awsAwsjson11_deserializeOpDocumentDescribeRuntimeConfigurationOutput(v **De return nil } -func awsAwsjson11_deserializeOpDocumentDescribeScalingPoliciesOutput(v **DescribeScalingPoliciesOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDescribeVpcPeeringAuthorizationsOutput(v **DescribeVpcPeeringAuthorizationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20645,26 +22311,17 @@ func awsAwsjson11_deserializeOpDocumentDescribeScalingPoliciesOutput(v **Describ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeScalingPoliciesOutput + var sv *DescribeVpcPeeringAuthorizationsOutput if *v == nil { - sv = &DescribeScalingPoliciesOutput{} + sv = &DescribeVpcPeeringAuthorizationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonZeroAndMaxString to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "ScalingPolicies": - if err := awsAwsjson11_deserializeDocumentScalingPolicyList(&sv.ScalingPolicies, value); err != nil { + case "VpcPeeringAuthorizations": + if err := awsAwsjson11_deserializeDocumentVpcPeeringAuthorizationList(&sv.VpcPeeringAuthorizations, value); err != nil { return err } @@ -20677,7 +22334,7 @@ func awsAwsjson11_deserializeOpDocumentDescribeScalingPoliciesOutput(v **Describ return nil } -func awsAwsjson11_deserializeOpDocumentDescribeScriptOutput(v **DescribeScriptOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDescribeVpcPeeringConnectionsOutput(v **DescribeVpcPeeringConnectionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20690,17 +22347,17 @@ func awsAwsjson11_deserializeOpDocumentDescribeScriptOutput(v **DescribeScriptOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeScriptOutput + var sv *DescribeVpcPeeringConnectionsOutput if *v == nil { - sv = &DescribeScriptOutput{} + sv = &DescribeVpcPeeringConnectionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Script": - if err := awsAwsjson11_deserializeDocumentScript(&sv.Script, value); err != nil { + case "VpcPeeringConnections": + if err := awsAwsjson11_deserializeDocumentVpcPeeringConnectionList(&sv.VpcPeeringConnections, value); err != nil { return err } @@ -20713,7 +22370,7 @@ func awsAwsjson11_deserializeOpDocumentDescribeScriptOutput(v **DescribeScriptOu return nil } -func awsAwsjson11_deserializeOpDocumentDescribeVpcPeeringAuthorizationsOutput(v **DescribeVpcPeeringAuthorizationsOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentGetComputeAccessOutput(v **GetComputeAccessOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20726,20 +22383,56 @@ func awsAwsjson11_deserializeOpDocumentDescribeVpcPeeringAuthorizationsOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeVpcPeeringAuthorizationsOutput + var sv *GetComputeAccessOutput if *v == nil { - sv = &DescribeVpcPeeringAuthorizationsOutput{} + sv = &GetComputeAccessOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "VpcPeeringAuthorizations": - if err := awsAwsjson11_deserializeDocumentVpcPeeringAuthorizationList(&sv.VpcPeeringAuthorizations, value); err != nil { + case "ComputeArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComputeArn to be of type string, got %T instead", value) + } + sv.ComputeArn = ptr.String(jtv) + } + + case "ComputeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComputeNameOrArn to be of type string, got %T instead", value) + } + sv.ComputeName = ptr.String(jtv) + } + + case "Credentials": + if err := awsAwsjson11_deserializeDocumentAwsCredentials(&sv.Credentials, value); err != nil { return err } + case "FleetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetArn to be of type string, got %T instead", value) + } + sv.FleetArn = ptr.String(jtv) + } + + case "FleetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetIdOrArn to be of type string, got %T instead", value) + } + sv.FleetId = ptr.String(jtv) + } + default: _, _ = key, value @@ -20749,7 +22442,7 @@ func awsAwsjson11_deserializeOpDocumentDescribeVpcPeeringAuthorizationsOutput(v return nil } -func awsAwsjson11_deserializeOpDocumentDescribeVpcPeeringConnectionsOutput(v **DescribeVpcPeeringConnectionsOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentGetComputeAuthTokenOutput(v **GetComputeAuthTokenOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20762,18 +22455,74 @@ func awsAwsjson11_deserializeOpDocumentDescribeVpcPeeringConnectionsOutput(v **D return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeVpcPeeringConnectionsOutput + var sv *GetComputeAuthTokenOutput if *v == nil { - sv = &DescribeVpcPeeringConnectionsOutput{} + sv = &GetComputeAuthTokenOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "VpcPeeringConnections": - if err := awsAwsjson11_deserializeDocumentVpcPeeringConnectionList(&sv.VpcPeeringConnections, value); err != nil { - return err + case "AuthToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComputeAuthToken to be of type string, got %T instead", value) + } + sv.AuthToken = ptr.String(jtv) + } + + case "ComputeArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComputeArn to be of type string, got %T instead", value) + } + sv.ComputeArn = ptr.String(jtv) + } + + case "ComputeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComputeNameOrArn to be of type string, got %T instead", value) + } + sv.ComputeName = ptr.String(jtv) + } + + case "ExpirationTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExpirationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "FleetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetArn to be of type string, got %T instead", value) + } + sv.FleetArn = ptr.String(jtv) + } + + case "FleetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetIdOrArn to be of type string, got %T instead", value) + } + sv.FleetId = ptr.String(jtv) } default: @@ -20951,6 +22700,51 @@ func awsAwsjson11_deserializeOpDocumentListBuildsOutput(v **ListBuildsOutput, va return nil } +func awsAwsjson11_deserializeOpDocumentListComputeOutput(v **ListComputeOutput, 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 *ListComputeOutput + if *v == nil { + sv = &ListComputeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ComputeList": + if err := awsAwsjson11_deserializeDocumentComputeList(&sv.ComputeList, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonZeroAndMaxString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListFleetsOutput(v **ListFleetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21086,6 +22880,51 @@ func awsAwsjson11_deserializeOpDocumentListGameServersOutput(v **ListGameServers return nil } +func awsAwsjson11_deserializeOpDocumentListLocationsOutput(v **ListLocationsOutput, 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 *ListLocationsOutput + if *v == nil { + sv = &ListLocationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Locations": + if err := awsAwsjson11_deserializeDocumentLocationModelList(&sv.Locations, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonZeroAndMaxString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListScriptsOutput(v **ListScriptsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21207,6 +23046,42 @@ func awsAwsjson11_deserializeOpDocumentPutScalingPolicyOutput(v **PutScalingPoli return nil } +func awsAwsjson11_deserializeOpDocumentRegisterComputeOutput(v **RegisterComputeOutput, 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 *RegisterComputeOutput + if *v == nil { + sv = &RegisterComputeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Compute": + if err := awsAwsjson11_deserializeDocumentCompute(&sv.Compute, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentRegisterGameServerOutput(v **RegisterGameServerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21879,6 +23754,15 @@ func awsAwsjson11_deserializeOpDocumentUpdateFleetAttributesOutput(v **UpdateFle for key, value := range shape { switch key { + case "FleetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetArn to be of type string, got %T instead", value) + } + sv.FleetArn = ptr.String(jtv) + } + case "FleetId": if value != nil { jtv, ok := value.(string) @@ -21977,6 +23861,15 @@ func awsAwsjson11_deserializeOpDocumentUpdateFleetPortSettingsOutput(v **UpdateF for key, value := range shape { switch key { + case "FleetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FleetArn to be of type string, got %T instead", value) + } + sv.FleetArn = ptr.String(jtv) + } + case "FleetId": if value != nil { jtv, ok := value.(string) diff --git a/service/gamelift/doc.go b/service/gamelift/doc.go index 4cba70ace75..67808ffe9c9 100644 --- a/service/gamelift/doc.go +++ b/service/gamelift/doc.go @@ -3,13 +3,13 @@ // Package gamelift provides the API client, operations, and parameter types for // Amazon GameLift. // -// GameLift Service Amazon Web Services provides solutions for hosting -// session-based multiplayer game servers in the cloud, including tools for -// deploying, operating, and scaling game servers. Built on Amazon Web Services -// global computing infrastructure, GameLift helps you deliver high-performance, -// high-reliability, low-cost game servers while dynamically scaling your resource -// usage to meet player demand. About GameLift solutions Get more information on -// these GameLift solutions in the GameLift Developer Guide +// Amazon GameLift provides solutions for hosting session-based multiplayer game +// servers in the cloud, including tools for deploying, operating, and scaling game +// servers. Built on Amazon Web Services global computing infrastructure, GameLift +// helps you deliver high-performance, high-reliability, low-cost game servers +// while dynamically scaling your resource usage to meet player demand. About +// GameLift solutions Get more information on these GameLift solutions in the +// GameLift Developer Guide // (https://docs.aws.amazon.com/gamelift/latest/developerguide/). // // * GameLift @@ -40,7 +40,7 @@ // solution. // // About this API Reference This reference guide describes the low-level -// service API for Amazon Web Services. With each topic in this guide, you can find +// service API for Amazon GameLift. With each topic in this guide, you can find // links to language-specific SDK guides and the Amazon Web Services CLI reference. // Useful links: // diff --git a/service/gamelift/generated.json b/service/gamelift/generated.json index 2eb54b6e0a8..aa26ee08b5d 100644 --- a/service/gamelift/generated.json +++ b/service/gamelift/generated.json @@ -17,6 +17,7 @@ "api_op_CreateGameServerGroup.go", "api_op_CreateGameSession.go", "api_op_CreateGameSessionQueue.go", + "api_op_CreateLocation.go", "api_op_CreateMatchmakingConfiguration.go", "api_op_CreateMatchmakingRuleSet.go", "api_op_CreatePlayerSession.go", @@ -30,15 +31,18 @@ "api_op_DeleteFleetLocations.go", "api_op_DeleteGameServerGroup.go", "api_op_DeleteGameSessionQueue.go", + "api_op_DeleteLocation.go", "api_op_DeleteMatchmakingConfiguration.go", "api_op_DeleteMatchmakingRuleSet.go", "api_op_DeleteScalingPolicy.go", "api_op_DeleteScript.go", "api_op_DeleteVpcPeeringAuthorization.go", "api_op_DeleteVpcPeeringConnection.go", + "api_op_DeregisterCompute.go", "api_op_DeregisterGameServer.go", "api_op_DescribeAlias.go", "api_op_DescribeBuild.go", + "api_op_DescribeCompute.go", "api_op_DescribeEC2InstanceLimits.go", "api_op_DescribeFleetAttributes.go", "api_op_DescribeFleetCapacity.go", @@ -65,16 +69,21 @@ "api_op_DescribeScript.go", "api_op_DescribeVpcPeeringAuthorizations.go", "api_op_DescribeVpcPeeringConnections.go", + "api_op_GetComputeAccess.go", + "api_op_GetComputeAuthToken.go", "api_op_GetGameSessionLogUrl.go", "api_op_GetInstanceAccess.go", "api_op_ListAliases.go", "api_op_ListBuilds.go", + "api_op_ListCompute.go", "api_op_ListFleets.go", "api_op_ListGameServerGroups.go", "api_op_ListGameServers.go", + "api_op_ListLocations.go", "api_op_ListScripts.go", "api_op_ListTagsForResource.go", "api_op_PutScalingPolicy.go", + "api_op_RegisterCompute.go", "api_op_RegisterGameServer.go", "api_op_RequestUploadCredentials.go", "api_op_ResolveAlias.go", diff --git a/service/gamelift/serializers.go b/service/gamelift/serializers.go index 209feb7b0ba..430d5d8ff32 100644 --- a/service/gamelift/serializers.go +++ b/service/gamelift/serializers.go @@ -512,6 +512,61 @@ func (m *awsAwsjson11_serializeOpCreateGameSessionQueue) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateLocation struct { +} + +func (*awsAwsjson11_serializeOpCreateLocation) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateLocation) 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.(*CreateLocationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.CreateLocation") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateLocationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCreateMatchmakingConfiguration struct { } @@ -1227,6 +1282,61 @@ func (m *awsAwsjson11_serializeOpDeleteGameSessionQueue) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteLocation struct { +} + +func (*awsAwsjson11_serializeOpDeleteLocation) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteLocation) 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.(*DeleteLocationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.DeleteLocation") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteLocationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeleteMatchmakingConfiguration struct { } @@ -1557,6 +1667,61 @@ func (m *awsAwsjson11_serializeOpDeleteVpcPeeringConnection) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeregisterCompute struct { +} + +func (*awsAwsjson11_serializeOpDeregisterCompute) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeregisterCompute) 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.(*DeregisterComputeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.DeregisterCompute") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeregisterComputeInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeregisterGameServer struct { } @@ -1722,6 +1887,61 @@ func (m *awsAwsjson11_serializeOpDescribeBuild) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribeCompute struct { +} + +func (*awsAwsjson11_serializeOpDescribeCompute) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeCompute) 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.(*DescribeComputeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.DescribeCompute") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeComputeInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDescribeEC2InstanceLimits struct { } @@ -3152,6 +3372,116 @@ func (m *awsAwsjson11_serializeOpDescribeVpcPeeringConnections) HandleSerialize( return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetComputeAccess struct { +} + +func (*awsAwsjson11_serializeOpGetComputeAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetComputeAccess) 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.(*GetComputeAccessInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.GetComputeAccess") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetComputeAccessInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpGetComputeAuthToken struct { +} + +func (*awsAwsjson11_serializeOpGetComputeAuthToken) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetComputeAuthToken) 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.(*GetComputeAuthTokenInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.GetComputeAuthToken") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetComputeAuthTokenInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpGetGameSessionLogUrl struct { } @@ -3372,6 +3702,61 @@ func (m *awsAwsjson11_serializeOpListBuilds) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListCompute struct { +} + +func (*awsAwsjson11_serializeOpListCompute) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListCompute) 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.(*ListComputeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.ListCompute") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListComputeInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListFleets struct { } @@ -3537,6 +3922,61 @@ func (m *awsAwsjson11_serializeOpListGameServers) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListLocations struct { +} + +func (*awsAwsjson11_serializeOpListLocations) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListLocations) 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.(*ListLocationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.ListLocations") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListLocationsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListScripts struct { } @@ -3552,7 +3992,62 @@ func (m *awsAwsjson11_serializeOpListScripts) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListScriptsInput) + input, ok := in.Parameters.(*ListScriptsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.ListScripts") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListScriptsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_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)} @@ -3573,10 +4068,10 @@ func (m *awsAwsjson11_serializeOpListScripts) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.ListScripts") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.ListTagsForResource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListScriptsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3592,14 +4087,14 @@ func (m *awsAwsjson11_serializeOpListScripts) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListTagsForResource struct { +type awsAwsjson11_serializeOpPutScalingPolicy struct { } -func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_serializeOpPutScalingPolicy) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpPutScalingPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3607,7 +4102,7 @@ func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListTagsForResourceInput) + input, ok := in.Parameters.(*PutScalingPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3628,10 +4123,10 @@ func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.ListTagsForResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.PutScalingPolicy") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentPutScalingPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3647,14 +4142,14 @@ func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpPutScalingPolicy struct { +type awsAwsjson11_serializeOpRegisterCompute struct { } -func (*awsAwsjson11_serializeOpPutScalingPolicy) ID() string { +func (*awsAwsjson11_serializeOpRegisterCompute) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpPutScalingPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpRegisterCompute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3662,7 +4157,7 @@ func (m *awsAwsjson11_serializeOpPutScalingPolicy) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*PutScalingPolicyInput) + input, ok := in.Parameters.(*RegisterComputeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3683,10 +4178,10 @@ func (m *awsAwsjson11_serializeOpPutScalingPolicy) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.PutScalingPolicy") + httpBindingEncoder.SetHeader("X-Amz-Target").String("GameLift.RegisterCompute") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentPutScalingPolicyInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentRegisterComputeInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -5241,6 +5736,18 @@ func (m *awsAwsjson11_serializeOpValidateMatchmakingRuleSet) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +func awsAwsjson11_serializeDocumentAnywhereConfiguration(v *types.AnywhereConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Cost != nil { + ok := object.Key("Cost") + ok.String(*v.Cost) + } + + return nil +} + func awsAwsjson11_serializeDocumentAttributeValue(v *types.AttributeValue, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5270,14 +5777,14 @@ func awsAwsjson11_serializeDocumentAttributeValue(v *types.AttributeValue, value if v.SDM != nil { ok := object.Key("SDM") - if err := awsAwsjson11_serializeDocumentStringDoubleMap(v.SDM, ok); err != nil { + if err := awsAwsjson11_serializeDocumentPlayerAttributeStringDoubleMap(v.SDM, ok); err != nil { return err } } if v.SL != nil { ok := object.Key("SL") - if err := awsAwsjson11_serializeDocumentStringList(v.SL, ok); err != nil { + if err := awsAwsjson11_serializeDocumentPlayerAttributeStringList(v.SL, ok); err != nil { return err } } @@ -5598,6 +6105,17 @@ func awsAwsjson11_serializeDocumentLocationConfigurationList(v []types.LocationC return nil } +func awsAwsjson11_serializeDocumentLocationFilterList(v []types.LocationFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsAwsjson11_serializeDocumentLocationList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -5698,6 +6216,41 @@ func awsAwsjson11_serializeDocumentPlayerAttributeMap(v map[string]types.Attribu return nil } +func awsAwsjson11_serializeDocumentPlayerAttributeStringDoubleMap(v map[string]float64, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + switch { + case math.IsNaN(v[key]): + om.String("NaN") + + case math.IsInf(v[key], 1): + om.String("Infinity") + + case math.IsInf(v[key], -1): + om.String("-Infinity") + + default: + om.Double(v[key]) + + } + } + return nil +} + +func awsAwsjson11_serializeDocumentPlayerAttributeStringList(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_serializeDocumentPlayerDataMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5979,30 +6532,6 @@ func awsAwsjson11_serializeDocumentServerProcessList(v []types.ServerProcess, va return nil } -func awsAwsjson11_serializeDocumentStringDoubleMap(v map[string]float64, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - switch { - case math.IsNaN(v[key]): - om.String("NaN") - - case math.IsInf(v[key], 1): - om.String("Infinity") - - case math.IsInf(v[key], -1): - om.String("-Infinity") - - default: - om.Double(v[key]) - - } - } - return nil -} - func awsAwsjson11_serializeDocumentStringList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -6207,6 +6736,11 @@ func awsAwsjson11_serializeOpDocumentCreateBuildInput(v *CreateBuildInput, value ok.String(string(v.OperatingSystem)) } + if v.ServerSdkVersion != nil { + ok := object.Key("ServerSdkVersion") + ok.String(*v.ServerSdkVersion) + } + if v.StorageLocation != nil { ok := object.Key("StorageLocation") if err := awsAwsjson11_serializeDocumentS3Location(v.StorageLocation, ok); err != nil { @@ -6233,6 +6767,13 @@ func awsAwsjson11_serializeOpDocumentCreateFleetInput(v *CreateFleetInput, value object := value.Object() defer object.Close() + if v.AnywhereConfiguration != nil { + ok := object.Key("AnywhereConfiguration") + if err := awsAwsjson11_serializeDocumentAnywhereConfiguration(v.AnywhereConfiguration, ok); err != nil { + return err + } + } + if v.BuildId != nil { ok := object.Key("BuildId") ok.String(*v.BuildId) @@ -6245,6 +6786,11 @@ func awsAwsjson11_serializeOpDocumentCreateFleetInput(v *CreateFleetInput, value } } + if len(v.ComputeType) > 0 { + ok := object.Key("ComputeType") + ok.String(string(v.ComputeType)) + } + if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) @@ -6564,6 +7110,25 @@ func awsAwsjson11_serializeOpDocumentCreateGameSessionQueueInput(v *CreateGameSe return nil } +func awsAwsjson11_serializeOpDocumentCreateLocationInput(v *CreateLocationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LocationName != nil { + ok := object.Key("LocationName") + ok.String(*v.LocationName) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateMatchmakingConfigurationInput(v *CreateMatchmakingConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6883,6 +7448,18 @@ func awsAwsjson11_serializeOpDocumentDeleteGameSessionQueueInput(v *DeleteGameSe return nil } +func awsAwsjson11_serializeOpDocumentDeleteLocationInput(v *DeleteLocationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LocationName != nil { + ok := object.Key("LocationName") + ok.String(*v.LocationName) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteMatchmakingConfigurationInput(v *DeleteMatchmakingConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6970,6 +7547,23 @@ func awsAwsjson11_serializeOpDocumentDeleteVpcPeeringConnectionInput(v *DeleteVp return nil } +func awsAwsjson11_serializeOpDocumentDeregisterComputeInput(v *DeregisterComputeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComputeName != nil { + ok := object.Key("ComputeName") + ok.String(*v.ComputeName) + } + + if v.FleetId != nil { + ok := object.Key("FleetId") + ok.String(*v.FleetId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeregisterGameServerInput(v *DeregisterGameServerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7011,6 +7605,23 @@ func awsAwsjson11_serializeOpDocumentDescribeBuildInput(v *DescribeBuildInput, v return nil } +func awsAwsjson11_serializeOpDocumentDescribeComputeInput(v *DescribeComputeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComputeName != nil { + ok := object.Key("ComputeName") + ok.String(*v.ComputeName) + } + + if v.FleetId != nil { + ok := object.Key("FleetId") + ok.String(*v.FleetId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeEC2InstanceLimitsInput(v *DescribeEC2InstanceLimitsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7601,6 +8212,40 @@ func awsAwsjson11_serializeOpDocumentDescribeVpcPeeringConnectionsInput(v *Descr return nil } +func awsAwsjson11_serializeOpDocumentGetComputeAccessInput(v *GetComputeAccessInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComputeName != nil { + ok := object.Key("ComputeName") + ok.String(*v.ComputeName) + } + + if v.FleetId != nil { + ok := object.Key("FleetId") + ok.String(*v.FleetId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetComputeAuthTokenInput(v *GetComputeAuthTokenInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComputeName != nil { + ok := object.Key("ComputeName") + ok.String(*v.ComputeName) + } + + if v.FleetId != nil { + ok := object.Key("FleetId") + ok.String(*v.FleetId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetGameSessionLogUrlInput(v *GetGameSessionLogUrlInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7679,6 +8324,33 @@ func awsAwsjson11_serializeOpDocumentListBuildsInput(v *ListBuildsInput, value s return nil } +func awsAwsjson11_serializeOpDocumentListComputeInput(v *ListComputeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FleetId != nil { + ok := object.Key("FleetId") + ok.String(*v.FleetId) + } + + if v.Limit != nil { + ok := object.Key("Limit") + ok.Integer(*v.Limit) + } + + if v.Location != nil { + ok := object.Key("Location") + ok.String(*v.Location) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListFleetsInput(v *ListFleetsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7750,6 +8422,30 @@ func awsAwsjson11_serializeOpDocumentListGameServersInput(v *ListGameServersInpu return nil } +func awsAwsjson11_serializeOpDocumentListLocationsInput(v *ListLocationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson11_serializeDocumentLocationFilterList(v.Filters, ok); err != nil { + return err + } + } + + if v.Limit != nil { + ok := object.Key("Limit") + ok.Integer(*v.Limit) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListScriptsInput(v *ListScriptsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7851,6 +8547,43 @@ func awsAwsjson11_serializeOpDocumentPutScalingPolicyInput(v *PutScalingPolicyIn return nil } +func awsAwsjson11_serializeOpDocumentRegisterComputeInput(v *RegisterComputeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CertificatePath != nil { + ok := object.Key("CertificatePath") + ok.String(*v.CertificatePath) + } + + if v.ComputeName != nil { + ok := object.Key("ComputeName") + ok.String(*v.ComputeName) + } + + if v.DnsName != nil { + ok := object.Key("DnsName") + ok.String(*v.DnsName) + } + + if v.FleetId != nil { + ok := object.Key("FleetId") + ok.String(*v.FleetId) + } + + if v.IpAddress != nil { + ok := object.Key("IpAddress") + ok.String(*v.IpAddress) + } + + if v.Location != nil { + ok := object.Key("Location") + ok.String(*v.Location) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentRegisterGameServerInput(v *RegisterGameServerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -8258,6 +8991,13 @@ func awsAwsjson11_serializeOpDocumentUpdateFleetAttributesInput(v *UpdateFleetAt object := value.Object() defer object.Close() + if v.AnywhereConfiguration != nil { + ok := object.Key("AnywhereConfiguration") + if err := awsAwsjson11_serializeDocumentAnywhereConfiguration(v.AnywhereConfiguration, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) diff --git a/service/gamelift/types/enums.go b/service/gamelift/types/enums.go index 85331bb42a8..f54fe0e6afe 100644 --- a/service/gamelift/types/enums.go +++ b/service/gamelift/types/enums.go @@ -118,6 +118,44 @@ func (ComparisonOperatorType) Values() []ComparisonOperatorType { } } +type ComputeStatus string + +// Enum values for ComputeStatus +const ( + ComputeStatusPending ComputeStatus = "PENDING" + ComputeStatusActive ComputeStatus = "ACTIVE" + ComputeStatusTerminating ComputeStatus = "TERMINATING" +) + +// Values returns all known values for ComputeStatus. 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 (ComputeStatus) Values() []ComputeStatus { + return []ComputeStatus{ + "PENDING", + "ACTIVE", + "TERMINATING", + } +} + +type ComputeType string + +// Enum values for ComputeType +const ( + ComputeTypeEc2 ComputeType = "EC2" + ComputeTypeAnywhere ComputeType = "ANYWHERE" +) + +// Values returns all known values for ComputeType. 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 (ComputeType) Values() []ComputeType { + return []ComputeType{ + "EC2", + "ANYWHERE", + } +} + type EC2InstanceType string // Enum values for EC2InstanceType @@ -397,6 +435,7 @@ const ( EventCodeFleetVpcPeeringFailed EventCode = "FLEET_VPC_PEERING_FAILED" EventCodeFleetVpcPeeringDeleted EventCode = "FLEET_VPC_PEERING_DELETED" EventCodeInstanceInterrupted EventCode = "INSTANCE_INTERRUPTED" + EventCodeInstanceRecycled EventCode = "INSTANCE_RECYCLED" ) // Values returns all known values for EventCode. Note that this can be expanded in @@ -437,6 +476,7 @@ func (EventCode) Values() []EventCode { "FLEET_VPC_PEERING_FAILED", "FLEET_VPC_PEERING_DELETED", "INSTANCE_INTERRUPTED", + "INSTANCE_RECYCLED", } } @@ -469,6 +509,7 @@ const ( FleetStatusDeleting FleetStatus = "DELETING" FleetStatusError FleetStatus = "ERROR" FleetStatusTerminated FleetStatus = "TERMINATED" + FleetStatusNotFound FleetStatus = "NOT_FOUND" ) // Values returns all known values for FleetStatus. Note that this can be expanded @@ -485,6 +526,7 @@ func (FleetStatus) Values() []FleetStatus { "DELETING", "ERROR", "TERMINATED", + "NOT_FOUND", } } @@ -968,6 +1010,24 @@ func (IpProtocol) Values() []IpProtocol { } } +type LocationFilter string + +// Enum values for LocationFilter +const ( + LocationFilterAws LocationFilter = "AWS" + LocationFilterCustom LocationFilter = "CUSTOM" +) + +// Values returns all known values for LocationFilter. 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 (LocationFilter) Values() []LocationFilter { + return []LocationFilter{ + "AWS", + "CUSTOM", + } +} + type LocationUpdateStatus string // Enum values for LocationUpdateStatus @@ -1019,17 +1079,18 @@ type MetricName string // Enum values for MetricName const ( - MetricNameActivatingGameSessions MetricName = "ActivatingGameSessions" - MetricNameActiveGameSessions MetricName = "ActiveGameSessions" - MetricNameActiveInstances MetricName = "ActiveInstances" - MetricNameAvailableGameSessions MetricName = "AvailableGameSessions" - MetricNameAvailablePlayerSessions MetricName = "AvailablePlayerSessions" - MetricNameCurrentPlayerSessions MetricName = "CurrentPlayerSessions" - MetricNameIdleInstances MetricName = "IdleInstances" - MetricNamePercentAvailableGameSessions MetricName = "PercentAvailableGameSessions" - MetricNamePercentIdleInstances MetricName = "PercentIdleInstances" - MetricNameQueueDepth MetricName = "QueueDepth" - MetricNameWaitTime MetricName = "WaitTime" + MetricNameActivatingGameSessions MetricName = "ActivatingGameSessions" + MetricNameActiveGameSessions MetricName = "ActiveGameSessions" + MetricNameActiveInstances MetricName = "ActiveInstances" + MetricNameAvailableGameSessions MetricName = "AvailableGameSessions" + MetricNameAvailablePlayerSessions MetricName = "AvailablePlayerSessions" + MetricNameCurrentPlayerSessions MetricName = "CurrentPlayerSessions" + MetricNameIdleInstances MetricName = "IdleInstances" + MetricNamePercentAvailableGameSessions MetricName = "PercentAvailableGameSessions" + MetricNamePercentIdleInstances MetricName = "PercentIdleInstances" + MetricNameQueueDepth MetricName = "QueueDepth" + MetricNameWaitTime MetricName = "WaitTime" + MetricNameConcurrentActivatableGameSessions MetricName = "ConcurrentActivatableGameSessions" ) // Values returns all known values for MetricName. Note that this can be expanded @@ -1048,6 +1109,7 @@ func (MetricName) Values() []MetricName { "PercentIdleInstances", "QueueDepth", "WaitTime", + "ConcurrentActivatableGameSessions", } } diff --git a/service/gamelift/types/errors.go b/service/gamelift/types/errors.go index 014aef8a2f6..8d0b7384745 100644 --- a/service/gamelift/types/errors.go +++ b/service/gamelift/types/errors.go @@ -196,8 +196,8 @@ func (e *LimitExceededException) ErrorMessage() string { func (e *LimitExceededException) ErrorCode() string { return "LimitExceededException" } func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// A service resource associated with the request could not be found. Clients -// should not retry such requests. +// THe requested resources was not found. The resource was either not created yet +// or deleted. type NotFoundException struct { Message *string diff --git a/service/gamelift/types/types.go b/service/gamelift/types/types.go index 8f5978f9882..96ab7579de6 100644 --- a/service/gamelift/types/types.go +++ b/service/gamelift/types/types.go @@ -7,9 +7,7 @@ import ( "time" ) -// Properties that describe an alias resource. Related actions CreateAlias | -// ListAliases | DescribeAlias | UpdateAlias | DeleteAlias | ResolveAlias | All -// APIs by task +// Properties that describe an alias resource. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) type Alias struct { @@ -46,7 +44,21 @@ type Alias struct { noSmithyDocumentSerde } -// Values for use in Player attribute key-value pairs. This object lets you specify +// GameLift Anywhere configuration options for your Anywhere fleets. +type AnywhereConfiguration struct { + + // The cost to run your fleet per hour. GameLift uses the provided cost of your + // fleet to balance usage in queues. For more information about queues, see Setting + // up queues + // (https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-intro.html). + // + // This member is required. + Cost *string + + noSmithyDocumentSerde +} + +// Values for use in player attribute key-value pairs. This object lets you specify // an attribute value using any of the valid data types: string, number, string // array, or data map. Each AttributeValue object can use only one of the available // properties. @@ -72,7 +84,8 @@ type AttributeValue struct { // Temporary access credentials used for uploading game build files to Amazon // GameLift. They are valid for a limited time. If they expire before you upload -// your game build, get a new set by calling RequestUploadCredentials. +// your game build, get a new set by calling RequestUploadCredentials +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_RequestUploadCredentials.html). type AwsCredentials struct { // Temporary key allowing access to the Amazon GameLift S3 account. @@ -88,15 +101,14 @@ type AwsCredentials struct { noSmithyDocumentSerde } -// Properties describing a custom game build. Related actions CreateBuild | -// ListBuilds | DescribeBuild | UpdateBuild | DeleteBuild | All APIs by task +// Properties describing a custom game build. All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) type Build struct { // The Amazon Resource Name (ARN - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) that is - // assigned to a GameLift build resource and uniquely identifies it. ARNs are - // unique across all Regions. Format is + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) assigned + // to a GameLift build resource and uniquely identifies it. ARNs are unique across + // all Regions. Format is // arn:aws:gamelift:::build/build-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912. In a // GameLift build ARN, the resource ID matches the BuildId value. BuildArn *string @@ -108,14 +120,20 @@ type Build struct { // expressed in Unix time as milliseconds (for example "1469498468.057"). CreationTime *time.Time - // A descriptive label that is associated with a build. Build names do not need to - // be unique. It can be set using CreateBuild or UpdateBuild. + // A descriptive label associated with a build. Build names do not need to be + // unique. It can be set using CreateBuild + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateBuild.html) + // or UpdateBuild + // (https://docs.aws.amazon.com/gamelift/latest/apireference/UpdateBuild). Name *string // Operating system that the game server binaries are built to run on. This value // determines the type of fleet resources that you can use for this build. OperatingSystem OperatingSystem + // The GameLift Server SDK version used to develop your game server. + ServerSdkVersion *string + // File size of the uploaded game build, expressed in bytes. When the build status // is INITIALIZED or when using a custom Amazon S3 storage location, this value is // 0. @@ -136,9 +154,8 @@ type Build struct { // fleets for this build. Status BuildStatus - // Version information that is associated with a build or script. Version strings - // do not need to be unique. This value can be set using CreateBuild or - // UpdateBuild. + // Version information associated with a build or script. Version strings do not + // need to be unique. Version *string noSmithyDocumentSerde @@ -148,8 +165,7 @@ type Build struct { // must be enabled when creating the fleet. All instances in a fleet share the same // certificate. The certificate can be retrieved by calling the GameLift Server SDK // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk.html) -// operation GetInstanceCertificate. A fleet's certificate configuration is part of -// FleetAttributes. +// operation GetInstanceCertificate. type CertificateConfiguration struct { // Indicates whether a TLS/SSL certificate is generated for a fleet. Valid values @@ -166,8 +182,60 @@ type CertificateConfiguration struct { noSmithyDocumentSerde } +// Resources used to host your game servers. A compute resource can be managed +// GameLift Amazon EC2 instances or your own resources. +type Compute struct { + + // The ARN that is assigned to the compute resource and uniquely identifies it. + // ARNs are unique across locations. + ComputeArn *string + + // A descriptive label that is associated with the compute resource registered to + // your fleet. + ComputeName *string + + // Current status of the compute. A compute must have an ACTIVE status to host game + // sessions. + ComputeStatus ComputeStatus + + // A time stamp indicating when this data object was created. Format is a number + // expressed in Unix time as milliseconds (for example "1469498468.057"). + CreationTime *time.Time + + // The DNS name of the compute resource. GameLift requires the DNS name or IP + // address to manage your compute resource. + DnsName *string + + // The Amazon Resource Name (ARN) of the fleet that the compute is registered to. + FleetArn *string + + // A unique identifier for the fleet that the compute is registered to. + FleetId *string + + // The endpoint connection details of the GameLift SDK endpoint that your game + // server connects to. + GameLiftServiceSdkEndpoint *string + + // The IP address of the compute resource. GameLift requires the DNS name or IP + // address to manage your compute resource. + IpAddress *string + + // The name of the custom location you added to the fleet that this compute + // resource resides in. + Location *string + + // The type of operating system on your compute resource. + OperatingSystem OperatingSystem + + // Which compute type that the fleet uses. A fleet can use Anywhere compute + // resources owned by you or managed Amazon EC2 instances. + Type EC2InstanceType + + noSmithyDocumentSerde +} + // Player information for use when creating player sessions using a game session -// placement request with StartGameSessionPlacement. +// placement request. type DesiredPlayerSession struct { // Developer-defined information related to a player. GameLift does not use this @@ -182,8 +250,7 @@ type DesiredPlayerSession struct { // Resource capacity settings. Fleet capacity is measured in Amazon EC2 instances. // Pending and terminating counts are non-zero when the fleet capacity is adjusting -// to a scaling event or if access to resources is temporarily affected. EC2 -// instance counts are part of FleetCapacity. +// to a scaling event or if access to resources is temporarily affected. type EC2InstanceCounts struct { // Actual number of instances that are ready to host game sessions. @@ -216,8 +283,7 @@ type EC2InstanceCounts struct { // utilization. GameLift allows Amazon Web Services accounts a maximum number of // instances, per instance type, per Amazon Web Services Region or location, for // use with GameLift. You can request an limit increase for your account by using -// the Service limits page in the GameLift console. Related actions -// DescribeEC2InstanceLimits +// the Service limits page in the GameLift console. type EC2InstanceLimit struct { // The number of instances for the specified type and location that are currently @@ -241,8 +307,7 @@ type EC2InstanceLimit struct { // Log entry describing an event that involves GameLift resources (such as a // fleet). In addition to tracking activity, event codes and messages can provide -// additional information for troubleshooting and debugging problems. Related -// actions DescribeFleetEvents +// additional information for troubleshooting and debugging problems. type Event struct { // The type of event being logged. Fleet state transition events: @@ -342,11 +407,11 @@ type Event struct { // in your Amazon Web Services account. // // * FLEET_VPC_PEERING_FAILED -- A requested - // VPC peering connection has failed. Event details and status information (see - // DescribeVpcPeeringConnections) provide additional detail. A common reason for - // peering failure is that the two VPCs have overlapping CIDR blocks of IPv4 - // addresses. To resolve this, change the CIDR block for the VPC in your Amazon Web - // Services account. For more information on VPC peering failures, see + // VPC peering connection has failed. Event details and status information provide + // additional detail. A common reason for peering failure is that the two VPCs have + // overlapping CIDR blocks of IPv4 addresses. To resolve this, change the CIDR + // block for the VPC in your Amazon Web Services account. For more information on + // VPC peering failures, see // https://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/invalid-peering-configurations.html // (https://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/invalid-peering-configurations.html) // @@ -359,7 +424,7 @@ type Event struct { // * INSTANCE_INTERRUPTED -- A spot instance was // interrupted by EC2 with a two-minute notification. // - // Spot process events: + // Server process events: // // * // SERVER_PROCESS_INVALID_PATH -- The game server executable or script could not be @@ -443,8 +508,7 @@ type Event struct { // A list of fleet locations where a game session queue can place new game // sessions. You can use a filter to temporarily turn off placements for specific // locations. For queues that have multi-location fleets, you can use a filter -// configuration allow placement with some, but not all of these locations. Filter -// configurations are part of a GameSessionQueue. +// configuration allow placement with some, but not all of these locations. type FilterConfiguration struct { // A list of locations to allow game session placement in, in the form of Amazon @@ -455,9 +519,11 @@ type FilterConfiguration struct { } // Describes a GameLift fleet of game hosting resources. Related actions -// CreateFleet | DescribeFleetAttributes type FleetAttributes struct { + // GameLift Anywhere configuration options for your Anywhere fleets. + AnywhereConfiguration *AnywhereConfiguration + // The Amazon Resource Name (ARN // (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) associated // with the GameLift build resource that is deployed on instances in this fleet. In @@ -468,9 +534,18 @@ type FleetAttributes struct { // fleet. BuildId *string - // Indicates whether a TLS/SSL certificate was generated for the fleet. + // Determines whether a TLS/SSL certificate is generated for a fleet. This feature + // must be enabled when creating the fleet. All instances in a fleet share the same + // certificate. The certificate can be retrieved by calling the GameLift Server SDK + // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk.html) + // operation GetInstanceCertificate. CertificateConfiguration *CertificateConfiguration + // The type of compute resource used to host your game servers. You can use your + // own compute resources with GameLift Anywhere or use Amazon EC2 instances with + // managed GameLift. + ComputeType ComputeType + // A time stamp indicating when this data object was created. Format is a number // expressed in Unix time as milliseconds (for example "1469498468.057"). CreationTime *time.Time @@ -489,7 +564,11 @@ type FleetAttributes struct { // A unique identifier for the fleet. FleetId *string - // The kind of instances, On-Demand or Spot, that this fleet uses. + // Indicates whether to use On-Demand or Spot instances for this fleet. By default, + // this property is set to ON_DEMAND. Learn more about when to use On-Demand + // versus Spot Instances + // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-ec2-instances.html#gamelift-ec2-instances-spot). + // This property cannot be changed after the fleet is created. FleetType FleetType // A unique identifier for an IAM role that manages access to your Amazon Web @@ -539,8 +618,12 @@ type FleetAttributes struct { // fleet. OperatingSystem OperatingSystem - // The fleet policy that limits the number of game sessions an individual player - // can create over a span of time. + // A policy that puts limits on the number of game sessions that a player can + // create within a specified span of time. With this policy, you can control + // players' ability to consume available resources. The policy is evaluated when a + // player tries to create a new game session. On receiving a CreateGameSession + // request, GameLift checks that the player (identified by CreatorId) has created + // fewer than game session limit in the specified time period. ResourceCreationLimitPolicy *ResourceCreationLimitPolicy // The Amazon Resource Name (ARN @@ -554,13 +637,14 @@ type FleetAttributes struct { ScriptId *string // This parameter is no longer used. Server launch parameters are now defined using - // the fleet's RuntimeConfiguration parameter. Requests that use this parameter - // instead continue to be valid. + // the fleet's runtime configuration . Requests that use this parameter instead + // continue to be valid. ServerLaunchParameters *string // This parameter is no longer used. Server launch paths are now defined using the - // fleet's RuntimeConfiguration parameter. Requests that use this parameter instead - // continue to be valid. + // fleet's RuntimeConfiguration + // (https://docs.aws.amazon.com/gamelift/latest/apireference/RuntimeConfiguration.html) + // . Requests that use this parameter instead continue to be valid. ServerLaunchPath *string // Current status of the fleet. Possible fleet statuses include the following: @@ -585,8 +669,9 @@ type FleetAttributes struct { // TERMINATED -- The fleet no longer exists. Status FleetStatus - // A list of fleet activity that has been suspended using StopFleetActions. This - // includes fleet auto-scaling. + // A list of fleet activity that has been suspended using StopFleetActions + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_StopFleetActions.html) + // . This includes fleet auto-scaling. StoppedActions []FleetAction // A time stamp indicating when this data object was terminated. Format is a number @@ -616,7 +701,9 @@ type FleetCapacity struct { // A unique identifier for the fleet associated with the location. FleetId *string - // The current instance count and capacity settings for the fleet location. + // Resource capacity settings. Fleet capacity is measured in Amazon EC2 instances. + // Pending and terminating counts are non-zero when the fleet capacity is adjusting + // to a scaling event or if access to resources is temporarily affected. InstanceCounts *EC2InstanceCounts // The Amazon EC2 instance type that is used for all instances in a fleet. The @@ -634,7 +721,7 @@ type FleetCapacity struct { // Current resource utilization statistics in a specified fleet or location. The // location value might refer to a fleet's remote location or its home Region. -// Related actions DescribeFleetUtilization | DescribeFleetLocationUtilization +// Related actions type FleetUtilization struct { // The number of active game sessions that are currently being hosted across all @@ -693,13 +780,10 @@ type GameProperty struct { } // This data type is used with the GameLift FleetIQ and game server groups. -// Properties describing a game server that is running on an instance in a -// GameServerGroup. A game server is created by a successful call to +// Properties describing a game server that is running on an instance in a game +// server group. A game server is created by a successful call to // RegisterGameServer and deleted by calling DeregisterGameServer. A game server is -// claimed to host a game session by calling ClaimGameServer. Related actions -// RegisterGameServer | ListGameServers | ClaimGameServer | DescribeGameServer | -// UpdateGameServer | DeregisterGameServer | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) +// claimed to host a game session by calling ClaimGameServer. type GameServer struct { // Indicates when an available game server has been reserved for gameplay but has @@ -716,14 +800,13 @@ type GameServer struct { // A set of custom game server properties, formatted as a single string value. This // data is passed to a game client or service when it requests information on game - // servers using ListGameServers or ClaimGameServer. + // servers. GameServerData *string // The ARN identifier for the game server group where the game server is located. GameServerGroupArn *string // A unique identifier for the game server group where the game server is running. - // Use either the GameServerGroup name or ARN value. GameServerGroupName *string // A custom string that uniquely identifies the game server. Game server IDs are @@ -736,22 +819,20 @@ type GameServer struct { // format, for example: i-1234567890abcdef0. InstanceId *string - // Timestamp that indicates the last time the game server was claimed with a - // ClaimGameServer request. The format is a number expressed in Unix time as - // milliseconds (for example "1469498468.057"). This value is used to calculate - // when a claimed game server's status should revert to null. + // Timestamp that indicates the last time the game server was claimed. The format + // is a number expressed in Unix time as milliseconds (for example + // "1469498468.057"). This value is used to calculate when a claimed game server's + // status should revert to null. LastClaimTime *time.Time // Timestamp that indicates the last time the game server was updated with health - // status using an UpdateGameServer request. The format is a number expressed in - // Unix time as milliseconds (for example "1469498468.057"). After game server - // registration, this property is only changed when a game server update specifies - // a health check value. + // status. The format is a number expressed in Unix time as milliseconds (for + // example "1469498468.057"). After game server registration, this property is only + // changed when a game server update specifies a health check value. LastHealthCheckTime *time.Time - // Timestamp that indicates when the game server was created with a - // RegisterGameServer request. The format is a number expressed in Unix time as - // milliseconds (for example "1469498468.057"). + // Timestamp that indicates when the game server registered. The format is a number + // expressed in Unix time as milliseconds (for example "1469498468.057"). RegistrationTime *time.Time // Indicates whether the game server is currently available for new games or is @@ -774,11 +855,7 @@ type GameServer struct { // group. A game server group is created by a successful call to // CreateGameServerGroup and deleted by calling DeleteGameServerGroup. Game server // group activity can be temporarily suspended and resumed by calling -// SuspendGameServerGroup and ResumeGameServerGroup, respectively. Related actions -// CreateGameServerGroup | ListGameServerGroups | DescribeGameServerGroup | -// UpdateGameServerGroup | DeleteGameServerGroup | ResumeGameServerGroup | -// SuspendGameServerGroup | DescribeGameServerInstances | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) +// SuspendGameServerGroup and ResumeGameServerGroup, respectively. type GameServerGroup struct { // A generated unique ID for the Amazon EC2 Auto Scaling group that is associated @@ -882,10 +959,9 @@ type GameServerGroup struct { // This data type is used with the GameLift FleetIQ and game server groups. // Configuration settings for intelligent automatic scaling that uses target // tracking. These settings are used to add an Auto Scaling policy when creating -// the corresponding Auto Scaling group with CreateGameServerGroup. After the Auto -// Scaling group is created, all updates to Auto Scaling policies, including -// changing this policy and adding or removing other policies, is done directly on -// the Auto Scaling group. +// the corresponding Auto Scaling group. After the Auto Scaling group is created, +// all updates to Auto Scaling policies, including changing this policy and adding +// or removing other policies, is done directly on the Auto Scaling group. type GameServerGroupAutoScalingPolicy struct { // Settings for a target-based scaling policy applied to Auto Scaling group. These @@ -911,11 +987,7 @@ type GameServerGroupAutoScalingPolicy struct { // server group. Instance configurations are set with game server group properties // (see DescribeGameServerGroup and with the EC2 launch template that was used when // creating the game server group. Retrieve game server instances for a game server -// group by calling DescribeGameServerInstances. Related actions -// CreateGameServerGroup | ListGameServerGroups | DescribeGameServerGroup | -// UpdateGameServerGroup | DeleteGameServerGroup | ResumeGameServerGroup | -// SuspendGameServerGroup | DescribeGameServerInstances | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html) +// group by calling DescribeGameServerInstances. type GameServerInstance struct { // A generated unique identifier for the game server group that includes the game @@ -932,21 +1004,7 @@ type GameServerInstance struct { // format, for example: i-1234567890abcdef0. InstanceId *string - // Current status of the game server instance. - // - // * ACTIVE -- The instance is viable - // for hosting game servers. - // - // * DRAINING -- The instance is not viable for hosting - // game servers. Existing game servers are in the process of ending, and new game - // servers are not started on this instance unless no other resources are - // available. When the instance is put in DRAINING, a new instance is started up to - // replace it. Once the instance has no UTILIZED game servers, it will be - // terminated in favor of the new instance. - // - // * SPOT_TERMINATING -- The instance is - // in the process of shutting down due to a Spot instance interruption. No new game - // servers are started on this instance. + // Current status of the game server instance InstanceStatus GameServerInstanceStatus noSmithyDocumentSerde @@ -956,10 +1014,7 @@ type GameServerInstance struct { // players. When a game session ends, its status is set to TERMINATED. Once the // session ends, the game session object is retained for 30 days. This means you // can reuse idempotency token values after this time. Game session logs are -// retained for 14 days. Related actions CreateGameSession | DescribeGameSessions | -// DescribeGameSessionDetails | SearchGameSessions | UpdateGameSession | -// GetGameSessionLogUrl | StartGameSessionPlacement | DescribeGameSessionPlacement -// | StopGameSessionPlacement | All APIs by task +// retained for 14 days. All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) type GameSession struct { @@ -999,16 +1054,14 @@ type GameSession struct { FleetId *string // A set of custom properties for a game session, formatted as key:value pairs. - // These properties are passed to a game server process in the GameSession object - // with a request to start a new game session (see Start a Game Session + // These properties are passed to a game server process with a request to start a + // new game session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). - // You can search for active game sessions based on this custom data with - // SearchGameSessions. GameProperties []GameProperty // A set of custom game session properties, formatted as a single string value. - // This data is passed to a game server process in the GameSession object with a - // request to start a new game session (see Start a Game Session + // This data is passed to a game server process with a request to start a new game + // session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). GameSessionData *string @@ -1069,11 +1122,10 @@ type GameSession struct { } // Connection information for a new game session that is created in response to a -// StartMatchmaking request. Once a match is made, the FlexMatch engine creates a +// start matchmaking request. Once a match is made, the FlexMatch engine creates a // new game session for it. This information, including the game session endpoint // and player sessions for each player in the original matchmaking request, is -// added to the MatchmakingTicket, which can be retrieved by calling -// DescribeMatchmaking. +// added to the matchmaking ticket. type GameSessionConnectionInfo struct { // The DNS identifier assigned to the instance that is running the game session. @@ -1128,17 +1180,8 @@ type GameSessionDetail struct { noSmithyDocumentSerde } -// Object that describes a StartGameSessionPlacement request. This object includes -// the full details of the original request plus the current status and start/end -// time stamps. Game session placement-related operations include: -// -// * -// StartGameSessionPlacement -// -// * DescribeGameSessionPlacement -// -// * -// StopGameSessionPlacement +// This object includes the full details of the original request plus the current +// status and start/end time stamps. type GameSessionPlacement struct { // The DNS identifier assigned to the instance that is running the game session. @@ -1160,8 +1203,8 @@ type GameSessionPlacement struct { EndTime *time.Time // A set of custom properties for a game session, formatted as key:value pairs. - // These properties are passed to a game server process in the GameSession object - // with a request to start a new game session (see Start a Game Session + // These properties are passed to a game server process with a request to start a + // new game session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). GameProperties []GameProperty @@ -1215,15 +1258,14 @@ type GameSessionPlacement struct { // session placement request. These player sessions are created only once a new // game session is successfully placed (placement status is FULFILLED). This // information includes the player ID (as provided in the placement request) and - // the corresponding player session ID. Retrieve full player sessions by calling - // DescribePlayerSessions with the player session ID. + // the corresponding player session ID. PlacedPlayerSessions []PlacedPlayerSession // A unique identifier for a game session placement. PlacementId *string // A set of values, expressed in milliseconds, that indicates the amount of latency - // that a player experiences when connected to @aws; Regions. + // that a player experiences when connected to Amazon Web Services Regions. PlayerLatencies []PlayerLatency // The port number for the game session. To connect to a GameLift game server, an @@ -1245,17 +1287,16 @@ type GameSessionPlacement struct { // successfully created. Values for GameSessionArn and GameSessionRegion are // available. // - // * CANCELLED -- The placement request was canceled with a call to - // StopGameSessionPlacement. + // * CANCELLED -- The placement request was canceled. // - // * TIMED_OUT -- A new game session was not - // successfully created before the time limit expired. You can resubmit the - // placement request as needed. + // * TIMED_OUT -- A + // new game session was not successfully created before the time limit expired. You + // can resubmit the placement request as needed. // - // * FAILED -- GameLift is not able to complete the - // process of placing the game session. Common reasons are the game session - // terminated before the placement process was completed, or an unexpected internal - // error. + // * FAILED -- GameLift is not able + // to complete the process of placing the game session. Common reasons are the game + // session terminated before the placement process was completed, or an unexpected + // internal error. Status GameSessionPlacementState noSmithyDocumentSerde @@ -1263,12 +1304,7 @@ type GameSessionPlacement struct { // Configuration for a game session placement mechanism that processes requests for // new game sessions. A queue can be used on its own or as part of a matchmaking -// solution. Related actions CreateGameSessionQueue -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateGameSessionQueue.html) -// | DescribeGameSessionQueues -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessionQueues.html) -// | UpdateGameSessionQueue -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSessionQueue.html) +// solution. type GameSessionQueue struct { // Information that is added to all events that are related to this game session @@ -1327,7 +1363,7 @@ type GameSessionQueue struct { // A fleet or alias designated in a game session queue. Queues fulfill requests for // new game sessions by placing a new game session on any of the queue's -// destinations. Destinations are part of a GameSessionQueue. +// destinations. type GameSessionQueueDestination struct { // The Amazon Resource Name (ARN) that is assigned to fleet or fleet alias. ARNs, @@ -1340,7 +1376,7 @@ type GameSessionQueueDestination struct { // Represents an EC2 instance of virtual computing resources that hosts one or more // game servers. In GameLift, a fleet can contain zero or more instances. Related -// actions DescribeInstances +// actions type Instance struct { // A time stamp indicating when this data object was created. Format is a number @@ -1408,8 +1444,7 @@ type Instance struct { noSmithyDocumentSerde } -// Information required to remotely connect to a fleet instance. Access is -// requested by calling GetInstanceAccess. +// Information required to remotely connect to a fleet instance. type InstanceAccess struct { // Credentials required to access the instance. @@ -1430,9 +1465,7 @@ type InstanceAccess struct { noSmithyDocumentSerde } -// Set of credentials required to remotely access a fleet instance. Access -// credentials are requested by calling GetInstanceAccess and returned in an -// InstanceAccess object. +// Set of credentials required to remotely access a fleet instance. type InstanceCredentials struct { // Secret string. For Windows instances, the secret is a password for use with @@ -1447,10 +1480,10 @@ type InstanceCredentials struct { } // This data type is used with the GameLift FleetIQ and game server groups. An -// allowed instance type for a GameServerGroup. All game server groups must have at -// least two instance types defined for it. GameLift FleetIQ periodically evaluates -// each defined instance type for viability. It then updates the Auto Scaling group -// with the list of viable instance types. +// allowed instance type for a game server group. All game server groups must have +// at least two instance types defined for it. GameLift FleetIQ periodically +// evaluates each defined instance type for viability. It then updates the Auto +// Scaling group with the list of viable instance types. type InstanceDefinition struct { // An Amazon EC2 instance type designation. @@ -1476,7 +1509,7 @@ type InstanceDefinition struct { // IP address/port number combination, which must fall into the fleet's allowed // ranges. Fleets with custom game builds must have permissions explicitly set. For // Realtime Servers fleets, GameLift automatically opens two port ranges, one for -// TCP messaging and one for UDP. Related actions DescribeFleetPortSettings +// TCP messaging and one for UDP. type IpPermission struct { // A starting value for a range of allowed port numbers. For fleets using Windows @@ -1510,8 +1543,7 @@ type IpPermission struct { // This data type is used with the GameLift FleetIQ and game server groups. An // Amazon Elastic Compute Cloud launch template that contains configuration // settings and game server code to be deployed to all instances in a game server -// group. The launch template is specified when creating a new game server group -// with CreateGameServerGroup. +// group. The launch template is specified when creating a new game server group. type LaunchTemplateSpecification struct { // A unique identifier for an existing Amazon EC2 launch template. @@ -1529,8 +1561,7 @@ type LaunchTemplateSpecification struct { noSmithyDocumentSerde } -// Represents a location in a multi-location fleet. Related actions -// DescribeFleetLocationAttributes +// Details about a location in a multi-location fleet. type LocationAttributes struct { // A fleet location and its current life-cycle state. @@ -1548,22 +1579,60 @@ type LocationAttributes struct { } // A remote location where a multi-location fleet can deploy EC2 instances for game -// hosting. Related actions CreateFleet -// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateFleet.html) +// hosting. type LocationConfiguration struct { // An Amazon Web Services Region code, such as us-west-2. + // + // This member is required. Location *string noSmithyDocumentSerde } +// Properties of a location +type LocationModel struct { + + // The Amazon Resource Name (ARN + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) that is + // assigned to a GameLift location resource and uniquely identifies it. ARNs are + // unique across all Regions. Format is + // arn:aws:gamelift:::location/location-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912. + LocationArn *string + + // The location's name. + LocationName *string + + noSmithyDocumentSerde +} + // A fleet location and its life-cycle state. A location state object might be used // to describe a fleet's remote location or home Region. Life-cycle state tracks // the progress of launching the first instance in a new location and preparing it // for game hosting, and then removing all instances and deleting the location from -// the fleet. Related actions CreateFleet | CreateFleetLocations | -// DeleteFleetLocations +// the fleet. +// +// * NEW -- A new fleet location has been defined and desired instances +// is set to 1. +// +// * DOWNLOADING/VALIDATING/BUILDING/ACTIVATING -- GameLift is +// setting up the new fleet location, creating new instances with the game build or +// Realtime script and starting server processes. +// +// * ACTIVE -- Hosts can now accept +// game sessions. +// +// * ERROR -- An error occurred when downloading, validating, +// building, or activating the fleet location. +// +// * DELETING -- Hosts are responding +// to a delete fleet location request. +// +// * TERMINATED -- The fleet location no +// longer exists. +// +// * NOT_FOUND -- The fleet location was not found. This could be +// because the custom location was removed or not created. type LocationState struct { // The fleet location, expressed as an Amazon Web Services Region code such as @@ -1618,9 +1687,8 @@ type MatchmakingConfiguration struct { // The method used to backfill game sessions created with this matchmaking // configuration. MANUAL indicates that the game makes backfill requests or does // not use the match backfill feature. AUTOMATIC indicates that GameLift creates - // StartMatchBackfill requests whenever a game session has one or more open slots. - // Learn more about manual and automatic backfill in Backfill existing games with - // FlexMatch + // backfill requests whenever a game session has one or more open slots. Learn more + // about manual and automatic backfill in Backfill existing games with FlexMatch // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-backfill.html). // Automatic backfill is not available when FlexMatchMode is set to STANDALONE. BackfillMode BackfillMode @@ -1657,8 +1725,8 @@ type MatchmakingConfiguration struct { FlexMatchMode FlexMatchMode // A set of custom properties for a game session, formatted as key:value pairs. - // These properties are passed to a game server process in the GameSession object - // with a request to start a new game session (see Start a Game Session + // These properties are passed to a game server process with a request to start a + // new game session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). // This information is added to the new GameSession object that is created for a // successful match. This parameter is not used when FlexMatchMode is set to @@ -1666,8 +1734,8 @@ type MatchmakingConfiguration struct { GameProperties []GameProperty // A set of custom game session properties, formatted as a single string value. - // This data is passed to a game server process in the GameSession object with a - // request to start a new game session (see Start a Game Session + // This data is passed to a game server process with a request to start a new game + // session (see Start a Game Session // (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). // This information is added to the new GameSession object that is created for a // successful match. This parameter is not used when FlexMatchMode is set to @@ -1711,10 +1779,9 @@ type MatchmakingConfiguration struct { // Set of rule statements, used with FlexMatch, that determine how to build your // player matches. Each rule set describes a type of group to be created and -// defines the parameters for acceptable player matches. Rule sets are used in -// MatchmakingConfiguration objects. A rule set may define the following elements -// for a match. For detailed information and examples showing how to construct a -// rule set, see Build a FlexMatch rule set +// defines the parameters for acceptable player matches. A rule set may define the +// following elements for a match. For detailed information and examples showing +// how to construct a rule set, see Build a FlexMatch rule set // (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html). // // * @@ -1771,8 +1838,7 @@ type MatchmakingRuleSet struct { // Ticket generated to track the progress of a matchmaking request. Each ticket is // uniquely identified by a ticket ID, supplied by the requester, when creating a -// matchmaking request with StartMatchmaking. Tickets can be retrieved by calling -// DescribeMatchmaking with the ticket ID. +// matchmaking request. type MatchmakingTicket struct { // The Amazon Resource Name (ARN @@ -1781,24 +1847,25 @@ type MatchmakingTicket struct { // ticket. ConfigurationArn *string - // Name of the MatchmakingConfiguration that is used with this ticket. Matchmaking + // Name of the matchmaking configuration that is used with this ticket. Matchmaking // configurations determine how players are grouped into a match and how a new game // session is created for the match. ConfigurationName *string - // Time stamp indicating when this matchmaking request stopped being processed due - // to success, failure, or cancellation. Format is a number expressed in Unix time - // as milliseconds (for example "1469498468.057"). + // Time stamp indicating when the matchmaking request stopped being processed due + // to successful completion, timeout, or cancellation. Format is a number expressed + // in Unix time as milliseconds (for example "1469498468.057"). EndTime *time.Time // Average amount of time (in seconds) that players are currently waiting for a // match. If there is not enough recent data, this property may be empty. EstimatedWaitTime *int32 - // Identifier and connection information of the game session created for the match. - // This information is added to the ticket only after the matchmaking request has - // been successfully completed. This parameter is not set when FlexMatch is being - // used without GameLift hosting. + // Connection information for a new game session. Once a match is made, the + // FlexMatch engine creates a new game session for it. This information is added to + // the matchmaking ticket, which you can be retrieve by calling DescribeMatchmaking + // (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeMatchmaking.html) + // . GameSessionConnectionInfo *GameSessionConnectionInfo // A set of Player objects, each representing a player to find matches for. Players @@ -1820,23 +1887,23 @@ type MatchmakingTicket struct { // matchmaking request is currently being processed. // // * REQUIRES_ACCEPTANCE -- A - // match has been proposed and the players must accept the match (see AcceptMatch). - // This status is used only with requests that use a matchmaking configuration with - // a player acceptance requirement. + // match has been proposed and the players must accept the match. This status is + // used only with requests that use a matchmaking configuration with a player + // acceptance requirement. // - // * PLACING -- The FlexMatch engine has matched - // players and is in the process of placing a new game session for the match. + // * PLACING -- The FlexMatch engine has matched players + // and is in the process of placing a new game session for the match. // - // * - // COMPLETED -- Players have been matched and a game session is ready to host the - // players. A ticket in this state contains the necessary connection information - // for players. + // * COMPLETED + // -- Players have been matched and a game session is ready to host the players. A + // ticket in this state contains the necessary connection information for + // players. // // * FAILED -- The matchmaking request was not completed. // - // * - // CANCELLED -- The matchmaking request was canceled. This may be the result of a - // call to StopMatchmaking or a proposed match that one or more players failed to + // * CANCELLED -- + // The matchmaking request was canceled. This may be the result of a + // StopMatchmaking operation or a proposed match that one or more players failed to // accept. // // * TIMED_OUT -- The matchmaking request was not successful within the @@ -1861,14 +1928,11 @@ type MatchmakingTicket struct { noSmithyDocumentSerde } -// Information about a player session that was created as part of a -// StartGameSessionPlacement request. This object contains only the player ID and +// Information about a player session. This object contains only the player ID and // player session ID. To retrieve full details on a player session, call -// DescribePlayerSessions with the player session ID. Related actions -// CreatePlayerSession | CreatePlayerSessions | DescribePlayerSessions | -// StartGameSessionPlacement | DescribeGameSessionPlacement | -// StopGameSessionPlacement | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// DescribePlayerSessions +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribePlayerSessions.html) +// with the player session ID. type PlacedPlayerSession struct { // A unique identifier for a player that is associated with this player session. @@ -1897,7 +1961,7 @@ type Player struct { // A collection of key:value pairs containing player information for use in // matchmaking. Player attribute keys must match the playerAttributes used in a // matchmaking rule set. Example: "PlayerAttributes": {"skill": {"N": "23"}, - // "gameMode": {"S": "deathmatch"}}. + // "gameMode": {"S": "deathmatch"}}. You can provide up to 10 PlayerAttributes. PlayerAttributes map[string]AttributeValue // A unique identifier for a player @@ -1911,11 +1975,10 @@ type Player struct { } // Regional latency information for a player, used when requesting a new game -// session with StartGameSessionPlacement. This value indicates the amount of time -// lag that exists when the player is connected to a fleet in the specified Region. -// The relative difference between a player's latency values for multiple Regions -// are used to determine which fleets are best suited to place a new game session -// for the player. +// session. This value indicates the amount of time lag that exists when the player +// is connected to a fleet in the specified Region. The relative difference between +// a player's latency values for multiple Regions are used to determine which +// fleets are best suited to place a new game session for the player. type PlayerLatency struct { // Amount of time that represents the time lag experienced by the player when @@ -1936,7 +1999,7 @@ type PlayerLatency struct { // where a player reports latency higher than the cap. Latency policies are used // only with placement request that provide player latency information. Player // latency policies can be stacked to gradually relax latency requirements over -// time. Latency policies are part of a GameSessionQueue. +// time. type PlayerLatencyPolicy struct { // The maximum latency value that is allowed for any player, in milliseconds. All @@ -1958,9 +2021,7 @@ type PlayerLatencyPolicy struct { // ACTIVE). A player session object, including player data, is automatically passed // to a game session when the player connects to the game session and is validated. // After the game session ends, player sessions information is retained for 30 days -// and then removed. Related actions CreatePlayerSession | CreatePlayerSessions | -// DescribePlayerSessions | StartGameSessionPlacement | -// DescribeGameSessionPlacement | All APIs by task +// and then removed. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) type PlayerSession struct { @@ -2057,8 +2118,7 @@ type PlayerSession struct { // session is placed on the first location (when listed alphabetically). // // Changing -// the priority order will affect how game sessions are placed. Priority -// configurations are part of a GameSessionQueue. +// the priority order will affect how game sessions are placed. type PriorityConfiguration struct { // The prioritization order to use for fleet locations, when the PriorityOrder @@ -2093,12 +2153,15 @@ type PriorityConfiguration struct { // players' ability to consume available resources. The policy is evaluated when a // player tries to create a new game session. On receiving a CreateGameSession // request, GameLift checks that the player (identified by CreatorId) has created -// fewer than game session limit in the specified time period. The resource -// creation limit policy is included in FleetAttributes. +// fewer than game session limit in the specified time period. type ResourceCreationLimitPolicy struct { - // The maximum number of game sessions that an individual can create during the - // policy period. + // A policy that puts limits on the number of game sessions that a player can + // create within a specified span of time. With this policy, you can control + // players' ability to consume available resources. The policy is evaluated when a + // player tries to create a new game session. On receiving a CreateGameSession + // request, GameLift checks that the player (identified by CreatorId) has created + // fewer than game session limit in the specified time period. NewGameSessionsPerCreator *int32 // The time span used in evaluating the resource creation limit policy. @@ -2107,9 +2170,7 @@ type ResourceCreationLimitPolicy struct { noSmithyDocumentSerde } -// The routing configuration for a fleet alias. Related actions CreateAlias | -// ListAliases | DescribeAlias | UpdateAlias | DeleteAlias | ResolveAlias | All -// APIs by task +// The routing configuration for a fleet alias. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) type RoutingStrategy struct { @@ -2128,8 +2189,7 @@ type RoutingStrategy struct { // // * TERMINAL - The alias does not resolve to a // fleet but instead can be used to display a message to the user. A terminal alias - // throws a TerminalRoutingStrategyException with the RoutingStrategy message - // embedded. + // throws a TerminalRoutingStrategyException with the message embedded. Type RoutingStrategyType noSmithyDocumentSerde @@ -2142,10 +2202,9 @@ type RoutingStrategy struct { // Each instance checks regularly for an updated runtime configuration. A GameLift // instance is limited to 50 processes running concurrently. To calculate the total // number of processes in a runtime configuration, add the values of the -// ConcurrentExecutions parameter for each ServerProcess. Learn more about Running -// Multiple Processes on a Fleet +// ConcurrentExecutions parameter for each server process. Learn more about +// Running Multiple Processes on a Fleet // (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-multiprocess.html). -// Related actions DescribeRuntimeConfiguration | UpdateRuntimeConfiguration type RuntimeConfiguration struct { // The maximum amount of time (in seconds) allowed to launch a new game session and @@ -2167,13 +2226,11 @@ type RuntimeConfiguration struct { } // The location in Amazon S3 where build or script files are stored for access by -// Amazon GameLift. This location is specified in CreateBuild, CreateScript, and -// UpdateScript requests. +// Amazon GameLift. type S3Location struct { - // An Amazon S3 bucket identifier. This is the name of the S3 bucket. GameLift - // currently does not support uploading from Amazon S3 buckets with names that - // contain a dot (.). + // An Amazon S3 bucket identifier. Thename of the S3 bucket. GameLift doesn't + // support uploading from Amazon S3 buckets with names that contain a dot (.). Bucket *string // The name of the zip file that contains the build files or script files. @@ -2194,11 +2251,7 @@ type S3Location struct { } // Rule that controls how a fleet is scaled. Scaling policies are uniquely -// identified by the combination of name and fleet ID. Related actions -// DescribeFleetCapacity | UpdateFleetCapacity | DescribeEC2InstanceLimits | -// PutScalingPolicy | DescribeScalingPolicies | DeleteScalingPolicy | -// StopFleetActions | StartFleetActions | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// identified by the combination of name and fleet ID. type ScalingPolicy struct { // Comparison operator to use when measuring a metric against the threshold value. @@ -2281,28 +2334,27 @@ type ScalingPolicy struct { // Amount of adjustment to make, based on the scaling adjustment type. ScalingAdjustment int32 - // The type of adjustment to make to a fleet's instance count (see - // FleetCapacity): + // The type of adjustment to make to a fleet's instance count. // - // * ChangeInCapacity -- add (or subtract) the scaling adjustment - // value from the current instance count. Positive values scale up while negative - // values scale down. + // * ChangeInCapacity + // -- add (or subtract) the scaling adjustment value from the current instance + // count. Positive values scale up while negative values scale down. // - // * ExactCapacity -- set the instance count to the scaling - // adjustment value. + // * + // ExactCapacity -- set the instance count to the scaling adjustment value. // - // * PercentChangeInCapacity -- increase or reduce the current - // instance count by the scaling adjustment, read as a percentage. Positive values - // scale up while negative values scale down. + // * + // PercentChangeInCapacity -- increase or reduce the current instance count by the + // scaling adjustment, read as a percentage. Positive values scale up while + // negative values scale down. ScalingAdjustmentType ScalingAdjustmentType // Current status of the scaling policy. The scaling policy can be in force only // when in an ACTIVE status. Scaling policies can be suspended for individual - // fleets (see StopFleetActions; if suspended for a fleet, the policy status does - // not change. View a fleet's stopped actions by calling DescribeFleetCapacity. + // fleets. If the policy is suspended for a fleet, the policy status does not + // change. // - // * - // ACTIVE -- The scaling policy can be used for auto-scaling a fleet. + // * ACTIVE -- The scaling policy can be used for auto-scaling a fleet. // // * // UPDATE_REQUESTED -- A request to update the scaling policy has been received. @@ -2337,8 +2389,7 @@ type ScalingPolicy struct { noSmithyDocumentSerde } -// Properties describing a Realtime script. Related actions CreateScript | -// ListScripts | DescribeScript | UpdateScript | DeleteScript | All APIs by task +// Properties describing a Realtime script. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) type Script struct { @@ -2364,13 +2415,18 @@ type Script struct { // are uploaded from an S3 location, this value remains at "0". SizeOnDisk *int64 - // The location in Amazon S3 where build or script files are stored for access by - // Amazon GameLift. This location is specified in CreateBuild, CreateScript, and - // UpdateScript requests. + // The location of the Amazon S3 bucket where a zipped file containing your + // Realtime scripts is stored. The storage location must specify the Amazon S3 + // bucket name, the zip file name (the "key"), and a role ARN that allows Amazon + // GameLift to access the Amazon S3 storage location. The S3 bucket must be in the + // same Region where you want to create a new script. By default, Amazon GameLift + // uploads the latest version of the zip file; if you have S3 object versioning + // turned on, you can use the ObjectVersion parameter to specify an earlier + // version. StorageLocation *S3Location - // Version information that is associated with a build or script. Version strings - // do not need to be unique. + // Version information associated with a build or script. Version strings do not + // need to be unique. Version *string noSmithyDocumentSerde @@ -2379,7 +2435,7 @@ type Script struct { // A set of instructions for launching server processes on each instance in a // fleet. Server processes run either an executable in a custom game build or a // Realtime Servers script. Server process configurations are part of a fleet's -// RuntimeConfiguration. +// runtime configuration. type ServerProcess struct { // The number of server processes using this configuration that run concurrently on @@ -2413,8 +2469,7 @@ type ServerProcess struct { // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon // Web Services General Reference Amazon Web Services Tagging Strategies // (http://aws.amazon.com/answers/account-management/aws-tagging-strategies/) -// Related actions TagResource | UntagResource | ListTagsForResource | All APIs by -// task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) type Tag struct { @@ -2433,15 +2488,11 @@ type Tag struct { noSmithyDocumentSerde } -// Settings for a target-based scaling policy (see ScalingPolicy. A target-based -// policy tracks a particular fleet metric specifies a target value for the metric. -// As player usage changes, the policy triggers Amazon GameLift to adjust capacity -// so that the metric returns to the target value. The target configuration -// specifies settings as needed for the target based policy, including the target -// value. Related actions DescribeFleetCapacity | UpdateFleetCapacity | -// DescribeEC2InstanceLimits | PutScalingPolicy | DescribeScalingPolicies | -// DeleteScalingPolicy | StopFleetActions | StartFleetActions | All APIs by task -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) +// Settings for a target-based scaling policy. A target-based policy tracks a +// particular fleet metric specifies a target value for the metric. As player usage +// changes, the policy triggers Amazon GameLift to adjust capacity so that the +// metric returns to the target value. The target configuration specifies settings +// as needed for the target based policy, including the target value. type TargetConfiguration struct { // Desired value to use with a target-based scaling policy. The value must be @@ -2458,11 +2509,12 @@ type TargetConfiguration struct { // This data type is used with the GameLift FleetIQ and game server groups. // Settings for a target-based scaling policy as part of a -// GameServerGroupAutoScalingPolicy. These settings are used to create a -// target-based policy that tracks the GameLift FleetIQ metric -// "PercentUtilizedGameServers" and specifies a target value for the metric. As -// player usage changes, the policy triggers to adjust the game server group -// capacity so that the metric returns to the target value. +// GameServerGroupAutoScalingPolicy +// (https://docs.aws.amazon.com/gamelift/latest/apireference/API_GameServerGroupAutoScalingPolicy.html) +// . These settings are used to create a target-based policy that tracks the +// GameLift FleetIQ metric "PercentUtilizedGameServers" and specifies a target +// value for the metric. As player usage changes, the policy triggers to adjust the +// game server group capacity so that the metric returns to the target value. type TargetTrackingConfiguration struct { // Desired value to use with a game server group target-based scaling policy. @@ -2477,9 +2529,7 @@ type TargetTrackingConfiguration struct { // Amazon GameLift fleet and another VPC on an account you have access to. This // authorization must exist and be valid for the peering connection to be // established. Authorizations are valid for 24 hours after they are issued. -// Related actions CreateVpcPeeringAuthorization | DescribeVpcPeeringAuthorizations -// | DeleteVpcPeeringAuthorization | CreateVpcPeeringConnection | -// DescribeVpcPeeringConnections | DeleteVpcPeeringConnection | All APIs by task +// Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) type VpcPeeringAuthorization struct { @@ -2497,7 +2547,7 @@ type VpcPeeringAuthorization struct { // Management Console under account settings. GameLiftAwsAccountId *string - // + // The authorization's peer VPC Amazon Web Services account ID. PeerVpcAwsAccountId *string // A unique identifier for a VPC with resources to be accessed by your GameLift @@ -2514,10 +2564,7 @@ type VpcPeeringAuthorization struct { // Represents a peering connection between a VPC on one of your Amazon Web Services // accounts and the VPC for your Amazon GameLift fleets. This record may be for an // active peering connection or a pending connection that has not yet been -// established. Related actions CreateVpcPeeringAuthorization | -// DescribeVpcPeeringAuthorizations | DeleteVpcPeeringAuthorization | -// CreateVpcPeeringConnection | DescribeVpcPeeringConnections | -// DeleteVpcPeeringConnection | All APIs by task +// established. Related actions All APIs by task // (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) type VpcPeeringConnection struct { @@ -2554,17 +2601,16 @@ type VpcPeeringConnection struct { // A unique identifier that is automatically assigned to the connection record. // This ID is referenced in VPC peering connection events, and is used when - // deleting a connection with DeleteVpcPeeringConnection. + // deleting a connection. VpcPeeringConnectionId *string noSmithyDocumentSerde } -// Represents status information for a VPC peering connection. Status is associated -// with a VpcPeeringConnection object. Status codes and messages are provided from -// EC2 (see VpcPeeringConnectionStateReason +// Represents status information for a VPC peering connection. Status codes and +// messages are provided from EC2 (see VpcPeeringConnectionStateReason // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_VpcPeeringConnectionStateReason.html)). -// Connection status information is also communicated as a fleet Event. +// Connection status information is also communicated as a fleet event. type VpcPeeringConnectionStatus struct { // Code indicating the status of a VPC peering connection. diff --git a/service/gamelift/validators.go b/service/gamelift/validators.go index ddbda30d80f..6ebd9be2649 100644 --- a/service/gamelift/validators.go +++ b/service/gamelift/validators.go @@ -190,6 +190,26 @@ func (m *validateOpCreateGameSessionQueue) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpCreateLocation struct { +} + +func (*validateOpCreateLocation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateLocation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateLocationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateLocationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateMatchmakingConfiguration struct { } @@ -450,6 +470,26 @@ func (m *validateOpDeleteGameSessionQueue) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpDeleteLocation struct { +} + +func (*validateOpDeleteLocation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteLocation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteLocationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteLocationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteMatchmakingConfiguration struct { } @@ -570,6 +610,26 @@ func (m *validateOpDeleteVpcPeeringConnection) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpDeregisterCompute struct { +} + +func (*validateOpDeregisterCompute) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeregisterCompute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeregisterComputeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeregisterComputeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeregisterGameServer struct { } @@ -630,6 +690,26 @@ func (m *validateOpDescribeBuild) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDescribeCompute struct { +} + +func (*validateOpDescribeCompute) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeCompute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeComputeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeComputeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeFleetEvents struct { } @@ -910,6 +990,46 @@ func (m *validateOpDescribeScript) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpGetComputeAccess struct { +} + +func (*validateOpGetComputeAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetComputeAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetComputeAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetComputeAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetComputeAuthToken struct { +} + +func (*validateOpGetComputeAuthToken) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetComputeAuthToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetComputeAuthTokenInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetComputeAuthTokenInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetGameSessionLogUrl struct { } @@ -950,6 +1070,26 @@ func (m *validateOpGetInstanceAccess) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpListCompute struct { +} + +func (*validateOpListCompute) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCompute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListComputeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListComputeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListGameServers struct { } @@ -1010,6 +1150,26 @@ func (m *validateOpPutScalingPolicy) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpRegisterCompute struct { +} + +func (*validateOpRegisterCompute) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRegisterCompute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RegisterComputeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRegisterComputeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpRegisterGameServer struct { } @@ -1586,6 +1746,10 @@ func addOpCreateGameSessionQueueValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpCreateGameSessionQueue{}, middleware.After) } +func addOpCreateLocationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateLocation{}, middleware.After) +} + func addOpCreateMatchmakingConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateMatchmakingConfiguration{}, middleware.After) } @@ -1638,6 +1802,10 @@ func addOpDeleteGameSessionQueueValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpDeleteGameSessionQueue{}, middleware.After) } +func addOpDeleteLocationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteLocation{}, middleware.After) +} + func addOpDeleteMatchmakingConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteMatchmakingConfiguration{}, middleware.After) } @@ -1662,6 +1830,10 @@ func addOpDeleteVpcPeeringConnectionValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpDeleteVpcPeeringConnection{}, middleware.After) } +func addOpDeregisterComputeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeregisterCompute{}, middleware.After) +} + func addOpDeregisterGameServerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeregisterGameServer{}, middleware.After) } @@ -1674,6 +1846,10 @@ func addOpDescribeBuildValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeBuild{}, middleware.After) } +func addOpDescribeComputeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeCompute{}, middleware.After) +} + func addOpDescribeFleetEventsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeFleetEvents{}, middleware.After) } @@ -1730,6 +1906,14 @@ func addOpDescribeScriptValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeScript{}, middleware.After) } +func addOpGetComputeAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetComputeAccess{}, middleware.After) +} + +func addOpGetComputeAuthTokenValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetComputeAuthToken{}, middleware.After) +} + func addOpGetGameSessionLogUrlValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetGameSessionLogUrl{}, middleware.After) } @@ -1738,6 +1922,10 @@ func addOpGetInstanceAccessValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetInstanceAccess{}, middleware.After) } +func addOpListComputeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCompute{}, middleware.After) +} + func addOpListGameServersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListGameServers{}, middleware.After) } @@ -1750,6 +1938,10 @@ func addOpPutScalingPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutScalingPolicy{}, middleware.After) } +func addOpRegisterComputeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRegisterCompute{}, middleware.After) +} + func addOpRegisterGameServerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRegisterGameServer{}, middleware.After) } @@ -1858,6 +2050,21 @@ func addOpValidateMatchmakingRuleSetValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpValidateMatchmakingRuleSet{}, middleware.After) } +func validateAnywhereConfiguration(v *types.AnywhereConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AnywhereConfiguration"} + if v.Cost == nil { + invalidParams.Add(smithy.NewErrParamRequired("Cost")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCertificateConfiguration(v *types.CertificateConfiguration) error { if v == nil { return nil @@ -2000,6 +2207,38 @@ func validateIpPermissionsList(v []types.IpPermission) error { } } +func validateLocationConfiguration(v *types.LocationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LocationConfiguration"} + if v.Location == nil { + invalidParams.Add(smithy.NewErrParamRequired("Location")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLocationConfigurationList(v []types.LocationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LocationConfigurationList"} + for i := range v { + if err := validateLocationConfiguration(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRuntimeConfiguration(v *types.RuntimeConfiguration) error { if v == nil { return nil @@ -2198,9 +2437,6 @@ func validateOpCreateFleetInput(v *CreateFleetInput) error { if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } - if len(v.EC2InstanceType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("EC2InstanceType")) - } if v.EC2InboundPermissions != nil { if err := validateIpPermissionsList(v.EC2InboundPermissions); err != nil { invalidParams.AddNested("EC2InboundPermissions", err.(smithy.InvalidParamsError)) @@ -2216,11 +2452,21 @@ func validateOpCreateFleetInput(v *CreateFleetInput) error { invalidParams.AddNested("CertificateConfiguration", err.(smithy.InvalidParamsError)) } } + if v.Locations != nil { + if err := validateLocationConfigurationList(v.Locations); err != nil { + invalidParams.AddNested("Locations", err.(smithy.InvalidParamsError)) + } + } if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } + if v.AnywhereConfiguration != nil { + if err := validateAnywhereConfiguration(v.AnywhereConfiguration); err != nil { + invalidParams.AddNested("AnywhereConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2238,6 +2484,10 @@ func validateOpCreateFleetLocationsInput(v *CreateFleetLocationsInput) error { } if v.Locations == nil { invalidParams.Add(smithy.NewErrParamRequired("Locations")) + } else if v.Locations != nil { + if err := validateLocationConfigurationList(v.Locations); err != nil { + invalidParams.AddNested("Locations", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -2330,6 +2580,26 @@ func validateOpCreateGameSessionQueueInput(v *CreateGameSessionQueueInput) error } } +func validateOpCreateLocationInput(v *CreateLocationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLocationInput"} + if v.LocationName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LocationName")) + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateMatchmakingConfigurationInput(v *CreateMatchmakingConfigurationInput) error { if v == nil { return nil @@ -2572,6 +2842,21 @@ func validateOpDeleteGameSessionQueueInput(v *DeleteGameSessionQueueInput) error } } +func validateOpDeleteLocationInput(v *DeleteLocationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteLocationInput"} + if v.LocationName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LocationName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteMatchmakingConfigurationInput(v *DeleteMatchmakingConfigurationInput) error { if v == nil { return nil @@ -2671,6 +2956,24 @@ func validateOpDeleteVpcPeeringConnectionInput(v *DeleteVpcPeeringConnectionInpu } } +func validateOpDeregisterComputeInput(v *DeregisterComputeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeregisterComputeInput"} + if v.FleetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FleetId")) + } + if v.ComputeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ComputeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeregisterGameServerInput(v *DeregisterGameServerInput) error { if v == nil { return nil @@ -2719,6 +3022,24 @@ func validateOpDescribeBuildInput(v *DescribeBuildInput) error { } } +func validateOpDescribeComputeInput(v *DescribeComputeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeComputeInput"} + if v.FleetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FleetId")) + } + if v.ComputeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ComputeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeFleetEventsInput(v *DescribeFleetEventsInput) error { if v == nil { return nil @@ -2938,6 +3259,42 @@ func validateOpDescribeScriptInput(v *DescribeScriptInput) error { } } +func validateOpGetComputeAccessInput(v *GetComputeAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetComputeAccessInput"} + if v.FleetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FleetId")) + } + if v.ComputeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ComputeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetComputeAuthTokenInput(v *GetComputeAuthTokenInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetComputeAuthTokenInput"} + if v.FleetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FleetId")) + } + if v.ComputeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ComputeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetGameSessionLogUrlInput(v *GetGameSessionLogUrlInput) error { if v == nil { return nil @@ -2971,6 +3328,21 @@ func validateOpGetInstanceAccessInput(v *GetInstanceAccessInput) error { } } +func validateOpListComputeInput(v *ListComputeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListComputeInput"} + if v.FleetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FleetId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListGameServersInput(v *ListGameServersInput) error { if v == nil { return nil @@ -3027,6 +3399,24 @@ func validateOpPutScalingPolicyInput(v *PutScalingPolicyInput) error { } } +func validateOpRegisterComputeInput(v *RegisterComputeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegisterComputeInput"} + if v.FleetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FleetId")) + } + if v.ComputeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ComputeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpRegisterGameServerInput(v *RegisterGameServerInput) error { if v == nil { return nil @@ -3320,6 +3710,11 @@ func validateOpUpdateFleetAttributesInput(v *UpdateFleetAttributesInput) error { if v.FleetId == nil { invalidParams.Add(smithy.NewErrParamRequired("FleetId")) } + if v.AnywhereConfiguration != nil { + if err := validateAnywhereConfiguration(v.AnywhereConfiguration); err != nil { + invalidParams.AddNested("AnywhereConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/pipes/LICENSE.txt b/service/pipes/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/pipes/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/pipes/api_client.go b/service/pipes/api_client.go new file mode 100644 index 00000000000..a9e54df9688 --- /dev/null +++ b/service/pipes/api_client.go @@ -0,0 +1,434 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + "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" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + 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" + "time" +) + +const ServiceID = "Pipes" +const ServiceAPIVersion = "2015-10-07" + +// Client provides the API client to make operations call for Amazon EventBridge +// Pipes. +type Client struct { + options Options +} + +// 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) + + resolveDefaultEndpointConfiguration(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +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 + + // 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. + EndpointResolver EndpointResolver + + // 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. 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. 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 +} + +// 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...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// 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 (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) + } + + finalizeRetryMaxAttemptOptions(&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 noSmithyDocumentSerde = smithydocument.NoSerde + +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, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(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 finalizeRetryMaxAttemptOptions(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, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "pipes", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +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 addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// 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 addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +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) +} diff --git a/service/pipes/api_client_test.go b/service/pipes/api_client_test.go new file mode 100644 index 00000000000..dc877153c7a --- /dev/null +++ b/service/pipes/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +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, + }) + + 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/pipes/api_op_CreatePipe.go b/service/pipes/api_op_CreatePipe.go new file mode 100644 index 00000000000..d5b57a94f80 --- /dev/null +++ b/service/pipes/api_op_CreatePipe.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/pipes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Create a pipe. Amazon EventBridge Pipes connect event sources to targets and +// reduces the need for specialized knowledge and integration code. +func (c *Client) CreatePipe(ctx context.Context, params *CreatePipeInput, optFns ...func(*Options)) (*CreatePipeOutput, error) { + if params == nil { + params = &CreatePipeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreatePipe", params, optFns, c.addOperationCreatePipeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreatePipeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreatePipeInput struct { + + // The name of the pipe. + // + // This member is required. + Name *string + + // The ARN of the role that allows the pipe to send data to the target. + // + // This member is required. + RoleArn *string + + // The ARN of the source resource. + // + // This member is required. + Source *string + + // The ARN of the target resource. + // + // This member is required. + Target *string + + // A description of the pipe. + Description *string + + // The state the pipe should be in. + DesiredState types.RequestedPipeState + + // The ARN of the enrichment resource. + Enrichment *string + + // The parameters required to set up enrichment on your pipe. + EnrichmentParameters *types.PipeEnrichmentParameters + + // The parameters required to set up a source for your pipe. + SourceParameters *types.PipeSourceParameters + + // The list of key-value pairs to associate with the pipe. + Tags map[string]string + + // The parameters required to set up a target for your pipe. + TargetParameters *types.PipeTargetParameters + + noSmithyDocumentSerde +} + +type CreatePipeOutput struct { + + // The ARN of the pipe. + Arn *string + + // The time the pipe was created. + CreationTime *time.Time + + // The state the pipe is in. + CurrentState types.PipeState + + // The state the pipe should be in. + DesiredState types.RequestedPipeState + + // When the pipe was last updated, in ISO-8601 format + // (https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + LastModifiedTime *time.Time + + // The name of the pipe. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreatePipeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreatePipe{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreatePipe{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreatePipeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePipe(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreatePipe(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "pipes", + OperationName: "CreatePipe", + } +} diff --git a/service/pipes/api_op_DeletePipe.go b/service/pipes/api_op_DeletePipe.go new file mode 100644 index 00000000000..a03945101b1 --- /dev/null +++ b/service/pipes/api_op_DeletePipe.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/pipes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Delete an existing pipe. For more information about pipes, see Amazon +// EventBridge Pipes +// (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html) in the +// Amazon EventBridge User Guide. +func (c *Client) DeletePipe(ctx context.Context, params *DeletePipeInput, optFns ...func(*Options)) (*DeletePipeOutput, error) { + if params == nil { + params = &DeletePipeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeletePipe", params, optFns, c.addOperationDeletePipeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeletePipeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeletePipeInput struct { + + // The name of the pipe. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type DeletePipeOutput struct { + + // The ARN of the pipe. + Arn *string + + // The time the pipe was created. + CreationTime *time.Time + + // The state the pipe is in. + CurrentState types.PipeState + + // The state the pipe should be in. + DesiredState types.RequestedPipeStateDescribeResponse + + // When the pipe was last updated, in ISO-8601 format + // (https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + LastModifiedTime *time.Time + + // The name of the pipe. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeletePipeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePipe{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePipe{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeletePipeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePipe(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeletePipe(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "pipes", + OperationName: "DeletePipe", + } +} diff --git a/service/pipes/api_op_DescribePipe.go b/service/pipes/api_op_DescribePipe.go new file mode 100644 index 00000000000..f94dc888df7 --- /dev/null +++ b/service/pipes/api_op_DescribePipe.go @@ -0,0 +1,171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/pipes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Get the information about an existing pipe. For more information about pipes, +// see Amazon EventBridge Pipes +// (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html) in the +// Amazon EventBridge User Guide. +func (c *Client) DescribePipe(ctx context.Context, params *DescribePipeInput, optFns ...func(*Options)) (*DescribePipeOutput, error) { + if params == nil { + params = &DescribePipeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribePipe", params, optFns, c.addOperationDescribePipeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribePipeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribePipeInput struct { + + // The name of the pipe. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type DescribePipeOutput struct { + + // The ARN of the pipe. + Arn *string + + // The time the pipe was created. + CreationTime *time.Time + + // The state the pipe is in. + CurrentState types.PipeState + + // A description of the pipe. + Description *string + + // The state the pipe should be in. + DesiredState types.RequestedPipeStateDescribeResponse + + // The ARN of the enrichment resource. + Enrichment *string + + // The parameters required to set up enrichment on your pipe. + EnrichmentParameters *types.PipeEnrichmentParameters + + // When the pipe was last updated, in ISO-8601 format + // (https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + LastModifiedTime *time.Time + + // The name of the pipe. + Name *string + + // The ARN of the role that allows the pipe to send data to the target. + RoleArn *string + + // The ARN of the source resource. + Source *string + + // The parameters required to set up a source for your pipe. + SourceParameters *types.PipeSourceParameters + + // The reason the pipe is in its current state. + StateReason *string + + // The list of key-value pairs to associate with the pipe. + Tags map[string]string + + // The ARN of the target resource. + Target *string + + // The parameters required to set up a target for your pipe. + TargetParameters *types.PipeTargetParameters + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribePipeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribePipe{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribePipe{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribePipeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePipe(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDescribePipe(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "pipes", + OperationName: "DescribePipe", + } +} diff --git a/service/pipes/api_op_ListPipes.go b/service/pipes/api_op_ListPipes.go new file mode 100644 index 00000000000..2e84d555273 --- /dev/null +++ b/service/pipes/api_op_ListPipes.go @@ -0,0 +1,239 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/pipes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get the pipes associated with this account. For more information about pipes, +// see Amazon EventBridge Pipes +// (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html) in the +// Amazon EventBridge User Guide. +func (c *Client) ListPipes(ctx context.Context, params *ListPipesInput, optFns ...func(*Options)) (*ListPipesOutput, error) { + if params == nil { + params = &ListPipesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPipes", params, optFns, c.addOperationListPipesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPipesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPipesInput struct { + + // The state the pipe is in. + CurrentState types.PipeState + + // The state the pipe should be in. + DesiredState types.RequestedPipeState + + // The maximum number of pipes to include in the response. + Limit *int32 + + // A value that will return a subset of the pipes associated with this account. For + // example, "NamePrefix": "ABC" will return all endpoints with "ABC" in the name. + NamePrefix *string + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. Using an expired + // pagination token will return an HTTP 400 InvalidToken error. + NextToken *string + + // The prefix matching the pipe source. + SourcePrefix *string + + // The prefix matching the pipe target. + TargetPrefix *string + + noSmithyDocumentSerde +} + +type ListPipesOutput struct { + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. Using an expired + // pagination token will return an HTTP 400 InvalidToken error. + NextToken *string + + // The pipes returned by the call. + Pipes []types.Pipe + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPipesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListPipes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPipes{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPipes(options.Region), middleware.Before); 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 + } + return nil +} + +// ListPipesAPIClient is a client that implements the ListPipes operation. +type ListPipesAPIClient interface { + ListPipes(context.Context, *ListPipesInput, ...func(*Options)) (*ListPipesOutput, error) +} + +var _ ListPipesAPIClient = (*Client)(nil) + +// ListPipesPaginatorOptions is the paginator options for ListPipes +type ListPipesPaginatorOptions struct { + // The maximum number of pipes to include in the response. + 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 +} + +// ListPipesPaginator is a paginator for ListPipes +type ListPipesPaginator struct { + options ListPipesPaginatorOptions + client ListPipesAPIClient + params *ListPipesInput + nextToken *string + firstPage bool +} + +// NewListPipesPaginator returns a new ListPipesPaginator +func NewListPipesPaginator(client ListPipesAPIClient, params *ListPipesInput, optFns ...func(*ListPipesPaginatorOptions)) *ListPipesPaginator { + if params == nil { + params = &ListPipesInput{} + } + + options := ListPipesPaginatorOptions{} + if params.Limit != nil { + options.Limit = *params.Limit + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPipesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPipesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPipes page. +func (p *ListPipesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipesOutput, 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.Limit = limit + + result, err := p.client.ListPipes(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 +} + +func newServiceMetadataMiddleware_opListPipes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "pipes", + OperationName: "ListPipes", + } +} diff --git a/service/pipes/api_op_ListTagsForResource.go b/service/pipes/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..951da4871a2 --- /dev/null +++ b/service/pipes/api_op_ListTagsForResource.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Displays the tags associated with a pipe. +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 pipe for which you want to view tags. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // The list of key-value pairs to associate with the pipe. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + 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 = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); 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 = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "pipes", + OperationName: "ListTagsForResource", + } +} diff --git a/service/pipes/api_op_StartPipe.go b/service/pipes/api_op_StartPipe.go new file mode 100644 index 00000000000..97578b11847 --- /dev/null +++ b/service/pipes/api_op_StartPipe.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/pipes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Start an existing pipe. +func (c *Client) StartPipe(ctx context.Context, params *StartPipeInput, optFns ...func(*Options)) (*StartPipeOutput, error) { + if params == nil { + params = &StartPipeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartPipe", params, optFns, c.addOperationStartPipeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartPipeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartPipeInput struct { + + // The name of the pipe. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type StartPipeOutput struct { + + // The ARN of the pipe. + Arn *string + + // The time the pipe was created. + CreationTime *time.Time + + // The state the pipe is in. + CurrentState types.PipeState + + // The state the pipe should be in. + DesiredState types.RequestedPipeState + + // When the pipe was last updated, in ISO-8601 format + // (https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + LastModifiedTime *time.Time + + // The name of the pipe. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartPipeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartPipe{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartPipe{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpStartPipeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartPipe(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opStartPipe(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "pipes", + OperationName: "StartPipe", + } +} diff --git a/service/pipes/api_op_StopPipe.go b/service/pipes/api_op_StopPipe.go new file mode 100644 index 00000000000..97f0786d024 --- /dev/null +++ b/service/pipes/api_op_StopPipe.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/pipes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Stop an existing pipe. +func (c *Client) StopPipe(ctx context.Context, params *StopPipeInput, optFns ...func(*Options)) (*StopPipeOutput, error) { + if params == nil { + params = &StopPipeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopPipe", params, optFns, c.addOperationStopPipeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopPipeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopPipeInput struct { + + // The name of the pipe. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type StopPipeOutput struct { + + // The ARN of the pipe. + Arn *string + + // The time the pipe was created. + CreationTime *time.Time + + // The state the pipe is in. + CurrentState types.PipeState + + // The state the pipe should be in. + DesiredState types.RequestedPipeState + + // When the pipe was last updated, in ISO-8601 format + // (https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + LastModifiedTime *time.Time + + // The name of the pipe. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopPipeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStopPipe{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopPipe{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpStopPipeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopPipe(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opStopPipe(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "pipes", + OperationName: "StopPipe", + } +} diff --git a/service/pipes/api_op_TagResource.go b/service/pipes/api_op_TagResource.go new file mode 100644 index 00000000000..7e0de1a2450 --- /dev/null +++ b/service/pipes/api_op_TagResource.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Assigns one or more tags (key-value pairs) to the specified pipe. Tags can help +// you organize and categorize your resources. You can also use them to scope user +// permissions by granting a user permission to access or change only resources +// with certain tag values. Tags don't have any semantic meaning to Amazon Web +// Services and are interpreted strictly as strings of characters. You can use the +// TagResource action with a pipe that already has tags. If you specify a new tag +// key, this tag is appended to the list of tags associated with the pipe. If you +// specify a tag key that is already associated with the pipe, the new tag value +// that you specify replaces the previous value for that tag. You can associate as +// many as 50 tags with a pipe. +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 pipe. + // + // This member is required. + ResourceArn *string + + // The list of key-value pairs associated with the pipe. + // + // 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) { + 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 = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); 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 = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "pipes", + OperationName: "TagResource", + } +} diff --git a/service/pipes/api_op_UntagResource.go b/service/pipes/api_op_UntagResource.go new file mode 100644 index 00000000000..25fd36a7fae --- /dev/null +++ b/service/pipes/api_op_UntagResource.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes one or more tags from the specified pipes. +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 pipe. + // + // This member is required. + ResourceArn *string + + // The list of tag keys to remove from the pipe. + // + // 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) { + 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 = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); 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 = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "pipes", + OperationName: "UntagResource", + } +} diff --git a/service/pipes/api_op_UpdatePipe.go b/service/pipes/api_op_UpdatePipe.go new file mode 100644 index 00000000000..aec9baf5d69 --- /dev/null +++ b/service/pipes/api_op_UpdatePipe.go @@ -0,0 +1,173 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/pipes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Update an existing pipe. When you call UpdatePipe, only the fields that are +// included in the request are changed, the rest are unchanged. The exception to +// this is if you modify any Amazon Web Services-service specific fields in the +// SourceParameters, EnrichmentParameters, or TargetParameters objects. The fields +// in these objects are updated atomically as one and override existing values. +// This is by design and means that if you don't specify an optional field in one +// of these Parameters objects, that field will be set to its system-default value +// after the update. For more information about pipes, see Amazon EventBridge +// Pipes (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html) +// in the Amazon EventBridge User Guide. +func (c *Client) UpdatePipe(ctx context.Context, params *UpdatePipeInput, optFns ...func(*Options)) (*UpdatePipeOutput, error) { + if params == nil { + params = &UpdatePipeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePipe", params, optFns, c.addOperationUpdatePipeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePipeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePipeInput struct { + + // The name of the pipe. + // + // This member is required. + Name *string + + // The ARN of the role that allows the pipe to send data to the target. + // + // This member is required. + RoleArn *string + + // A description of the pipe. + Description *string + + // The state the pipe should be in. + DesiredState types.RequestedPipeState + + // The ARN of the enrichment resource. + Enrichment *string + + // The parameters required to set up enrichment on your pipe. + EnrichmentParameters *types.PipeEnrichmentParameters + + // The parameters required to set up a source for your pipe. + SourceParameters *types.UpdatePipeSourceParameters + + // The ARN of the target resource. + Target *string + + // The parameters required to set up a target for your pipe. + TargetParameters *types.PipeTargetParameters + + noSmithyDocumentSerde +} + +type UpdatePipeOutput struct { + + // The ARN of the pipe. + Arn *string + + // The time the pipe was created. + CreationTime *time.Time + + // The state the pipe is in. + CurrentState types.PipeState + + // The state the pipe should be in. + DesiredState types.RequestedPipeState + + // When the pipe was last updated, in ISO-8601 format + // (https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + LastModifiedTime *time.Time + + // The name of the pipe. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePipeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePipe{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePipe{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdatePipeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePipe(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdatePipe(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "pipes", + OperationName: "UpdatePipe", + } +} diff --git a/service/pipes/deserializers.go b/service/pipes/deserializers.go new file mode 100644 index 00000000000..cf138c05ea7 --- /dev/null +++ b/service/pipes/deserializers.go @@ -0,0 +1,6694 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/pipes/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" + "strconv" + "strings" +) + +type awsRestjson1_deserializeOpCreatePipe struct { +} + +func (*awsRestjson1_deserializeOpCreatePipe) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreatePipe) 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_deserializeOpErrorCreatePipe(response, &metadata) + } + output := &CreatePipeOutput{} + 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_deserializeOpDocumentCreatePipeOutput(&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_deserializeOpErrorCreatePipe(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(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_deserializeOpDocumentCreatePipeOutput(v **CreatePipeOutput, 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 *CreatePipeOutput + if *v == nil { + sv = &CreatePipeOutput{} + } 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 PipeArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "CurrentState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) + } + sv.CurrentState = types.PipeState(jtv) + } + + case "DesiredState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RequestedPipeState to be of type string, got %T instead", value) + } + sv.DesiredState = types.RequestedPipeState(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeletePipe struct { +} + +func (*awsRestjson1_deserializeOpDeletePipe) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeletePipe) 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_deserializeOpErrorDeletePipe(response, &metadata) + } + output := &DeletePipeOutput{} + 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_deserializeOpDocumentDeletePipeOutput(&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_deserializeOpErrorDeletePipe(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(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_deserializeOpDocumentDeletePipeOutput(v **DeletePipeOutput, 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 *DeletePipeOutput + if *v == nil { + sv = &DeletePipeOutput{} + } 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 PipeArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "CurrentState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) + } + sv.CurrentState = types.PipeState(jtv) + } + + case "DesiredState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RequestedPipeStateDescribeResponse to be of type string, got %T instead", value) + } + sv.DesiredState = types.RequestedPipeStateDescribeResponse(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDescribePipe struct { +} + +func (*awsRestjson1_deserializeOpDescribePipe) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribePipe) 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_deserializeOpErrorDescribePipe(response, &metadata) + } + output := &DescribePipeOutput{} + 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_deserializeOpDocumentDescribePipeOutput(&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_deserializeOpErrorDescribePipe(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(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_deserializeOpDocumentDescribePipeOutput(v **DescribePipeOutput, 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 *DescribePipeOutput + if *v == nil { + sv = &DescribePipeOutput{} + } 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 PipeArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "CurrentState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) + } + sv.CurrentState = types.PipeState(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "DesiredState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RequestedPipeStateDescribeResponse to be of type string, got %T instead", value) + } + sv.DesiredState = types.RequestedPipeStateDescribeResponse(jtv) + } + + case "Enrichment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OptionalArn to be of type string, got %T instead", value) + } + sv.Enrichment = ptr.String(jtv) + } + + case "EnrichmentParameters": + if err := awsRestjson1_deserializeDocumentPipeEnrichmentParameters(&sv.EnrichmentParameters, value); err != nil { + return err + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) + } + sv.Name = 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 "Source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArnOrUrl to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + case "SourceParameters": + if err := awsRestjson1_deserializeDocumentPipeSourceParameters(&sv.SourceParameters, value); err != nil { + return err + } + + case "StateReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeStateReason to be of type string, got %T instead", value) + } + sv.StateReason = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "Target": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Target = ptr.String(jtv) + } + + case "TargetParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetParameters(&sv.TargetParameters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListPipes struct { +} + +func (*awsRestjson1_deserializeOpListPipes) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListPipes) 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_deserializeOpErrorListPipes(response, &metadata) + } + output := &ListPipesOutput{} + 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_deserializeOpDocumentListPipesOutput(&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_deserializeOpErrorListPipes(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentListPipesOutput(v **ListPipesOutput, 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 *ListPipesOutput + if *v == nil { + sv = &ListPipesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Pipes": + if err := awsRestjson1_deserializeDocumentPipeList(&sv.Pipes, 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(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_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartPipe struct { +} + +func (*awsRestjson1_deserializeOpStartPipe) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartPipe) 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_deserializeOpErrorStartPipe(response, &metadata) + } + output := &StartPipeOutput{} + 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_deserializeOpDocumentStartPipeOutput(&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_deserializeOpErrorStartPipe(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(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_deserializeOpDocumentStartPipeOutput(v **StartPipeOutput, 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 *StartPipeOutput + if *v == nil { + sv = &StartPipeOutput{} + } 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 PipeArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "CurrentState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) + } + sv.CurrentState = types.PipeState(jtv) + } + + case "DesiredState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RequestedPipeState to be of type string, got %T instead", value) + } + sv.DesiredState = types.RequestedPipeState(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStopPipe struct { +} + +func (*awsRestjson1_deserializeOpStopPipe) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStopPipe) 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_deserializeOpErrorStopPipe(response, &metadata) + } + output := &StopPipeOutput{} + 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_deserializeOpDocumentStopPipeOutput(&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_deserializeOpErrorStopPipe(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(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_deserializeOpDocumentStopPipeOutput(v **StopPipeOutput, 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 *StopPipeOutput + if *v == nil { + sv = &StopPipeOutput{} + } 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 PipeArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "CurrentState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) + } + sv.CurrentState = types.PipeState(jtv) + } + + case "DesiredState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RequestedPipeState to be of type string, got %T instead", value) + } + sv.DesiredState = types.RequestedPipeState(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + 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 + + 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(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 + + 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdatePipe struct { +} + +func (*awsRestjson1_deserializeOpUpdatePipe) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdatePipe) 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_deserializeOpErrorUpdatePipe(response, &metadata) + } + output := &UpdatePipeOutput{} + 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_deserializeOpDocumentUpdatePipeOutput(&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_deserializeOpErrorUpdatePipe(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(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_deserializeOpDocumentUpdatePipeOutput(v **UpdatePipeOutput, 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 *UpdatePipeOutput + if *v == nil { + sv = &UpdatePipeOutput{} + } 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 PipeArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "CurrentState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) + } + sv.CurrentState = types.PipeState(jtv) + } + + case "DesiredState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RequestedPipeState to be of type string, got %T instead", value) + } + sv.DesiredState = types.RequestedPipeState(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeOpHttpBindingsInternalException(v *types.InternalException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +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_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalException{} + 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_deserializeDocumentInternalException(&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) + + if err := awsRestjson1_deserializeOpHttpBindingsInternalException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NotFoundException{} + 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_deserializeDocumentNotFoundException(&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_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + 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_deserializeDocumentServiceQuotaExceededException(&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) + + if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + 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_deserializeDocumentAwsVpcConfiguration(v **types.AwsVpcConfiguration, 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.AwsVpcConfiguration + if *v == nil { + sv = &types.AwsVpcConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AssignPublicIp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssignPublicIp to be of type string, got %T instead", value) + } + sv.AssignPublicIp = types.AssignPublicIp(jtv) + } + + case "SecurityGroups": + if err := awsRestjson1_deserializeDocumentSecurityGroups(&sv.SecurityGroups, value); err != nil { + return err + } + + case "Subnets": + if err := awsRestjson1_deserializeDocumentSubnets(&sv.Subnets, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchArrayProperties(v **types.BatchArrayProperties, 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.BatchArrayProperties + if *v == nil { + sv = &types.BatchArrayProperties{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Size": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected BatchArraySize to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Size = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchContainerOverrides(v **types.BatchContainerOverrides, 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.BatchContainerOverrides + if *v == nil { + sv = &types.BatchContainerOverrides{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Command": + if err := awsRestjson1_deserializeDocumentStringList(&sv.Command, value); err != nil { + return err + } + + case "Environment": + if err := awsRestjson1_deserializeDocumentBatchEnvironmentVariableList(&sv.Environment, value); err != nil { + return err + } + + case "InstanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "ResourceRequirements": + if err := awsRestjson1_deserializeDocumentBatchResourceRequirementsList(&sv.ResourceRequirements, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchDependsOn(v *[]types.BatchJobDependency, 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.BatchJobDependency + if *v == nil { + cv = []types.BatchJobDependency{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchJobDependency + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchJobDependency(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBatchEnvironmentVariable(v **types.BatchEnvironmentVariable, 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.BatchEnvironmentVariable + if *v == nil { + sv = &types.BatchEnvironmentVariable{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "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_deserializeDocumentBatchEnvironmentVariableList(v *[]types.BatchEnvironmentVariable, 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.BatchEnvironmentVariable + if *v == nil { + cv = []types.BatchEnvironmentVariable{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchEnvironmentVariable + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchEnvironmentVariable(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBatchJobDependency(v **types.BatchJobDependency, 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.BatchJobDependency + if *v == nil { + sv = &types.BatchJobDependency{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "JobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.JobId = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BatchJobDependencyType to be of type string, got %T instead", value) + } + sv.Type = types.BatchJobDependencyType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchParametersMap(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_deserializeDocumentBatchResourceRequirement(v **types.BatchResourceRequirement, 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.BatchResourceRequirement + if *v == nil { + sv = &types.BatchResourceRequirement{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BatchResourceRequirementType to be of type string, got %T instead", value) + } + sv.Type = types.BatchResourceRequirementType(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_deserializeDocumentBatchResourceRequirementsList(v *[]types.BatchResourceRequirement, 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.BatchResourceRequirement + if *v == nil { + cv = []types.BatchResourceRequirement{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchResourceRequirement + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchResourceRequirement(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBatchRetryStrategy(v **types.BatchRetryStrategy, 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.BatchRetryStrategy + if *v == nil { + sv = &types.BatchRetryStrategy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Attempts": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected BatchRetryAttempts to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Attempts = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCapacityProviderStrategy(v *[]types.CapacityProviderStrategyItem, 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.CapacityProviderStrategyItem + if *v == nil { + cv = []types.CapacityProviderStrategyItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CapacityProviderStrategyItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentCapacityProviderStrategyItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCapacityProviderStrategyItem(v **types.CapacityProviderStrategyItem, 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.CapacityProviderStrategyItem + if *v == nil { + sv = &types.CapacityProviderStrategyItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "base": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected CapacityProviderStrategyItemBase to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Base = int32(i64) + } + + case "capacityProvider": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CapacityProvider to be of type string, got %T instead", value) + } + sv.CapacityProvider = ptr.String(jtv) + } + + case "weight": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected CapacityProviderStrategyItemWeight to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Weight = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + 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) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeadLetterConfig(v **types.DeadLetterConfig, 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.DeadLetterConfig + if *v == nil { + sv = &types.DeadLetterConfig{} + } 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 Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEcsContainerOverride(v **types.EcsContainerOverride, 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.EcsContainerOverride + if *v == nil { + sv = &types.EcsContainerOverride{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Command": + if err := awsRestjson1_deserializeDocumentStringList(&sv.Command, value); err != nil { + return err + } + + case "Cpu": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Cpu = ptr.Int32(int32(i64)) + } + + case "Environment": + if err := awsRestjson1_deserializeDocumentEcsEnvironmentVariableList(&sv.Environment, value); err != nil { + return err + } + + case "EnvironmentFiles": + if err := awsRestjson1_deserializeDocumentEcsEnvironmentFileList(&sv.EnvironmentFiles, value); err != nil { + return err + } + + case "Memory": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Memory = ptr.Int32(int32(i64)) + } + + case "MemoryReservation": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MemoryReservation = ptr.Int32(int32(i64)) + } + + 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 "ResourceRequirements": + if err := awsRestjson1_deserializeDocumentEcsResourceRequirementsList(&sv.ResourceRequirements, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEcsContainerOverrideList(v *[]types.EcsContainerOverride, 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.EcsContainerOverride + if *v == nil { + cv = []types.EcsContainerOverride{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EcsContainerOverride + destAddr := &col + if err := awsRestjson1_deserializeDocumentEcsContainerOverride(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEcsEnvironmentFile(v **types.EcsEnvironmentFile, 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.EcsEnvironmentFile + if *v == nil { + sv = &types.EcsEnvironmentFile{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EcsEnvironmentFileType to be of type string, got %T instead", value) + } + sv.Type = types.EcsEnvironmentFileType(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_deserializeDocumentEcsEnvironmentFileList(v *[]types.EcsEnvironmentFile, 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.EcsEnvironmentFile + if *v == nil { + cv = []types.EcsEnvironmentFile{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EcsEnvironmentFile + destAddr := &col + if err := awsRestjson1_deserializeDocumentEcsEnvironmentFile(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEcsEnvironmentVariable(v **types.EcsEnvironmentVariable, 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.EcsEnvironmentVariable + if *v == nil { + sv = &types.EcsEnvironmentVariable{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "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_deserializeDocumentEcsEnvironmentVariableList(v *[]types.EcsEnvironmentVariable, 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.EcsEnvironmentVariable + if *v == nil { + cv = []types.EcsEnvironmentVariable{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EcsEnvironmentVariable + destAddr := &col + if err := awsRestjson1_deserializeDocumentEcsEnvironmentVariable(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEcsEphemeralStorage(v **types.EcsEphemeralStorage, 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.EcsEphemeralStorage + if *v == nil { + sv = &types.EcsEphemeralStorage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "sizeInGiB": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected EphemeralStorageSize to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SizeInGiB = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEcsInferenceAcceleratorOverride(v **types.EcsInferenceAcceleratorOverride, 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.EcsInferenceAcceleratorOverride + if *v == nil { + sv = &types.EcsInferenceAcceleratorOverride{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "deviceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DeviceName = ptr.String(jtv) + } + + case "deviceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DeviceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEcsInferenceAcceleratorOverrideList(v *[]types.EcsInferenceAcceleratorOverride, 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.EcsInferenceAcceleratorOverride + if *v == nil { + cv = []types.EcsInferenceAcceleratorOverride{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EcsInferenceAcceleratorOverride + destAddr := &col + if err := awsRestjson1_deserializeDocumentEcsInferenceAcceleratorOverride(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEcsResourceRequirement(v **types.EcsResourceRequirement, 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.EcsResourceRequirement + if *v == nil { + sv = &types.EcsResourceRequirement{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EcsResourceRequirementType to be of type string, got %T instead", value) + } + sv.Type = types.EcsResourceRequirementType(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_deserializeDocumentEcsResourceRequirementsList(v *[]types.EcsResourceRequirement, 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.EcsResourceRequirement + if *v == nil { + cv = []types.EcsResourceRequirement{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EcsResourceRequirement + destAddr := &col + if err := awsRestjson1_deserializeDocumentEcsResourceRequirement(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEcsTaskOverride(v **types.EcsTaskOverride, 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.EcsTaskOverride + if *v == nil { + sv = &types.EcsTaskOverride{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ContainerOverrides": + if err := awsRestjson1_deserializeDocumentEcsContainerOverrideList(&sv.ContainerOverrides, value); err != nil { + return err + } + + case "Cpu": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Cpu = ptr.String(jtv) + } + + case "EphemeralStorage": + if err := awsRestjson1_deserializeDocumentEcsEphemeralStorage(&sv.EphemeralStorage, value); err != nil { + return err + } + + case "ExecutionRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArnOrJsonPath to be of type string, got %T instead", value) + } + sv.ExecutionRoleArn = ptr.String(jtv) + } + + case "InferenceAcceleratorOverrides": + if err := awsRestjson1_deserializeDocumentEcsInferenceAcceleratorOverrideList(&sv.InferenceAcceleratorOverrides, value); err != nil { + return err + } + + case "Memory": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Memory = ptr.String(jtv) + } + + case "TaskRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArnOrJsonPath to be of type string, got %T instead", value) + } + sv.TaskRoleArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventBridgeEventResourceList(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 ArnOrJsonPath to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFilter(v **types.Filter, 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.Filter + if *v == nil { + sv = &types.Filter{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Pattern": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventPattern to be of type string, got %T instead", value) + } + sv.Pattern = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFilterCriteria(v **types.FilterCriteria, 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.FilterCriteria + if *v == nil { + sv = &types.FilterCriteria{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Filters": + if err := awsRestjson1_deserializeDocumentFilterList(&sv.Filters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFilterList(v *[]types.Filter, 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.Filter + if *v == nil { + cv = []types.Filter{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Filter + destAddr := &col + if err := awsRestjson1_deserializeDocumentFilter(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentHeaderParametersMap(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 HeaderValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentInternalException(v **types.InternalException, 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.InternalException + if *v == nil { + sv = &types.InternalException{} + } 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) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKafkaBootstrapServers(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 EndpointString to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentMQBrokerAccessCredentials(v *types.MQBrokerAccessCredentials, 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 uv types.MQBrokerAccessCredentials +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "BasicAuth": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.MQBrokerAccessCredentialsMemberBasicAuth{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentMSKAccessCredentials(v *types.MSKAccessCredentials, 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 uv types.MSKAccessCredentials +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "ClientCertificateTlsAuth": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.MSKAccessCredentialsMemberClientCertificateTlsAuth{Value: mv} + break loop + + case "SaslScram512Auth": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.MSKAccessCredentialsMemberSaslScram512Auth{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentNetworkConfiguration(v **types.NetworkConfiguration, 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.NetworkConfiguration + if *v == nil { + sv = &types.NetworkConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "awsvpcConfiguration": + if err := awsRestjson1_deserializeDocumentAwsVpcConfiguration(&sv.AwsvpcConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, 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.NotFoundException + if *v == nil { + sv = &types.NotFoundException{} + } 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 ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPathParameterList(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 PathParameter to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPipe(v **types.Pipe, 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.Pipe + if *v == nil { + sv = &types.Pipe{} + } 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 PipeArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "CurrentState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeState to be of type string, got %T instead", value) + } + sv.CurrentState = types.PipeState(jtv) + } + + case "DesiredState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RequestedPipeState to be of type string, got %T instead", value) + } + sv.DesiredState = types.RequestedPipeState(jtv) + } + + case "Enrichment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OptionalArn to be of type string, got %T instead", value) + } + sv.Enrichment = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArnOrUrl to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + case "StateReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeStateReason to be of type string, got %T instead", value) + } + sv.StateReason = ptr.String(jtv) + } + + case "Target": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Target = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeEnrichmentHttpParameters(v **types.PipeEnrichmentHttpParameters, 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.PipeEnrichmentHttpParameters + if *v == nil { + sv = &types.PipeEnrichmentHttpParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "HeaderParameters": + if err := awsRestjson1_deserializeDocumentHeaderParametersMap(&sv.HeaderParameters, value); err != nil { + return err + } + + case "PathParameterValues": + if err := awsRestjson1_deserializeDocumentPathParameterList(&sv.PathParameterValues, value); err != nil { + return err + } + + case "QueryStringParameters": + if err := awsRestjson1_deserializeDocumentQueryStringParametersMap(&sv.QueryStringParameters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeEnrichmentParameters(v **types.PipeEnrichmentParameters, 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.PipeEnrichmentParameters + if *v == nil { + sv = &types.PipeEnrichmentParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "HttpParameters": + if err := awsRestjson1_deserializeDocumentPipeEnrichmentHttpParameters(&sv.HttpParameters, value); err != nil { + return err + } + + case "InputTemplate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InputTemplate to be of type string, got %T instead", value) + } + sv.InputTemplate = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeList(v *[]types.Pipe, 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.Pipe + if *v == nil { + cv = []types.Pipe{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Pipe + destAddr := &col + if err := awsRestjson1_deserializeDocumentPipe(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPipeSourceActiveMQBrokerParameters(v **types.PipeSourceActiveMQBrokerParameters, 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.PipeSourceActiveMQBrokerParameters + if *v == nil { + sv = &types.PipeSourceActiveMQBrokerParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BatchSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BatchSize = ptr.Int32(int32(i64)) + } + + case "Credentials": + if err := awsRestjson1_deserializeDocumentMQBrokerAccessCredentials(&sv.Credentials, value); err != nil { + return err + } + + case "MaximumBatchingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) + } + + case "QueueName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MQBrokerQueueName to be of type string, got %T instead", value) + } + sv.QueueName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeSourceDynamoDBStreamParameters(v **types.PipeSourceDynamoDBStreamParameters, 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.PipeSourceDynamoDBStreamParameters + if *v == nil { + sv = &types.PipeSourceDynamoDBStreamParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BatchSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LimitMax1000 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BatchSize = ptr.Int32(int32(i64)) + } + + case "DeadLetterConfig": + if err := awsRestjson1_deserializeDocumentDeadLetterConfig(&sv.DeadLetterConfig, value); err != nil { + return err + } + + case "MaximumBatchingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) + } + + case "MaximumRecordAgeInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumRecordAgeInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumRecordAgeInSeconds = ptr.Int32(int32(i64)) + } + + case "MaximumRetryAttempts": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumRetryAttemptsESM to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumRetryAttempts = ptr.Int32(int32(i64)) + } + + case "OnPartialBatchItemFailure": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OnPartialBatchItemFailureStreams to be of type string, got %T instead", value) + } + sv.OnPartialBatchItemFailure = types.OnPartialBatchItemFailureStreams(jtv) + } + + case "ParallelizationFactor": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LimitMax10 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ParallelizationFactor = ptr.Int32(int32(i64)) + } + + case "StartingPosition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DynamoDBStreamStartPosition to be of type string, got %T instead", value) + } + sv.StartingPosition = types.DynamoDBStreamStartPosition(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeSourceKinesisStreamParameters(v **types.PipeSourceKinesisStreamParameters, 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.PipeSourceKinesisStreamParameters + if *v == nil { + sv = &types.PipeSourceKinesisStreamParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BatchSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BatchSize = ptr.Int32(int32(i64)) + } + + case "DeadLetterConfig": + if err := awsRestjson1_deserializeDocumentDeadLetterConfig(&sv.DeadLetterConfig, value); err != nil { + return err + } + + case "MaximumBatchingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) + } + + case "MaximumRecordAgeInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumRecordAgeInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumRecordAgeInSeconds = ptr.Int32(int32(i64)) + } + + case "MaximumRetryAttempts": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumRetryAttemptsESM to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumRetryAttempts = ptr.Int32(int32(i64)) + } + + case "OnPartialBatchItemFailure": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OnPartialBatchItemFailureStreams to be of type string, got %T instead", value) + } + sv.OnPartialBatchItemFailure = types.OnPartialBatchItemFailureStreams(jtv) + } + + case "ParallelizationFactor": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LimitMax10 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ParallelizationFactor = ptr.Int32(int32(i64)) + } + + case "StartingPosition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KinesisStreamStartPosition to be of type string, got %T instead", value) + } + sv.StartingPosition = types.KinesisStreamStartPosition(jtv) + } + + case "StartingPositionTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartingPositionTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeSourceManagedStreamingKafkaParameters(v **types.PipeSourceManagedStreamingKafkaParameters, 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.PipeSourceManagedStreamingKafkaParameters + if *v == nil { + sv = &types.PipeSourceManagedStreamingKafkaParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BatchSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BatchSize = ptr.Int32(int32(i64)) + } + + case "ConsumerGroupID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URI to be of type string, got %T instead", value) + } + sv.ConsumerGroupID = ptr.String(jtv) + } + + case "Credentials": + if err := awsRestjson1_deserializeDocumentMSKAccessCredentials(&sv.Credentials, value); err != nil { + return err + } + + case "MaximumBatchingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) + } + + case "StartingPosition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MSKStartPosition to be of type string, got %T instead", value) + } + sv.StartingPosition = types.MSKStartPosition(jtv) + } + + case "TopicName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KafkaTopicName to be of type string, got %T instead", value) + } + sv.TopicName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeSourceParameters(v **types.PipeSourceParameters, 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.PipeSourceParameters + if *v == nil { + sv = &types.PipeSourceParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ActiveMQBrokerParameters": + if err := awsRestjson1_deserializeDocumentPipeSourceActiveMQBrokerParameters(&sv.ActiveMQBrokerParameters, value); err != nil { + return err + } + + case "DynamoDBStreamParameters": + if err := awsRestjson1_deserializeDocumentPipeSourceDynamoDBStreamParameters(&sv.DynamoDBStreamParameters, value); err != nil { + return err + } + + case "FilterCriteria": + if err := awsRestjson1_deserializeDocumentFilterCriteria(&sv.FilterCriteria, value); err != nil { + return err + } + + case "KinesisStreamParameters": + if err := awsRestjson1_deserializeDocumentPipeSourceKinesisStreamParameters(&sv.KinesisStreamParameters, value); err != nil { + return err + } + + case "ManagedStreamingKafkaParameters": + if err := awsRestjson1_deserializeDocumentPipeSourceManagedStreamingKafkaParameters(&sv.ManagedStreamingKafkaParameters, value); err != nil { + return err + } + + case "RabbitMQBrokerParameters": + if err := awsRestjson1_deserializeDocumentPipeSourceRabbitMQBrokerParameters(&sv.RabbitMQBrokerParameters, value); err != nil { + return err + } + + case "SelfManagedKafkaParameters": + if err := awsRestjson1_deserializeDocumentPipeSourceSelfManagedKafkaParameters(&sv.SelfManagedKafkaParameters, value); err != nil { + return err + } + + case "SqsQueueParameters": + if err := awsRestjson1_deserializeDocumentPipeSourceSqsQueueParameters(&sv.SqsQueueParameters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeSourceRabbitMQBrokerParameters(v **types.PipeSourceRabbitMQBrokerParameters, 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.PipeSourceRabbitMQBrokerParameters + if *v == nil { + sv = &types.PipeSourceRabbitMQBrokerParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BatchSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BatchSize = ptr.Int32(int32(i64)) + } + + case "Credentials": + if err := awsRestjson1_deserializeDocumentMQBrokerAccessCredentials(&sv.Credentials, value); err != nil { + return err + } + + case "MaximumBatchingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) + } + + case "QueueName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MQBrokerQueueName to be of type string, got %T instead", value) + } + sv.QueueName = ptr.String(jtv) + } + + case "VirtualHost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URI to be of type string, got %T instead", value) + } + sv.VirtualHost = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeSourceSelfManagedKafkaParameters(v **types.PipeSourceSelfManagedKafkaParameters, 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.PipeSourceSelfManagedKafkaParameters + if *v == nil { + sv = &types.PipeSourceSelfManagedKafkaParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AdditionalBootstrapServers": + if err := awsRestjson1_deserializeDocumentKafkaBootstrapServers(&sv.AdditionalBootstrapServers, value); err != nil { + return err + } + + case "BatchSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BatchSize = ptr.Int32(int32(i64)) + } + + case "ConsumerGroupID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URI to be of type string, got %T instead", value) + } + sv.ConsumerGroupID = ptr.String(jtv) + } + + case "Credentials": + if err := awsRestjson1_deserializeDocumentSelfManagedKafkaAccessConfigurationCredentials(&sv.Credentials, value); err != nil { + return err + } + + case "MaximumBatchingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) + } + + case "ServerRootCaCertificate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) + } + sv.ServerRootCaCertificate = ptr.String(jtv) + } + + case "StartingPosition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SelfManagedKafkaStartPosition to be of type string, got %T instead", value) + } + sv.StartingPosition = types.SelfManagedKafkaStartPosition(jtv) + } + + case "TopicName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KafkaTopicName to be of type string, got %T instead", value) + } + sv.TopicName = ptr.String(jtv) + } + + case "Vpc": + if err := awsRestjson1_deserializeDocumentSelfManagedKafkaAccessConfigurationVpc(&sv.Vpc, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeSourceSqsQueueParameters(v **types.PipeSourceSqsQueueParameters, 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.PipeSourceSqsQueueParameters + if *v == nil { + sv = &types.PipeSourceSqsQueueParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BatchSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LimitMax10000 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BatchSize = ptr.Int32(int32(i64)) + } + + case "MaximumBatchingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumBatchingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumBatchingWindowInSeconds = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetBatchJobParameters(v **types.PipeTargetBatchJobParameters, 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.PipeTargetBatchJobParameters + if *v == nil { + sv = &types.PipeTargetBatchJobParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ArrayProperties": + if err := awsRestjson1_deserializeDocumentBatchArrayProperties(&sv.ArrayProperties, value); err != nil { + return err + } + + case "ContainerOverrides": + if err := awsRestjson1_deserializeDocumentBatchContainerOverrides(&sv.ContainerOverrides, value); err != nil { + return err + } + + case "DependsOn": + if err := awsRestjson1_deserializeDocumentBatchDependsOn(&sv.DependsOn, value); err != nil { + return err + } + + case "JobDefinition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.JobDefinition = ptr.String(jtv) + } + + case "JobName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.JobName = ptr.String(jtv) + } + + case "Parameters": + if err := awsRestjson1_deserializeDocumentBatchParametersMap(&sv.Parameters, value); err != nil { + return err + } + + case "RetryStrategy": + if err := awsRestjson1_deserializeDocumentBatchRetryStrategy(&sv.RetryStrategy, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetCloudWatchLogsParameters(v **types.PipeTargetCloudWatchLogsParameters, 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.PipeTargetCloudWatchLogsParameters + if *v == nil { + sv = &types.PipeTargetCloudWatchLogsParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LogStreamName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogStreamName to be of type string, got %T instead", value) + } + sv.LogStreamName = ptr.String(jtv) + } + + case "Timestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JsonPath to be of type string, got %T instead", value) + } + sv.Timestamp = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetEcsTaskParameters(v **types.PipeTargetEcsTaskParameters, 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.PipeTargetEcsTaskParameters + if *v == nil { + sv = &types.PipeTargetEcsTaskParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CapacityProviderStrategy": + if err := awsRestjson1_deserializeDocumentCapacityProviderStrategy(&sv.CapacityProviderStrategy, value); err != nil { + return err + } + + case "EnableECSManagedTags": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableECSManagedTags = jtv + } + + case "EnableExecuteCommand": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableExecuteCommand = jtv + } + + case "Group": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Group = ptr.String(jtv) + } + + case "LaunchType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LaunchType to be of type string, got %T instead", value) + } + sv.LaunchType = types.LaunchType(jtv) + } + + case "NetworkConfiguration": + if err := awsRestjson1_deserializeDocumentNetworkConfiguration(&sv.NetworkConfiguration, value); err != nil { + return err + } + + case "Overrides": + if err := awsRestjson1_deserializeDocumentEcsTaskOverride(&sv.Overrides, value); err != nil { + return err + } + + case "PlacementConstraints": + if err := awsRestjson1_deserializeDocumentPlacementConstraints(&sv.PlacementConstraints, value); err != nil { + return err + } + + case "PlacementStrategy": + if err := awsRestjson1_deserializeDocumentPlacementStrategies(&sv.PlacementStrategy, value); err != nil { + return err + } + + case "PlatformVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PlatformVersion = ptr.String(jtv) + } + + case "PropagateTags": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PropagateTags to be of type string, got %T instead", value) + } + sv.PropagateTags = types.PropagateTags(jtv) + } + + case "ReferenceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReferenceId to be of type string, got %T instead", value) + } + sv.ReferenceId = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + case "TaskCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LimitMin1 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TaskCount = ptr.Int32(int32(i64)) + } + + case "TaskDefinitionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArnOrJsonPath to be of type string, got %T instead", value) + } + sv.TaskDefinitionArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetEventBridgeEventBusParameters(v **types.PipeTargetEventBridgeEventBusParameters, 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.PipeTargetEventBridgeEventBusParameters + if *v == nil { + sv = &types.PipeTargetEventBridgeEventBusParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DetailType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventBridgeDetailType to be of type string, got %T instead", value) + } + sv.DetailType = ptr.String(jtv) + } + + case "EndpointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventBridgeEndpointId to be of type string, got %T instead", value) + } + sv.EndpointId = ptr.String(jtv) + } + + case "Resources": + if err := awsRestjson1_deserializeDocumentEventBridgeEventResourceList(&sv.Resources, value); err != nil { + return err + } + + case "Source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventBridgeEventSource to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + case "Time": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JsonPath to be of type string, got %T instead", value) + } + sv.Time = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetHttpParameters(v **types.PipeTargetHttpParameters, 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.PipeTargetHttpParameters + if *v == nil { + sv = &types.PipeTargetHttpParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "HeaderParameters": + if err := awsRestjson1_deserializeDocumentHeaderParametersMap(&sv.HeaderParameters, value); err != nil { + return err + } + + case "PathParameterValues": + if err := awsRestjson1_deserializeDocumentPathParameterList(&sv.PathParameterValues, value); err != nil { + return err + } + + case "QueryStringParameters": + if err := awsRestjson1_deserializeDocumentQueryStringParametersMap(&sv.QueryStringParameters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetKinesisStreamParameters(v **types.PipeTargetKinesisStreamParameters, 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.PipeTargetKinesisStreamParameters + if *v == nil { + sv = &types.PipeTargetKinesisStreamParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PartitionKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KinesisPartitionKey to be of type string, got %T instead", value) + } + sv.PartitionKey = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetLambdaFunctionParameters(v **types.PipeTargetLambdaFunctionParameters, 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.PipeTargetLambdaFunctionParameters + if *v == nil { + sv = &types.PipeTargetLambdaFunctionParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "InvocationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeTargetInvocationType to be of type string, got %T instead", value) + } + sv.InvocationType = types.PipeTargetInvocationType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetParameters(v **types.PipeTargetParameters, 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.PipeTargetParameters + if *v == nil { + sv = &types.PipeTargetParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BatchJobParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetBatchJobParameters(&sv.BatchJobParameters, value); err != nil { + return err + } + + case "CloudWatchLogsParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetCloudWatchLogsParameters(&sv.CloudWatchLogsParameters, value); err != nil { + return err + } + + case "EcsTaskParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetEcsTaskParameters(&sv.EcsTaskParameters, value); err != nil { + return err + } + + case "EventBridgeEventBusParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetEventBridgeEventBusParameters(&sv.EventBridgeEventBusParameters, value); err != nil { + return err + } + + case "HttpParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetHttpParameters(&sv.HttpParameters, value); err != nil { + return err + } + + case "InputTemplate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InputTemplate to be of type string, got %T instead", value) + } + sv.InputTemplate = ptr.String(jtv) + } + + case "KinesisStreamParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetKinesisStreamParameters(&sv.KinesisStreamParameters, value); err != nil { + return err + } + + case "LambdaFunctionParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetLambdaFunctionParameters(&sv.LambdaFunctionParameters, value); err != nil { + return err + } + + case "RedshiftDataParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetRedshiftDataParameters(&sv.RedshiftDataParameters, value); err != nil { + return err + } + + case "SageMakerPipelineParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetSageMakerPipelineParameters(&sv.SageMakerPipelineParameters, value); err != nil { + return err + } + + case "SqsQueueParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetSqsQueueParameters(&sv.SqsQueueParameters, value); err != nil { + return err + } + + case "StepFunctionStateMachineParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetStateMachineParameters(&sv.StepFunctionStateMachineParameters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetRedshiftDataParameters(v **types.PipeTargetRedshiftDataParameters, 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.PipeTargetRedshiftDataParameters + if *v == nil { + sv = &types.PipeTargetRedshiftDataParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Database": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Database to be of type string, got %T instead", value) + } + sv.Database = ptr.String(jtv) + } + + case "DbUser": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DbUser to be of type string, got %T instead", value) + } + sv.DbUser = ptr.String(jtv) + } + + case "SecretManagerArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretManagerArnOrJsonPath to be of type string, got %T instead", value) + } + sv.SecretManagerArn = ptr.String(jtv) + } + + case "Sqls": + if err := awsRestjson1_deserializeDocumentSqls(&sv.Sqls, value); err != nil { + return err + } + + case "StatementName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatementName to be of type string, got %T instead", value) + } + sv.StatementName = ptr.String(jtv) + } + + case "WithEvent": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.WithEvent = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetSageMakerPipelineParameters(v **types.PipeTargetSageMakerPipelineParameters, 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.PipeTargetSageMakerPipelineParameters + if *v == nil { + sv = &types.PipeTargetSageMakerPipelineParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PipelineParameterList": + if err := awsRestjson1_deserializeDocumentSageMakerPipelineParameterList(&sv.PipelineParameterList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetSqsQueueParameters(v **types.PipeTargetSqsQueueParameters, 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.PipeTargetSqsQueueParameters + if *v == nil { + sv = &types.PipeTargetSqsQueueParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MessageDeduplicationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MessageDeduplicationId to be of type string, got %T instead", value) + } + sv.MessageDeduplicationId = ptr.String(jtv) + } + + case "MessageGroupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MessageGroupId to be of type string, got %T instead", value) + } + sv.MessageGroupId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPipeTargetStateMachineParameters(v **types.PipeTargetStateMachineParameters, 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.PipeTargetStateMachineParameters + if *v == nil { + sv = &types.PipeTargetStateMachineParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "InvocationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipeTargetInvocationType to be of type string, got %T instead", value) + } + sv.InvocationType = types.PipeTargetInvocationType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPlacementConstraint(v **types.PlacementConstraint, 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.PlacementConstraint + if *v == nil { + sv = &types.PlacementConstraint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "expression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlacementConstraintExpression to be of type string, got %T instead", value) + } + sv.Expression = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlacementConstraintType to be of type string, got %T instead", value) + } + sv.Type = types.PlacementConstraintType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPlacementConstraints(v *[]types.PlacementConstraint, 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.PlacementConstraint + if *v == nil { + cv = []types.PlacementConstraint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PlacementConstraint + destAddr := &col + if err := awsRestjson1_deserializeDocumentPlacementConstraint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPlacementStrategies(v *[]types.PlacementStrategy, 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.PlacementStrategy + if *v == nil { + cv = []types.PlacementStrategy{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PlacementStrategy + destAddr := &col + if err := awsRestjson1_deserializeDocumentPlacementStrategy(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPlacementStrategy(v **types.PlacementStrategy, 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.PlacementStrategy + if *v == nil { + sv = &types.PlacementStrategy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "field": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlacementStrategyField to be of type string, got %T instead", value) + } + sv.Field = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlacementStrategyType to be of type string, got %T instead", value) + } + sv.Type = types.PlacementStrategyType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQueryStringParametersMap(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 QueryStringValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentSageMakerPipelineParameter(v **types.SageMakerPipelineParameter, 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.SageMakerPipelineParameter + if *v == nil { + sv = &types.SageMakerPipelineParameter{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SageMakerPipelineParameterName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SageMakerPipelineParameterValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSageMakerPipelineParameterList(v *[]types.SageMakerPipelineParameter, 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.SageMakerPipelineParameter + if *v == nil { + cv = []types.SageMakerPipelineParameter{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SageMakerPipelineParameter + destAddr := &col + if err := awsRestjson1_deserializeDocumentSageMakerPipelineParameter(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSecurityGroupIds(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 SecurityGroupId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSecurityGroups(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 SecurityGroup to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSelfManagedKafkaAccessConfigurationCredentials(v *types.SelfManagedKafkaAccessConfigurationCredentials, 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 uv types.SelfManagedKafkaAccessConfigurationCredentials +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "BasicAuth": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.SelfManagedKafkaAccessConfigurationCredentialsMemberBasicAuth{Value: mv} + break loop + + case "ClientCertificateTlsAuth": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.SelfManagedKafkaAccessConfigurationCredentialsMemberClientCertificateTlsAuth{Value: mv} + break loop + + case "SaslScram256Auth": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram256Auth{Value: mv} + break loop + + case "SaslScram512Auth": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretManagerArn to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram512Auth{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentSelfManagedKafkaAccessConfigurationVpc(v **types.SelfManagedKafkaAccessConfigurationVpc, 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.SelfManagedKafkaAccessConfigurationVpc + if *v == nil { + sv = &types.SelfManagedKafkaAccessConfigurationVpc{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SecurityGroup": + if err := awsRestjson1_deserializeDocumentSecurityGroupIds(&sv.SecurityGroup, value); err != nil { + return err + } + + case "Subnets": + if err := awsRestjson1_deserializeDocumentSubnetIds(&sv.Subnets, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, 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.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } 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) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSqls(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 Sql to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentStringList(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 String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSubnetIds(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 SubnetId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSubnets(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 Subnet to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTag(v **types.Tag, 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.Tag + if *v == nil { + sv = &types.Tag{} + } 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 TagKey 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 TagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, 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.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTagMap(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 TagValue 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) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceCode = 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 "fieldList": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, 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.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } 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 ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = 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_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, 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.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/pipes/doc.go b/service/pipes/doc.go new file mode 100644 index 00000000000..6cd91605fc9 --- /dev/null +++ b/service/pipes/doc.go @@ -0,0 +1,12 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package pipes provides the API client, operations, and parameter types for +// Amazon EventBridge Pipes. +// +// Amazon EventBridge Pipes connects event sources to targets. Pipes reduces the +// need for specialized knowledge and integration code when developing event driven +// architectures. This helps ensures consistency across your company’s +// applications. With Pipes, the target can be any available EventBridge target. To +// set up a pipe, you select the event source, add optional event filtering, define +// optional enrichment, and select the target for the event data. +package pipes diff --git a/service/pipes/endpoints.go b/service/pipes/endpoints.go new file mode 100644 index 00000000000..b5a2e4766a5 --- /dev/null +++ b/service/pipes/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/pipes/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" + "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) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// 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, +) { + 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 { + 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 = "pipes" + } + 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 + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(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 EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +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 + } + } + +} diff --git a/service/pipes/generated.json b/service/pipes/generated.json new file mode 100644 index 00000000000..e80ba3b3ae3 --- /dev/null +++ b/service/pipes/generated.json @@ -0,0 +1,38 @@ +{ + "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_CreatePipe.go", + "api_op_DeletePipe.go", + "api_op_DescribePipe.go", + "api_op_ListPipes.go", + "api_op_ListTagsForResource.go", + "api_op_StartPipe.go", + "api_op_StopPipe.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdatePipe.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "types/types_exported_test.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/pipes", + "unstable": false +} diff --git a/service/pipes/go.mod b/service/pipes/go.mod new file mode 100644 index 00000000000..9b552d3c7e2 --- /dev/null +++ b/service/pipes/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/pipes + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.17.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19 + github.com/aws/smithy-go v1.13.4 +) + +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/pipes/go.sum b/service/pipes/go.sum new file mode 100644 index 00000000000..b5b882cefe7 --- /dev/null +++ b/service/pipes/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.13.4 h1:/RN2z1txIJWeXeOkzX+Hk/4Uuvv7dWtCjbmVJcrskyk= +github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/pipes/go_module_metadata.go b/service/pipes/go_module_metadata.go new file mode 100644 index 00000000000..1d906ed53e4 --- /dev/null +++ b/service/pipes/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package pipes + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/pipes/internal/endpoints/endpoints.go b/service/pipes/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..a9dba422b2c --- /dev/null +++ b/service/pipes/internal/endpoints/endpoints.go @@ -0,0 +1,321 @@ +// 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 Pipes 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 + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\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: "pipes.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "pipes-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "pipes-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "pipes.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "pipes.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "pipes-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "pipes-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "pipes.{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: "pipes-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "pipes.{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: "pipes-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "pipes.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "pipes.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "pipes-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "pipes-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "pipes.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/pipes/internal/endpoints/endpoints_test.go b/service/pipes/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/pipes/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/pipes/protocol_test.go b/service/pipes/protocol_test.go new file mode 100644 index 00000000000..acab660beaa --- /dev/null +++ b/service/pipes/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes diff --git a/service/pipes/serializers.go b/service/pipes/serializers.go new file mode 100644 index 00000000000..1eec7661467 --- /dev/null +++ b/service/pipes/serializers.go @@ -0,0 +1,2741 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/pipes/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" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpCreatePipe struct { +} + +func (*awsRestjson1_serializeOpCreatePipe) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreatePipe) 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.(*CreatePipeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/pipes/{Name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreatePipeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreatePipeInput(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_serializeOpHttpBindingsCreatePipeInput(v *CreatePipeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreatePipeInput(v *CreatePipeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if len(v.DesiredState) > 0 { + ok := object.Key("DesiredState") + ok.String(string(v.DesiredState)) + } + + if v.Enrichment != nil { + ok := object.Key("Enrichment") + ok.String(*v.Enrichment) + } + + if v.EnrichmentParameters != nil { + ok := object.Key("EnrichmentParameters") + if err := awsRestjson1_serializeDocumentPipeEnrichmentParameters(v.EnrichmentParameters, ok); err != nil { + return err + } + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.Source != nil { + ok := object.Key("Source") + ok.String(*v.Source) + } + + if v.SourceParameters != nil { + ok := object.Key("SourceParameters") + if err := awsRestjson1_serializeDocumentPipeSourceParameters(v.SourceParameters, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + if v.Target != nil { + ok := object.Key("Target") + ok.String(*v.Target) + } + + if v.TargetParameters != nil { + ok := object.Key("TargetParameters") + if err := awsRestjson1_serializeDocumentPipeTargetParameters(v.TargetParameters, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeletePipe struct { +} + +func (*awsRestjson1_serializeOpDeletePipe) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeletePipe) 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.(*DeletePipeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/pipes/{Name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeletePipeInput(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_serializeOpHttpBindingsDeletePipeInput(v *DeletePipeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDescribePipe struct { +} + +func (*awsRestjson1_serializeOpDescribePipe) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribePipe) 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.(*DescribePipeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/pipes/{Name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDescribePipeInput(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_serializeOpHttpBindingsDescribePipeInput(v *DescribePipeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListPipes struct { +} + +func (*awsRestjson1_serializeOpListPipes) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListPipes) 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.(*ListPipesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/pipes") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListPipesInput(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_serializeOpHttpBindingsListPipesInput(v *ListPipesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.CurrentState) > 0 { + encoder.SetQuery("CurrentState").String(string(v.CurrentState)) + } + + if len(v.DesiredState) > 0 { + encoder.SetQuery("DesiredState").String(string(v.DesiredState)) + } + + if v.Limit != nil { + encoder.SetQuery("Limit").Integer(*v.Limit) + } + + if v.NamePrefix != nil { + encoder.SetQuery("NamePrefix").String(*v.NamePrefix) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.SourcePrefix != nil { + encoder.SetQuery("SourcePrefix").String(*v.SourcePrefix) + } + + if v.TargetPrefix != nil { + encoder.SetQuery("TargetPrefix").String(*v.TargetPrefix) + } + + 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" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpStartPipe struct { +} + +func (*awsRestjson1_serializeOpStartPipe) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartPipe) 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.(*StartPipeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/pipes/{Name}/start") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStartPipeInput(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_serializeOpHttpBindingsStartPipeInput(v *StartPipeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpStopPipe struct { +} + +func (*awsRestjson1_serializeOpStopPipe) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStopPipe) 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.(*StopPipeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/pipes/{Name}/stop") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsStopPipeInput(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_serializeOpHttpBindingsStopPipeInput(v *StopPipeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); 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 = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeDocumentTagMap(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" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpUpdatePipe struct { +} + +func (*awsRestjson1_serializeOpUpdatePipe) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdatePipe) 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.(*UpdatePipeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/pipes/{Name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdatePipeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdatePipeInput(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_serializeOpHttpBindingsUpdatePipeInput(v *UpdatePipeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdatePipeInput(v *UpdatePipeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if len(v.DesiredState) > 0 { + ok := object.Key("DesiredState") + ok.String(string(v.DesiredState)) + } + + if v.Enrichment != nil { + ok := object.Key("Enrichment") + ok.String(*v.Enrichment) + } + + if v.EnrichmentParameters != nil { + ok := object.Key("EnrichmentParameters") + if err := awsRestjson1_serializeDocumentPipeEnrichmentParameters(v.EnrichmentParameters, ok); err != nil { + return err + } + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.SourceParameters != nil { + ok := object.Key("SourceParameters") + if err := awsRestjson1_serializeDocumentUpdatePipeSourceParameters(v.SourceParameters, ok); err != nil { + return err + } + } + + if v.Target != nil { + ok := object.Key("Target") + ok.String(*v.Target) + } + + if v.TargetParameters != nil { + ok := object.Key("TargetParameters") + if err := awsRestjson1_serializeDocumentPipeTargetParameters(v.TargetParameters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsVpcConfiguration(v *types.AwsVpcConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AssignPublicIp) > 0 { + ok := object.Key("AssignPublicIp") + ok.String(string(v.AssignPublicIp)) + } + + if v.SecurityGroups != nil { + ok := object.Key("SecurityGroups") + if err := awsRestjson1_serializeDocumentSecurityGroups(v.SecurityGroups, ok); err != nil { + return err + } + } + + if v.Subnets != nil { + ok := object.Key("Subnets") + if err := awsRestjson1_serializeDocumentSubnets(v.Subnets, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentBatchArrayProperties(v *types.BatchArrayProperties, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Size != 0 { + ok := object.Key("Size") + ok.Integer(v.Size) + } + + return nil +} + +func awsRestjson1_serializeDocumentBatchContainerOverrides(v *types.BatchContainerOverrides, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Command != nil { + ok := object.Key("Command") + if err := awsRestjson1_serializeDocumentStringList(v.Command, ok); err != nil { + return err + } + } + + if v.Environment != nil { + ok := object.Key("Environment") + if err := awsRestjson1_serializeDocumentBatchEnvironmentVariableList(v.Environment, ok); err != nil { + return err + } + } + + if v.InstanceType != nil { + ok := object.Key("InstanceType") + ok.String(*v.InstanceType) + } + + if v.ResourceRequirements != nil { + ok := object.Key("ResourceRequirements") + if err := awsRestjson1_serializeDocumentBatchResourceRequirementsList(v.ResourceRequirements, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentBatchDependsOn(v []types.BatchJobDependency, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentBatchJobDependency(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentBatchEnvironmentVariable(v *types.BatchEnvironmentVariable, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentBatchEnvironmentVariableList(v []types.BatchEnvironmentVariable, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentBatchEnvironmentVariable(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentBatchJobDependency(v *types.BatchJobDependency, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.JobId != nil { + ok := object.Key("JobId") + ok.String(*v.JobId) + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentBatchParametersMap(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_serializeDocumentBatchResourceRequirement(v *types.BatchResourceRequirement, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentBatchResourceRequirementsList(v []types.BatchResourceRequirement, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentBatchResourceRequirement(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentBatchRetryStrategy(v *types.BatchRetryStrategy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Attempts != 0 { + ok := object.Key("Attempts") + ok.Integer(v.Attempts) + } + + return nil +} + +func awsRestjson1_serializeDocumentCapacityProviderStrategy(v []types.CapacityProviderStrategyItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCapacityProviderStrategyItem(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCapacityProviderStrategyItem(v *types.CapacityProviderStrategyItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Base != 0 { + ok := object.Key("base") + ok.Integer(v.Base) + } + + if v.CapacityProvider != nil { + ok := object.Key("capacityProvider") + ok.String(*v.CapacityProvider) + } + + if v.Weight != 0 { + ok := object.Key("weight") + ok.Integer(v.Weight) + } + + return nil +} + +func awsRestjson1_serializeDocumentDeadLetterConfig(v *types.DeadLetterConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arn != nil { + ok := object.Key("Arn") + ok.String(*v.Arn) + } + + return nil +} + +func awsRestjson1_serializeDocumentEcsContainerOverride(v *types.EcsContainerOverride, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Command != nil { + ok := object.Key("Command") + if err := awsRestjson1_serializeDocumentStringList(v.Command, ok); err != nil { + return err + } + } + + if v.Cpu != nil { + ok := object.Key("Cpu") + ok.Integer(*v.Cpu) + } + + if v.Environment != nil { + ok := object.Key("Environment") + if err := awsRestjson1_serializeDocumentEcsEnvironmentVariableList(v.Environment, ok); err != nil { + return err + } + } + + if v.EnvironmentFiles != nil { + ok := object.Key("EnvironmentFiles") + if err := awsRestjson1_serializeDocumentEcsEnvironmentFileList(v.EnvironmentFiles, ok); err != nil { + return err + } + } + + if v.Memory != nil { + ok := object.Key("Memory") + ok.Integer(*v.Memory) + } + + if v.MemoryReservation != nil { + ok := object.Key("MemoryReservation") + ok.Integer(*v.MemoryReservation) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.ResourceRequirements != nil { + ok := object.Key("ResourceRequirements") + if err := awsRestjson1_serializeDocumentEcsResourceRequirementsList(v.ResourceRequirements, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentEcsContainerOverrideList(v []types.EcsContainerOverride, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentEcsContainerOverride(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentEcsEnvironmentFile(v *types.EcsEnvironmentFile, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentEcsEnvironmentFileList(v []types.EcsEnvironmentFile, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentEcsEnvironmentFile(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentEcsEnvironmentVariable(v *types.EcsEnvironmentVariable, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentEcsEnvironmentVariableList(v []types.EcsEnvironmentVariable, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentEcsEnvironmentVariable(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentEcsEphemeralStorage(v *types.EcsEphemeralStorage, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + { + ok := object.Key("sizeInGiB") + ok.Integer(v.SizeInGiB) + } + + return nil +} + +func awsRestjson1_serializeDocumentEcsInferenceAcceleratorOverride(v *types.EcsInferenceAcceleratorOverride, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeviceName != nil { + ok := object.Key("deviceName") + ok.String(*v.DeviceName) + } + + if v.DeviceType != nil { + ok := object.Key("deviceType") + ok.String(*v.DeviceType) + } + + return nil +} + +func awsRestjson1_serializeDocumentEcsInferenceAcceleratorOverrideList(v []types.EcsInferenceAcceleratorOverride, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentEcsInferenceAcceleratorOverride(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentEcsResourceRequirement(v *types.EcsResourceRequirement, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentEcsResourceRequirementsList(v []types.EcsResourceRequirement, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentEcsResourceRequirement(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentEcsTaskOverride(v *types.EcsTaskOverride, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContainerOverrides != nil { + ok := object.Key("ContainerOverrides") + if err := awsRestjson1_serializeDocumentEcsContainerOverrideList(v.ContainerOverrides, ok); err != nil { + return err + } + } + + if v.Cpu != nil { + ok := object.Key("Cpu") + ok.String(*v.Cpu) + } + + if v.EphemeralStorage != nil { + ok := object.Key("EphemeralStorage") + if err := awsRestjson1_serializeDocumentEcsEphemeralStorage(v.EphemeralStorage, ok); err != nil { + return err + } + } + + if v.ExecutionRoleArn != nil { + ok := object.Key("ExecutionRoleArn") + ok.String(*v.ExecutionRoleArn) + } + + if v.InferenceAcceleratorOverrides != nil { + ok := object.Key("InferenceAcceleratorOverrides") + if err := awsRestjson1_serializeDocumentEcsInferenceAcceleratorOverrideList(v.InferenceAcceleratorOverrides, ok); err != nil { + return err + } + } + + if v.Memory != nil { + ok := object.Key("Memory") + ok.String(*v.Memory) + } + + if v.TaskRoleArn != nil { + ok := object.Key("TaskRoleArn") + ok.String(*v.TaskRoleArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentEventBridgeEventResourceList(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_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Pattern != nil { + ok := object.Key("Pattern") + ok.String(*v.Pattern) + } + + return nil +} + +func awsRestjson1_serializeDocumentFilterCriteria(v *types.FilterCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentFilterList(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_serializeDocumentHeaderParametersMap(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_serializeDocumentKafkaBootstrapServers(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_serializeDocumentMQBrokerAccessCredentials(v types.MQBrokerAccessCredentials, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.MQBrokerAccessCredentialsMemberBasicAuth: + av := object.Key("BasicAuth") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentMSKAccessCredentials(v types.MSKAccessCredentials, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.MSKAccessCredentialsMemberClientCertificateTlsAuth: + av := object.Key("ClientCertificateTlsAuth") + av.String(uv.Value) + + case *types.MSKAccessCredentialsMemberSaslScram512Auth: + av := object.Key("SaslScram512Auth") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentNetworkConfiguration(v *types.NetworkConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AwsvpcConfiguration != nil { + ok := object.Key("awsvpcConfiguration") + if err := awsRestjson1_serializeDocumentAwsVpcConfiguration(v.AwsvpcConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPathParameterList(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_serializeDocumentPipeEnrichmentHttpParameters(v *types.PipeEnrichmentHttpParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.HeaderParameters != nil { + ok := object.Key("HeaderParameters") + if err := awsRestjson1_serializeDocumentHeaderParametersMap(v.HeaderParameters, ok); err != nil { + return err + } + } + + if v.PathParameterValues != nil { + ok := object.Key("PathParameterValues") + if err := awsRestjson1_serializeDocumentPathParameterList(v.PathParameterValues, ok); err != nil { + return err + } + } + + if v.QueryStringParameters != nil { + ok := object.Key("QueryStringParameters") + if err := awsRestjson1_serializeDocumentQueryStringParametersMap(v.QueryStringParameters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeEnrichmentParameters(v *types.PipeEnrichmentParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.HttpParameters != nil { + ok := object.Key("HttpParameters") + if err := awsRestjson1_serializeDocumentPipeEnrichmentHttpParameters(v.HttpParameters, ok); err != nil { + return err + } + } + + if v.InputTemplate != nil { + ok := object.Key("InputTemplate") + ok.String(*v.InputTemplate) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeSourceActiveMQBrokerParameters(v *types.PipeSourceActiveMQBrokerParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.Credentials != nil { + ok := object.Key("Credentials") + if err := awsRestjson1_serializeDocumentMQBrokerAccessCredentials(v.Credentials, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + if v.QueueName != nil { + ok := object.Key("QueueName") + ok.String(*v.QueueName) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeSourceDynamoDBStreamParameters(v *types.PipeSourceDynamoDBStreamParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.DeadLetterConfig != nil { + ok := object.Key("DeadLetterConfig") + if err := awsRestjson1_serializeDocumentDeadLetterConfig(v.DeadLetterConfig, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + if v.MaximumRecordAgeInSeconds != nil { + ok := object.Key("MaximumRecordAgeInSeconds") + ok.Integer(*v.MaximumRecordAgeInSeconds) + } + + if v.MaximumRetryAttempts != nil { + ok := object.Key("MaximumRetryAttempts") + ok.Integer(*v.MaximumRetryAttempts) + } + + if len(v.OnPartialBatchItemFailure) > 0 { + ok := object.Key("OnPartialBatchItemFailure") + ok.String(string(v.OnPartialBatchItemFailure)) + } + + if v.ParallelizationFactor != nil { + ok := object.Key("ParallelizationFactor") + ok.Integer(*v.ParallelizationFactor) + } + + if len(v.StartingPosition) > 0 { + ok := object.Key("StartingPosition") + ok.String(string(v.StartingPosition)) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeSourceKinesisStreamParameters(v *types.PipeSourceKinesisStreamParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.DeadLetterConfig != nil { + ok := object.Key("DeadLetterConfig") + if err := awsRestjson1_serializeDocumentDeadLetterConfig(v.DeadLetterConfig, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + if v.MaximumRecordAgeInSeconds != nil { + ok := object.Key("MaximumRecordAgeInSeconds") + ok.Integer(*v.MaximumRecordAgeInSeconds) + } + + if v.MaximumRetryAttempts != nil { + ok := object.Key("MaximumRetryAttempts") + ok.Integer(*v.MaximumRetryAttempts) + } + + if len(v.OnPartialBatchItemFailure) > 0 { + ok := object.Key("OnPartialBatchItemFailure") + ok.String(string(v.OnPartialBatchItemFailure)) + } + + if v.ParallelizationFactor != nil { + ok := object.Key("ParallelizationFactor") + ok.Integer(*v.ParallelizationFactor) + } + + if len(v.StartingPosition) > 0 { + ok := object.Key("StartingPosition") + ok.String(string(v.StartingPosition)) + } + + if v.StartingPositionTimestamp != nil { + ok := object.Key("StartingPositionTimestamp") + ok.Double(smithytime.FormatEpochSeconds(*v.StartingPositionTimestamp)) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeSourceManagedStreamingKafkaParameters(v *types.PipeSourceManagedStreamingKafkaParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.ConsumerGroupID != nil { + ok := object.Key("ConsumerGroupID") + ok.String(*v.ConsumerGroupID) + } + + if v.Credentials != nil { + ok := object.Key("Credentials") + if err := awsRestjson1_serializeDocumentMSKAccessCredentials(v.Credentials, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + if len(v.StartingPosition) > 0 { + ok := object.Key("StartingPosition") + ok.String(string(v.StartingPosition)) + } + + if v.TopicName != nil { + ok := object.Key("TopicName") + ok.String(*v.TopicName) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeSourceParameters(v *types.PipeSourceParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ActiveMQBrokerParameters != nil { + ok := object.Key("ActiveMQBrokerParameters") + if err := awsRestjson1_serializeDocumentPipeSourceActiveMQBrokerParameters(v.ActiveMQBrokerParameters, ok); err != nil { + return err + } + } + + if v.DynamoDBStreamParameters != nil { + ok := object.Key("DynamoDBStreamParameters") + if err := awsRestjson1_serializeDocumentPipeSourceDynamoDBStreamParameters(v.DynamoDBStreamParameters, ok); err != nil { + return err + } + } + + if v.FilterCriteria != nil { + ok := object.Key("FilterCriteria") + if err := awsRestjson1_serializeDocumentFilterCriteria(v.FilterCriteria, ok); err != nil { + return err + } + } + + if v.KinesisStreamParameters != nil { + ok := object.Key("KinesisStreamParameters") + if err := awsRestjson1_serializeDocumentPipeSourceKinesisStreamParameters(v.KinesisStreamParameters, ok); err != nil { + return err + } + } + + if v.ManagedStreamingKafkaParameters != nil { + ok := object.Key("ManagedStreamingKafkaParameters") + if err := awsRestjson1_serializeDocumentPipeSourceManagedStreamingKafkaParameters(v.ManagedStreamingKafkaParameters, ok); err != nil { + return err + } + } + + if v.RabbitMQBrokerParameters != nil { + ok := object.Key("RabbitMQBrokerParameters") + if err := awsRestjson1_serializeDocumentPipeSourceRabbitMQBrokerParameters(v.RabbitMQBrokerParameters, ok); err != nil { + return err + } + } + + if v.SelfManagedKafkaParameters != nil { + ok := object.Key("SelfManagedKafkaParameters") + if err := awsRestjson1_serializeDocumentPipeSourceSelfManagedKafkaParameters(v.SelfManagedKafkaParameters, ok); err != nil { + return err + } + } + + if v.SqsQueueParameters != nil { + ok := object.Key("SqsQueueParameters") + if err := awsRestjson1_serializeDocumentPipeSourceSqsQueueParameters(v.SqsQueueParameters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeSourceRabbitMQBrokerParameters(v *types.PipeSourceRabbitMQBrokerParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.Credentials != nil { + ok := object.Key("Credentials") + if err := awsRestjson1_serializeDocumentMQBrokerAccessCredentials(v.Credentials, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + if v.QueueName != nil { + ok := object.Key("QueueName") + ok.String(*v.QueueName) + } + + if v.VirtualHost != nil { + ok := object.Key("VirtualHost") + ok.String(*v.VirtualHost) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeSourceSelfManagedKafkaParameters(v *types.PipeSourceSelfManagedKafkaParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalBootstrapServers != nil { + ok := object.Key("AdditionalBootstrapServers") + if err := awsRestjson1_serializeDocumentKafkaBootstrapServers(v.AdditionalBootstrapServers, ok); err != nil { + return err + } + } + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.ConsumerGroupID != nil { + ok := object.Key("ConsumerGroupID") + ok.String(*v.ConsumerGroupID) + } + + if v.Credentials != nil { + ok := object.Key("Credentials") + if err := awsRestjson1_serializeDocumentSelfManagedKafkaAccessConfigurationCredentials(v.Credentials, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + if v.ServerRootCaCertificate != nil { + ok := object.Key("ServerRootCaCertificate") + ok.String(*v.ServerRootCaCertificate) + } + + if len(v.StartingPosition) > 0 { + ok := object.Key("StartingPosition") + ok.String(string(v.StartingPosition)) + } + + if v.TopicName != nil { + ok := object.Key("TopicName") + ok.String(*v.TopicName) + } + + if v.Vpc != nil { + ok := object.Key("Vpc") + if err := awsRestjson1_serializeDocumentSelfManagedKafkaAccessConfigurationVpc(v.Vpc, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeSourceSqsQueueParameters(v *types.PipeSourceSqsQueueParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetBatchJobParameters(v *types.PipeTargetBatchJobParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ArrayProperties != nil { + ok := object.Key("ArrayProperties") + if err := awsRestjson1_serializeDocumentBatchArrayProperties(v.ArrayProperties, ok); err != nil { + return err + } + } + + if v.ContainerOverrides != nil { + ok := object.Key("ContainerOverrides") + if err := awsRestjson1_serializeDocumentBatchContainerOverrides(v.ContainerOverrides, ok); err != nil { + return err + } + } + + if v.DependsOn != nil { + ok := object.Key("DependsOn") + if err := awsRestjson1_serializeDocumentBatchDependsOn(v.DependsOn, ok); err != nil { + return err + } + } + + if v.JobDefinition != nil { + ok := object.Key("JobDefinition") + ok.String(*v.JobDefinition) + } + + if v.JobName != nil { + ok := object.Key("JobName") + ok.String(*v.JobName) + } + + if v.Parameters != nil { + ok := object.Key("Parameters") + if err := awsRestjson1_serializeDocumentBatchParametersMap(v.Parameters, ok); err != nil { + return err + } + } + + if v.RetryStrategy != nil { + ok := object.Key("RetryStrategy") + if err := awsRestjson1_serializeDocumentBatchRetryStrategy(v.RetryStrategy, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetCloudWatchLogsParameters(v *types.PipeTargetCloudWatchLogsParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LogStreamName != nil { + ok := object.Key("LogStreamName") + ok.String(*v.LogStreamName) + } + + if v.Timestamp != nil { + ok := object.Key("Timestamp") + ok.String(*v.Timestamp) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetEcsTaskParameters(v *types.PipeTargetEcsTaskParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CapacityProviderStrategy != nil { + ok := object.Key("CapacityProviderStrategy") + if err := awsRestjson1_serializeDocumentCapacityProviderStrategy(v.CapacityProviderStrategy, ok); err != nil { + return err + } + } + + if v.EnableECSManagedTags { + ok := object.Key("EnableECSManagedTags") + ok.Boolean(v.EnableECSManagedTags) + } + + if v.EnableExecuteCommand { + ok := object.Key("EnableExecuteCommand") + ok.Boolean(v.EnableExecuteCommand) + } + + if v.Group != nil { + ok := object.Key("Group") + ok.String(*v.Group) + } + + if len(v.LaunchType) > 0 { + ok := object.Key("LaunchType") + ok.String(string(v.LaunchType)) + } + + if v.NetworkConfiguration != nil { + ok := object.Key("NetworkConfiguration") + if err := awsRestjson1_serializeDocumentNetworkConfiguration(v.NetworkConfiguration, ok); err != nil { + return err + } + } + + if v.Overrides != nil { + ok := object.Key("Overrides") + if err := awsRestjson1_serializeDocumentEcsTaskOverride(v.Overrides, ok); err != nil { + return err + } + } + + if v.PlacementConstraints != nil { + ok := object.Key("PlacementConstraints") + if err := awsRestjson1_serializeDocumentPlacementConstraints(v.PlacementConstraints, ok); err != nil { + return err + } + } + + if v.PlacementStrategy != nil { + ok := object.Key("PlacementStrategy") + if err := awsRestjson1_serializeDocumentPlacementStrategies(v.PlacementStrategy, ok); err != nil { + return err + } + } + + if v.PlatformVersion != nil { + ok := object.Key("PlatformVersion") + ok.String(*v.PlatformVersion) + } + + if len(v.PropagateTags) > 0 { + ok := object.Key("PropagateTags") + ok.String(string(v.PropagateTags)) + } + + if v.ReferenceId != nil { + ok := object.Key("ReferenceId") + ok.String(*v.ReferenceId) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + if v.TaskCount != nil { + ok := object.Key("TaskCount") + ok.Integer(*v.TaskCount) + } + + if v.TaskDefinitionArn != nil { + ok := object.Key("TaskDefinitionArn") + ok.String(*v.TaskDefinitionArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetEventBridgeEventBusParameters(v *types.PipeTargetEventBridgeEventBusParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DetailType != nil { + ok := object.Key("DetailType") + ok.String(*v.DetailType) + } + + if v.EndpointId != nil { + ok := object.Key("EndpointId") + ok.String(*v.EndpointId) + } + + if v.Resources != nil { + ok := object.Key("Resources") + if err := awsRestjson1_serializeDocumentEventBridgeEventResourceList(v.Resources, ok); err != nil { + return err + } + } + + if v.Source != nil { + ok := object.Key("Source") + ok.String(*v.Source) + } + + if v.Time != nil { + ok := object.Key("Time") + ok.String(*v.Time) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetHttpParameters(v *types.PipeTargetHttpParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.HeaderParameters != nil { + ok := object.Key("HeaderParameters") + if err := awsRestjson1_serializeDocumentHeaderParametersMap(v.HeaderParameters, ok); err != nil { + return err + } + } + + if v.PathParameterValues != nil { + ok := object.Key("PathParameterValues") + if err := awsRestjson1_serializeDocumentPathParameterList(v.PathParameterValues, ok); err != nil { + return err + } + } + + if v.QueryStringParameters != nil { + ok := object.Key("QueryStringParameters") + if err := awsRestjson1_serializeDocumentQueryStringParametersMap(v.QueryStringParameters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetKinesisStreamParameters(v *types.PipeTargetKinesisStreamParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PartitionKey != nil { + ok := object.Key("PartitionKey") + ok.String(*v.PartitionKey) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetLambdaFunctionParameters(v *types.PipeTargetLambdaFunctionParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.InvocationType) > 0 { + ok := object.Key("InvocationType") + ok.String(string(v.InvocationType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetParameters(v *types.PipeTargetParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchJobParameters != nil { + ok := object.Key("BatchJobParameters") + if err := awsRestjson1_serializeDocumentPipeTargetBatchJobParameters(v.BatchJobParameters, ok); err != nil { + return err + } + } + + if v.CloudWatchLogsParameters != nil { + ok := object.Key("CloudWatchLogsParameters") + if err := awsRestjson1_serializeDocumentPipeTargetCloudWatchLogsParameters(v.CloudWatchLogsParameters, ok); err != nil { + return err + } + } + + if v.EcsTaskParameters != nil { + ok := object.Key("EcsTaskParameters") + if err := awsRestjson1_serializeDocumentPipeTargetEcsTaskParameters(v.EcsTaskParameters, ok); err != nil { + return err + } + } + + if v.EventBridgeEventBusParameters != nil { + ok := object.Key("EventBridgeEventBusParameters") + if err := awsRestjson1_serializeDocumentPipeTargetEventBridgeEventBusParameters(v.EventBridgeEventBusParameters, ok); err != nil { + return err + } + } + + if v.HttpParameters != nil { + ok := object.Key("HttpParameters") + if err := awsRestjson1_serializeDocumentPipeTargetHttpParameters(v.HttpParameters, ok); err != nil { + return err + } + } + + if v.InputTemplate != nil { + ok := object.Key("InputTemplate") + ok.String(*v.InputTemplate) + } + + if v.KinesisStreamParameters != nil { + ok := object.Key("KinesisStreamParameters") + if err := awsRestjson1_serializeDocumentPipeTargetKinesisStreamParameters(v.KinesisStreamParameters, ok); err != nil { + return err + } + } + + if v.LambdaFunctionParameters != nil { + ok := object.Key("LambdaFunctionParameters") + if err := awsRestjson1_serializeDocumentPipeTargetLambdaFunctionParameters(v.LambdaFunctionParameters, ok); err != nil { + return err + } + } + + if v.RedshiftDataParameters != nil { + ok := object.Key("RedshiftDataParameters") + if err := awsRestjson1_serializeDocumentPipeTargetRedshiftDataParameters(v.RedshiftDataParameters, ok); err != nil { + return err + } + } + + if v.SageMakerPipelineParameters != nil { + ok := object.Key("SageMakerPipelineParameters") + if err := awsRestjson1_serializeDocumentPipeTargetSageMakerPipelineParameters(v.SageMakerPipelineParameters, ok); err != nil { + return err + } + } + + if v.SqsQueueParameters != nil { + ok := object.Key("SqsQueueParameters") + if err := awsRestjson1_serializeDocumentPipeTargetSqsQueueParameters(v.SqsQueueParameters, ok); err != nil { + return err + } + } + + if v.StepFunctionStateMachineParameters != nil { + ok := object.Key("StepFunctionStateMachineParameters") + if err := awsRestjson1_serializeDocumentPipeTargetStateMachineParameters(v.StepFunctionStateMachineParameters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetRedshiftDataParameters(v *types.PipeTargetRedshiftDataParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Database != nil { + ok := object.Key("Database") + ok.String(*v.Database) + } + + if v.DbUser != nil { + ok := object.Key("DbUser") + ok.String(*v.DbUser) + } + + if v.SecretManagerArn != nil { + ok := object.Key("SecretManagerArn") + ok.String(*v.SecretManagerArn) + } + + if v.Sqls != nil { + ok := object.Key("Sqls") + if err := awsRestjson1_serializeDocumentSqls(v.Sqls, ok); err != nil { + return err + } + } + + if v.StatementName != nil { + ok := object.Key("StatementName") + ok.String(*v.StatementName) + } + + if v.WithEvent { + ok := object.Key("WithEvent") + ok.Boolean(v.WithEvent) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetSageMakerPipelineParameters(v *types.PipeTargetSageMakerPipelineParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PipelineParameterList != nil { + ok := object.Key("PipelineParameterList") + if err := awsRestjson1_serializeDocumentSageMakerPipelineParameterList(v.PipelineParameterList, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetSqsQueueParameters(v *types.PipeTargetSqsQueueParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MessageDeduplicationId != nil { + ok := object.Key("MessageDeduplicationId") + ok.String(*v.MessageDeduplicationId) + } + + if v.MessageGroupId != nil { + ok := object.Key("MessageGroupId") + ok.String(*v.MessageGroupId) + } + + return nil +} + +func awsRestjson1_serializeDocumentPipeTargetStateMachineParameters(v *types.PipeTargetStateMachineParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.InvocationType) > 0 { + ok := object.Key("InvocationType") + ok.String(string(v.InvocationType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentPlacementConstraint(v *types.PlacementConstraint, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Expression != nil { + ok := object.Key("expression") + ok.String(*v.Expression) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentPlacementConstraints(v []types.PlacementConstraint, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPlacementConstraint(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentPlacementStrategies(v []types.PlacementStrategy, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPlacementStrategy(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentPlacementStrategy(v *types.PlacementStrategy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Field != nil { + ok := object.Key("field") + ok.String(*v.Field) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentQueryStringParametersMap(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_serializeDocumentSageMakerPipelineParameter(v *types.SageMakerPipelineParameter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentSageMakerPipelineParameterList(v []types.SageMakerPipelineParameter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSageMakerPipelineParameter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentSecurityGroupIds(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_serializeDocumentSecurityGroups(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_serializeDocumentSelfManagedKafkaAccessConfigurationCredentials(v types.SelfManagedKafkaAccessConfigurationCredentials, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.SelfManagedKafkaAccessConfigurationCredentialsMemberBasicAuth: + av := object.Key("BasicAuth") + av.String(uv.Value) + + case *types.SelfManagedKafkaAccessConfigurationCredentialsMemberClientCertificateTlsAuth: + av := object.Key("ClientCertificateTlsAuth") + av.String(uv.Value) + + case *types.SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram256Auth: + av := object.Key("SaslScram256Auth") + av.String(uv.Value) + + case *types.SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram512Auth: + av := object.Key("SaslScram512Auth") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentSelfManagedKafkaAccessConfigurationVpc(v *types.SelfManagedKafkaAccessConfigurationVpc, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecurityGroup != nil { + ok := object.Key("SecurityGroup") + if err := awsRestjson1_serializeDocumentSecurityGroupIds(v.SecurityGroup, ok); err != nil { + return err + } + } + + if v.Subnets != nil { + ok := object.Key("Subnets") + if err := awsRestjson1_serializeDocumentSubnetIds(v.Subnets, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentSqls(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_serializeDocumentStringList(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_serializeDocumentSubnetIds(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_serializeDocumentSubnets(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_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentTagMap(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_serializeDocumentUpdatePipeSourceActiveMQBrokerParameters(v *types.UpdatePipeSourceActiveMQBrokerParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.Credentials != nil { + ok := object.Key("Credentials") + if err := awsRestjson1_serializeDocumentMQBrokerAccessCredentials(v.Credentials, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + return nil +} + +func awsRestjson1_serializeDocumentUpdatePipeSourceDynamoDBStreamParameters(v *types.UpdatePipeSourceDynamoDBStreamParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.DeadLetterConfig != nil { + ok := object.Key("DeadLetterConfig") + if err := awsRestjson1_serializeDocumentDeadLetterConfig(v.DeadLetterConfig, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + if v.MaximumRecordAgeInSeconds != nil { + ok := object.Key("MaximumRecordAgeInSeconds") + ok.Integer(*v.MaximumRecordAgeInSeconds) + } + + if v.MaximumRetryAttempts != nil { + ok := object.Key("MaximumRetryAttempts") + ok.Integer(*v.MaximumRetryAttempts) + } + + if len(v.OnPartialBatchItemFailure) > 0 { + ok := object.Key("OnPartialBatchItemFailure") + ok.String(string(v.OnPartialBatchItemFailure)) + } + + if v.ParallelizationFactor != nil { + ok := object.Key("ParallelizationFactor") + ok.Integer(*v.ParallelizationFactor) + } + + return nil +} + +func awsRestjson1_serializeDocumentUpdatePipeSourceKinesisStreamParameters(v *types.UpdatePipeSourceKinesisStreamParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.DeadLetterConfig != nil { + ok := object.Key("DeadLetterConfig") + if err := awsRestjson1_serializeDocumentDeadLetterConfig(v.DeadLetterConfig, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + if v.MaximumRecordAgeInSeconds != nil { + ok := object.Key("MaximumRecordAgeInSeconds") + ok.Integer(*v.MaximumRecordAgeInSeconds) + } + + if v.MaximumRetryAttempts != nil { + ok := object.Key("MaximumRetryAttempts") + ok.Integer(*v.MaximumRetryAttempts) + } + + if len(v.OnPartialBatchItemFailure) > 0 { + ok := object.Key("OnPartialBatchItemFailure") + ok.String(string(v.OnPartialBatchItemFailure)) + } + + if v.ParallelizationFactor != nil { + ok := object.Key("ParallelizationFactor") + ok.Integer(*v.ParallelizationFactor) + } + + return nil +} + +func awsRestjson1_serializeDocumentUpdatePipeSourceManagedStreamingKafkaParameters(v *types.UpdatePipeSourceManagedStreamingKafkaParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.Credentials != nil { + ok := object.Key("Credentials") + if err := awsRestjson1_serializeDocumentMSKAccessCredentials(v.Credentials, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + return nil +} + +func awsRestjson1_serializeDocumentUpdatePipeSourceParameters(v *types.UpdatePipeSourceParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ActiveMQBrokerParameters != nil { + ok := object.Key("ActiveMQBrokerParameters") + if err := awsRestjson1_serializeDocumentUpdatePipeSourceActiveMQBrokerParameters(v.ActiveMQBrokerParameters, ok); err != nil { + return err + } + } + + if v.DynamoDBStreamParameters != nil { + ok := object.Key("DynamoDBStreamParameters") + if err := awsRestjson1_serializeDocumentUpdatePipeSourceDynamoDBStreamParameters(v.DynamoDBStreamParameters, ok); err != nil { + return err + } + } + + if v.FilterCriteria != nil { + ok := object.Key("FilterCriteria") + if err := awsRestjson1_serializeDocumentFilterCriteria(v.FilterCriteria, ok); err != nil { + return err + } + } + + if v.KinesisStreamParameters != nil { + ok := object.Key("KinesisStreamParameters") + if err := awsRestjson1_serializeDocumentUpdatePipeSourceKinesisStreamParameters(v.KinesisStreamParameters, ok); err != nil { + return err + } + } + + if v.ManagedStreamingKafkaParameters != nil { + ok := object.Key("ManagedStreamingKafkaParameters") + if err := awsRestjson1_serializeDocumentUpdatePipeSourceManagedStreamingKafkaParameters(v.ManagedStreamingKafkaParameters, ok); err != nil { + return err + } + } + + if v.RabbitMQBrokerParameters != nil { + ok := object.Key("RabbitMQBrokerParameters") + if err := awsRestjson1_serializeDocumentUpdatePipeSourceRabbitMQBrokerParameters(v.RabbitMQBrokerParameters, ok); err != nil { + return err + } + } + + if v.SelfManagedKafkaParameters != nil { + ok := object.Key("SelfManagedKafkaParameters") + if err := awsRestjson1_serializeDocumentUpdatePipeSourceSelfManagedKafkaParameters(v.SelfManagedKafkaParameters, ok); err != nil { + return err + } + } + + if v.SqsQueueParameters != nil { + ok := object.Key("SqsQueueParameters") + if err := awsRestjson1_serializeDocumentUpdatePipeSourceSqsQueueParameters(v.SqsQueueParameters, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentUpdatePipeSourceRabbitMQBrokerParameters(v *types.UpdatePipeSourceRabbitMQBrokerParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.Credentials != nil { + ok := object.Key("Credentials") + if err := awsRestjson1_serializeDocumentMQBrokerAccessCredentials(v.Credentials, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + return nil +} + +func awsRestjson1_serializeDocumentUpdatePipeSourceSelfManagedKafkaParameters(v *types.UpdatePipeSourceSelfManagedKafkaParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.Credentials != nil { + ok := object.Key("Credentials") + if err := awsRestjson1_serializeDocumentSelfManagedKafkaAccessConfigurationCredentials(v.Credentials, ok); err != nil { + return err + } + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + if v.ServerRootCaCertificate != nil { + ok := object.Key("ServerRootCaCertificate") + ok.String(*v.ServerRootCaCertificate) + } + + if v.Vpc != nil { + ok := object.Key("Vpc") + if err := awsRestjson1_serializeDocumentSelfManagedKafkaAccessConfigurationVpc(v.Vpc, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentUpdatePipeSourceSqsQueueParameters(v *types.UpdatePipeSourceSqsQueueParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BatchSize != nil { + ok := object.Key("BatchSize") + ok.Integer(*v.BatchSize) + } + + if v.MaximumBatchingWindowInSeconds != nil { + ok := object.Key("MaximumBatchingWindowInSeconds") + ok.Integer(*v.MaximumBatchingWindowInSeconds) + } + + return nil +} diff --git a/service/pipes/types/enums.go b/service/pipes/types/enums.go new file mode 100644 index 00000000000..e0ec860d16e --- /dev/null +++ b/service/pipes/types/enums.go @@ -0,0 +1,352 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type AssignPublicIp string + +// Enum values for AssignPublicIp +const ( + AssignPublicIpEnabled AssignPublicIp = "ENABLED" + AssignPublicIpDisabled AssignPublicIp = "DISABLED" +) + +// Values returns all known values for AssignPublicIp. 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 (AssignPublicIp) Values() []AssignPublicIp { + return []AssignPublicIp{ + "ENABLED", + "DISABLED", + } +} + +type BatchJobDependencyType string + +// Enum values for BatchJobDependencyType +const ( + BatchJobDependencyTypeNToN BatchJobDependencyType = "N_TO_N" + BatchJobDependencyTypeSequential BatchJobDependencyType = "SEQUENTIAL" +) + +// Values returns all known values for BatchJobDependencyType. 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 (BatchJobDependencyType) Values() []BatchJobDependencyType { + return []BatchJobDependencyType{ + "N_TO_N", + "SEQUENTIAL", + } +} + +type BatchResourceRequirementType string + +// Enum values for BatchResourceRequirementType +const ( + BatchResourceRequirementTypeGpu BatchResourceRequirementType = "GPU" + BatchResourceRequirementTypeMemory BatchResourceRequirementType = "MEMORY" + BatchResourceRequirementTypeVcpu BatchResourceRequirementType = "VCPU" +) + +// Values returns all known values for BatchResourceRequirementType. 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 (BatchResourceRequirementType) Values() []BatchResourceRequirementType { + return []BatchResourceRequirementType{ + "GPU", + "MEMORY", + "VCPU", + } +} + +type DynamoDBStreamStartPosition string + +// Enum values for DynamoDBStreamStartPosition +const ( + DynamoDBStreamStartPositionTrimHorizon DynamoDBStreamStartPosition = "TRIM_HORIZON" + DynamoDBStreamStartPositionLatest DynamoDBStreamStartPosition = "LATEST" +) + +// Values returns all known values for DynamoDBStreamStartPosition. 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 (DynamoDBStreamStartPosition) Values() []DynamoDBStreamStartPosition { + return []DynamoDBStreamStartPosition{ + "TRIM_HORIZON", + "LATEST", + } +} + +type EcsEnvironmentFileType string + +// Enum values for EcsEnvironmentFileType +const ( + EcsEnvironmentFileTypeS3 EcsEnvironmentFileType = "s3" +) + +// Values returns all known values for EcsEnvironmentFileType. 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 (EcsEnvironmentFileType) Values() []EcsEnvironmentFileType { + return []EcsEnvironmentFileType{ + "s3", + } +} + +type EcsResourceRequirementType string + +// Enum values for EcsResourceRequirementType +const ( + EcsResourceRequirementTypeGpu EcsResourceRequirementType = "GPU" + EcsResourceRequirementTypeInferenceAccelerator EcsResourceRequirementType = "InferenceAccelerator" +) + +// Values returns all known values for EcsResourceRequirementType. 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 (EcsResourceRequirementType) Values() []EcsResourceRequirementType { + return []EcsResourceRequirementType{ + "GPU", + "InferenceAccelerator", + } +} + +type KinesisStreamStartPosition string + +// Enum values for KinesisStreamStartPosition +const ( + KinesisStreamStartPositionTrimHorizon KinesisStreamStartPosition = "TRIM_HORIZON" + KinesisStreamStartPositionLatest KinesisStreamStartPosition = "LATEST" + KinesisStreamStartPositionAtTimestamp KinesisStreamStartPosition = "AT_TIMESTAMP" +) + +// Values returns all known values for KinesisStreamStartPosition. 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 (KinesisStreamStartPosition) Values() []KinesisStreamStartPosition { + return []KinesisStreamStartPosition{ + "TRIM_HORIZON", + "LATEST", + "AT_TIMESTAMP", + } +} + +type LaunchType string + +// Enum values for LaunchType +const ( + LaunchTypeEc2 LaunchType = "EC2" + LaunchTypeFargate LaunchType = "FARGATE" + LaunchTypeExternal LaunchType = "EXTERNAL" +) + +// Values returns all known values for LaunchType. 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 (LaunchType) Values() []LaunchType { + return []LaunchType{ + "EC2", + "FARGATE", + "EXTERNAL", + } +} + +type MSKStartPosition string + +// Enum values for MSKStartPosition +const ( + MSKStartPositionTrimHorizon MSKStartPosition = "TRIM_HORIZON" + MSKStartPositionLatest MSKStartPosition = "LATEST" +) + +// Values returns all known values for MSKStartPosition. 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 (MSKStartPosition) Values() []MSKStartPosition { + return []MSKStartPosition{ + "TRIM_HORIZON", + "LATEST", + } +} + +type OnPartialBatchItemFailureStreams string + +// Enum values for OnPartialBatchItemFailureStreams +const ( + OnPartialBatchItemFailureStreamsAutomaticBisect OnPartialBatchItemFailureStreams = "AUTOMATIC_BISECT" +) + +// Values returns all known values for OnPartialBatchItemFailureStreams. 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 (OnPartialBatchItemFailureStreams) Values() []OnPartialBatchItemFailureStreams { + return []OnPartialBatchItemFailureStreams{ + "AUTOMATIC_BISECT", + } +} + +type PipeState string + +// Enum values for PipeState +const ( + PipeStateRunning PipeState = "RUNNING" + PipeStateStopped PipeState = "STOPPED" + PipeStateCreating PipeState = "CREATING" + PipeStateUpdating PipeState = "UPDATING" + PipeStateDeleting PipeState = "DELETING" + PipeStateStarting PipeState = "STARTING" + PipeStateStopping PipeState = "STOPPING" + PipeStateCreateFailed PipeState = "CREATE_FAILED" + PipeStateUpdateFailed PipeState = "UPDATE_FAILED" + PipeStateStartFailed PipeState = "START_FAILED" + PipeStateStopFailed PipeState = "STOP_FAILED" +) + +// Values returns all known values for PipeState. 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 (PipeState) Values() []PipeState { + return []PipeState{ + "RUNNING", + "STOPPED", + "CREATING", + "UPDATING", + "DELETING", + "STARTING", + "STOPPING", + "CREATE_FAILED", + "UPDATE_FAILED", + "START_FAILED", + "STOP_FAILED", + } +} + +type PipeTargetInvocationType string + +// Enum values for PipeTargetInvocationType +const ( + PipeTargetInvocationTypeRequestResponse PipeTargetInvocationType = "REQUEST_RESPONSE" + PipeTargetInvocationTypeFireAndForget PipeTargetInvocationType = "FIRE_AND_FORGET" +) + +// Values returns all known values for PipeTargetInvocationType. 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 (PipeTargetInvocationType) Values() []PipeTargetInvocationType { + return []PipeTargetInvocationType{ + "REQUEST_RESPONSE", + "FIRE_AND_FORGET", + } +} + +type PlacementConstraintType string + +// Enum values for PlacementConstraintType +const ( + PlacementConstraintTypeDistinctInstance PlacementConstraintType = "distinctInstance" + PlacementConstraintTypeMemberOf PlacementConstraintType = "memberOf" +) + +// Values returns all known values for PlacementConstraintType. 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 (PlacementConstraintType) Values() []PlacementConstraintType { + return []PlacementConstraintType{ + "distinctInstance", + "memberOf", + } +} + +type PlacementStrategyType string + +// Enum values for PlacementStrategyType +const ( + PlacementStrategyTypeRandom PlacementStrategyType = "random" + PlacementStrategyTypeSpread PlacementStrategyType = "spread" + PlacementStrategyTypeBinpack PlacementStrategyType = "binpack" +) + +// Values returns all known values for PlacementStrategyType. 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 (PlacementStrategyType) Values() []PlacementStrategyType { + return []PlacementStrategyType{ + "random", + "spread", + "binpack", + } +} + +type PropagateTags string + +// Enum values for PropagateTags +const ( + PropagateTagsTaskDefinition PropagateTags = "TASK_DEFINITION" +) + +// Values returns all known values for PropagateTags. 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 (PropagateTags) Values() []PropagateTags { + return []PropagateTags{ + "TASK_DEFINITION", + } +} + +type RequestedPipeState string + +// Enum values for RequestedPipeState +const ( + RequestedPipeStateRunning RequestedPipeState = "RUNNING" + RequestedPipeStateStopped RequestedPipeState = "STOPPED" +) + +// Values returns all known values for RequestedPipeState. 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 (RequestedPipeState) Values() []RequestedPipeState { + return []RequestedPipeState{ + "RUNNING", + "STOPPED", + } +} + +type RequestedPipeStateDescribeResponse string + +// Enum values for RequestedPipeStateDescribeResponse +const ( + RequestedPipeStateDescribeResponseRunning RequestedPipeStateDescribeResponse = "RUNNING" + RequestedPipeStateDescribeResponseStopped RequestedPipeStateDescribeResponse = "STOPPED" + RequestedPipeStateDescribeResponseDeleted RequestedPipeStateDescribeResponse = "DELETED" +) + +// Values returns all known values for RequestedPipeStateDescribeResponse. 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 (RequestedPipeStateDescribeResponse) Values() []RequestedPipeStateDescribeResponse { + return []RequestedPipeStateDescribeResponse{ + "RUNNING", + "STOPPED", + "DELETED", + } +} + +type SelfManagedKafkaStartPosition string + +// Enum values for SelfManagedKafkaStartPosition +const ( + SelfManagedKafkaStartPositionTrimHorizon SelfManagedKafkaStartPosition = "TRIM_HORIZON" + SelfManagedKafkaStartPositionLatest SelfManagedKafkaStartPosition = "LATEST" +) + +// Values returns all known values for SelfManagedKafkaStartPosition. 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 (SelfManagedKafkaStartPosition) Values() []SelfManagedKafkaStartPosition { + return []SelfManagedKafkaStartPosition{ + "TRIM_HORIZON", + "LATEST", + } +} diff --git a/service/pipes/types/errors.go b/service/pipes/types/errors.go new file mode 100644 index 00000000000..8ded3f01a2f --- /dev/null +++ b/service/pipes/types/errors.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// An action you attempted resulted in an exception. +type ConflictException struct { + Message *string + + ResourceId *string + ResourceType *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 { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// This exception occurs due to unexpected causes. +type InternalException struct { + Message *string + + RetryAfterSeconds *int32 + + noSmithyDocumentSerde +} + +func (e *InternalException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalException) ErrorCode() string { return "InternalException" } +func (e *InternalException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// An entity that you specified does not exist. +type NotFoundException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *NotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *NotFoundException) ErrorCode() string { return "NotFoundException" } +func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A quota has been exceeded. +type ServiceQuotaExceededException struct { + Message *string + + ResourceId *string + ResourceType *string + ServiceCode *string + QuotaCode *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An action was throttled. +type ThrottlingException struct { + Message *string + + ServiceCode *string + QuotaCode *string + RetryAfterSeconds *int32 + + 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 { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that an error has occurred while performing a validate operation. +type ValidationException struct { + Message *string + + FieldList []ValidationExceptionField + + 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 { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/pipes/types/types.go b/service/pipes/types/types.go new file mode 100644 index 00000000000..01ff7a7180e --- /dev/null +++ b/service/pipes/types/types.go @@ -0,0 +1,1544 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// This structure specifies the VPC subnets and security groups for the task, and +// whether a public IP address is to be used. This structure is relevant only for +// ECS tasks that use the awsvpc network mode. +type AwsVpcConfiguration struct { + + // Specifies the subnets associated with the task. These subnets must all be in the + // same VPC. You can specify as many as 16 subnets. + // + // This member is required. + Subnets []string + + // Specifies whether the task's elastic network interface receives a public IP + // address. You can specify ENABLED only when LaunchType in EcsParameters is set to + // FARGATE. + AssignPublicIp AssignPublicIp + + // Specifies the security groups associated with the task. These security groups + // must all be in the same VPC. You can specify as many as five security groups. If + // you do not specify a security group, the default security group for the VPC is + // used. + SecurityGroups []string + + noSmithyDocumentSerde +} + +// The array properties for the submitted job, such as the size of the array. The +// array size can be between 2 and 10,000. If you specify array properties for a +// job, it becomes an array job. This parameter is used only if the target is an +// Batch job. +type BatchArrayProperties struct { + + // The size of the array, if this is an array batch job. + Size int32 + + noSmithyDocumentSerde +} + +// The overrides that are sent to a container. +type BatchContainerOverrides struct { + + // The command to send to the container that overrides the default command from the + // Docker image or the task definition. + Command []string + + // The environment variables to send to the container. You can add new environment + // variables, which are added to the container at launch, or you can override the + // existing environment variables from the Docker image or the task definition. + // Environment variables cannot start with "Batch". This naming convention is + // reserved for variables that Batch sets. + Environment []BatchEnvironmentVariable + + // The instance type to use for a multi-node parallel job. This parameter isn't + // applicable to single-node container jobs or jobs that run on Fargate resources, + // and shouldn't be provided. + InstanceType *string + + // The type and amount of resources to assign to a container. This overrides the + // settings in the job definition. The supported resources include GPU, MEMORY, and + // VCPU. + ResourceRequirements []BatchResourceRequirement + + noSmithyDocumentSerde +} + +// The environment variables to send to the container. You can add new environment +// variables, which are added to the container at launch, or you can override the +// existing environment variables from the Docker image or the task definition. +// Environment variables cannot start with "Batch". This naming convention is +// reserved for variables that Batch sets. +type BatchEnvironmentVariable struct { + + // The name of the key-value pair. For environment variables, this is the name of + // the environment variable. + Name *string + + // The value of the key-value pair. For environment variables, this is the value of + // the environment variable. + Value *string + + noSmithyDocumentSerde +} + +// An object that represents an Batch job dependency. +type BatchJobDependency struct { + + // The job ID of the Batch job that's associated with this dependency. + JobId *string + + // The type of the job dependency. + Type BatchJobDependencyType + + noSmithyDocumentSerde +} + +// The type and amount of a resource to assign to a container. The supported +// resources include GPU, MEMORY, and VCPU. +type BatchResourceRequirement struct { + + // The type of resource to assign to a container. The supported resources include + // GPU, MEMORY, and VCPU. + // + // This member is required. + Type BatchResourceRequirementType + + // The quantity of the specified resource to reserve for the container. The values + // vary based on the type specified. type="GPU" The number of physical GPUs to + // reserve for the container. Make sure that the number of GPUs reserved for all + // containers in a job doesn't exceed the number of available GPUs on the compute + // resource that the job is launched on. GPUs aren't available for jobs that are + // running on Fargate resources. type="MEMORY" The memory hard limit (in MiB) + // present to the container. This parameter is supported for jobs that are running + // on EC2 resources. If your container attempts to exceed the memory specified, the + // container is terminated. This parameter maps to Memory in the Create a + // container (https://docs.docker.com/engine/api/v1.23/#create-a-container) section + // of the Docker Remote API (https://docs.docker.com/engine/api/v1.23/) and the + // --memory option to docker run (https://docs.docker.com/engine/reference/run/). + // You must specify at least 4 MiB of memory for a job. This is required but can be + // specified in several places for multi-node parallel (MNP) jobs. It must be + // specified for each node at least once. This parameter maps to Memory in the + // Create a container + // (https://docs.docker.com/engine/api/v1.23/#create-a-container) section of the + // Docker Remote API (https://docs.docker.com/engine/api/v1.23/) and the --memory + // option to docker run (https://docs.docker.com/engine/reference/run/). If you're + // trying to maximize your resource utilization by providing your jobs as much + // memory as possible for a particular instance type, see Memory management + // (https://docs.aws.amazon.com/batch/latest/userguide/memory-management.html) in + // the Batch User Guide. For jobs that are running on Fargate resources, then value + // is the hard limit (in MiB), and must match one of the supported values and the + // VCPU values must be one of the values supported for that memory value. value = + // 512 VCPU = 0.25 value = 1024 VCPU = 0.25 or 0.5 value = 2048 VCPU = 0.25, 0.5, + // or 1 value = 3072 VCPU = 0.5, or 1 value = 4096 VCPU = 0.5, 1, or 2 value = + // 5120, 6144, or 7168 VCPU = 1 or 2 value = 8192 VCPU = 1, 2, 4, or 8 value = + // 9216, 10240, 11264, 12288, 13312, 14336, or 15360 VCPU = 2 or 4 value = 16384 + // VCPU = 2, 4, or 8 value = 17408, 18432, 19456, 21504, 22528, 23552, 25600, + // 26624, 27648, 29696, or 30720 VCPU = 4 value = 20480, 24576, or 28672 VCPU = 4 + // or 8 value = 36864, 45056, 53248, or 61440 VCPU = 8 value = 32768, 40960, 49152, + // or 57344 VCPU = 8 or 16 value = 65536, 73728, 81920, 90112, 98304, 106496, + // 114688, or 122880 VCPU = 16 type="VCPU" The number of vCPUs reserved for the + // container. This parameter maps to CpuShares in the Create a container + // (https://docs.docker.com/engine/api/v1.23/#create-a-container) section of the + // Docker Remote API (https://docs.docker.com/engine/api/v1.23/) and the + // --cpu-shares option to docker run + // (https://docs.docker.com/engine/reference/run/). Each vCPU is equivalent to + // 1,024 CPU shares. For EC2 resources, you must specify at least one vCPU. This is + // required but can be specified in several places; it must be specified for each + // node at least once. The default for the Fargate On-Demand vCPU resource count + // quota is 6 vCPUs. For more information about Fargate quotas, see Fargate quotas + // (https://docs.aws.amazon.com/general/latest/gr/ecs-service.html#service-quotas-fargate) + // in the Amazon Web Services General Reference. For jobs that are running on + // Fargate resources, then value must match one of the supported values and the + // MEMORY values must be one of the values supported for that VCPU value. The + // supported values are 0.25, 0.5, 1, 2, 4, 8, and 16 value = 0.25 MEMORY = 512, + // 1024, or 2048 value = 0.5 MEMORY = 1024, 2048, 3072, or 4096 value = 1 MEMORY = + // 2048, 3072, 4096, 5120, 6144, 7168, or 8192 value = 2 MEMORY = 4096, 5120, 6144, + // 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, or 16384 value = 4 + // MEMORY = 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, 16384, 17408, + // 18432, 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, 27648, 28672, + // 29696, or 30720 value = 8 MEMORY = 16384, 20480, 24576, 28672, 32768, 36864, + // 40960, 45056, 49152, 53248, 57344, or 61440 value = 16 MEMORY = 32768, 40960, + // 49152, 57344, 65536, 73728, 81920, 90112, 98304, 106496, 114688, or 122880 + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// The retry strategy that's associated with a job. For more information, see +// Automated job retries +// (https://docs.aws.amazon.com/batch/latest/userguide/job_retries.html) in the +// Batch User Guide. +type BatchRetryStrategy struct { + + // The number of times to move a job to the RUNNABLE status. If the value of + // attempts is greater than one, the job is retried on failure the same number of + // attempts as the value. + Attempts int32 + + noSmithyDocumentSerde +} + +// The details of a capacity provider strategy. To learn more, see +// CapacityProviderStrategyItem +// (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CapacityProviderStrategyItem.html) +// in the Amazon ECS API Reference. +type CapacityProviderStrategyItem struct { + + // The short name of the capacity provider. + // + // This member is required. + CapacityProvider *string + + // The base value designates how many tasks, at a minimum, to run on the specified + // capacity provider. Only one capacity provider in a capacity provider strategy + // can have a base defined. If no value is specified, the default value of 0 is + // used. + Base int32 + + // The weight value designates the relative percentage of the total number of tasks + // launched that should use the specified capacity provider. The weight value is + // taken into consideration after the base value, if defined, is satisfied. + Weight int32 + + noSmithyDocumentSerde +} + +// A DeadLetterConfig object that contains information about a dead-letter queue +// configuration. +type DeadLetterConfig struct { + + // The ARN of the Amazon SQS queue specified as the target for the dead-letter + // queue. + Arn *string + + noSmithyDocumentSerde +} + +// The overrides that are sent to a container. An empty container override can be +// passed in. An example of an empty container override is {"containerOverrides": [ +// ] }. If a non-empty container override is specified, the name parameter must be +// included. +type EcsContainerOverride struct { + + // The command to send to the container that overrides the default command from the + // Docker image or the task definition. You must also specify a container name. + Command []string + + // The number of cpu units reserved for the container, instead of the default value + // from the task definition. You must also specify a container name. + Cpu *int32 + + // The environment variables to send to the container. You can add new environment + // variables, which are added to the container at launch, or you can override the + // existing environment variables from the Docker image or the task definition. You + // must also specify a container name. + Environment []EcsEnvironmentVariable + + // A list of files containing the environment variables to pass to a container, + // instead of the value from the container definition. + EnvironmentFiles []EcsEnvironmentFile + + // The hard limit (in MiB) of memory to present to the container, instead of the + // default value from the task definition. If your container attempts to exceed the + // memory specified here, the container is killed. You must also specify a + // container name. + Memory *int32 + + // The soft limit (in MiB) of memory to reserve for the container, instead of the + // default value from the task definition. You must also specify a container name. + MemoryReservation *int32 + + // The name of the container that receives the override. This parameter is required + // if any override is specified. + Name *string + + // The type and amount of a resource to assign to a container, instead of the + // default value from the task definition. The only supported resource is a GPU. + ResourceRequirements []EcsResourceRequirement + + noSmithyDocumentSerde +} + +// A list of files containing the environment variables to pass to a container. You +// can specify up to ten environment files. The file must have a .env file +// extension. Each line in an environment file should contain an environment +// variable in VARIABLE=VALUE format. Lines beginning with # are treated as +// comments and are ignored. For more information about the environment variable +// file syntax, see Declare default environment variables in file +// (https://docs.docker.com/compose/env-file/). If there are environment variables +// specified using the environment parameter in a container definition, they take +// precedence over the variables contained within an environment file. If multiple +// environment files are specified that contain the same variable, they're +// processed from the top down. We recommend that you use unique variable names. +// For more information, see Specifying environment variables +// (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html) +// in the Amazon Elastic Container Service Developer Guide. This parameter is only +// supported for tasks hosted on Fargate using the following platform versions: +// +// * +// Linux platform version 1.4.0 or later. +// +// * Windows platform version 1.0.0 or +// later. +type EcsEnvironmentFile struct { + + // The file type to use. The only supported value is s3. + // + // This member is required. + Type EcsEnvironmentFileType + + // The Amazon Resource Name (ARN) of the Amazon S3 object containing the + // environment variable file. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// The environment variables to send to the container. You can add new environment +// variables, which are added to the container at launch, or you can override the +// existing environment variables from the Docker image or the task definition. You +// must also specify a container name. +type EcsEnvironmentVariable struct { + + // The name of the key-value pair. For environment variables, this is the name of + // the environment variable. + Name *string + + // The value of the key-value pair. For environment variables, this is the value of + // the environment variable. + Value *string + + noSmithyDocumentSerde +} + +// The amount of ephemeral storage to allocate for the task. This parameter is used +// to expand the total amount of ephemeral storage available, beyond the default +// amount, for tasks hosted on Fargate. For more information, see Fargate task +// storage +// (https://docs.aws.amazon.com/AmazonECS/latest/userguide/using_data_volumes.html) +// in the Amazon ECS User Guide for Fargate. This parameter is only supported for +// tasks hosted on Fargate using Linux platform version 1.4.0 or later. This +// parameter is not supported for Windows containers on Fargate. +type EcsEphemeralStorage struct { + + // The total amount, in GiB, of ephemeral storage to set for the task. The minimum + // supported value is 21 GiB and the maximum supported value is 200 GiB. + // + // This member is required. + SizeInGiB int32 + + noSmithyDocumentSerde +} + +// Details on an Elastic Inference accelerator task override. This parameter is +// used to override the Elastic Inference accelerator specified in the task +// definition. For more information, see Working with Amazon Elastic Inference on +// Amazon ECS +// (https://docs.aws.amazon.com/AmazonECS/latest/userguide/ecs-inference.html) in +// the Amazon Elastic Container Service Developer Guide. +type EcsInferenceAcceleratorOverride struct { + + // The Elastic Inference accelerator device name to override for the task. This + // parameter must match a deviceName specified in the task definition. + DeviceName *string + + // The Elastic Inference accelerator type to use. + DeviceType *string + + noSmithyDocumentSerde +} + +// The type and amount of a resource to assign to a container. The supported +// resource types are GPUs and Elastic Inference accelerators. For more +// information, see Working with GPUs on Amazon ECS +// (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-gpu.html) or +// Working with Amazon Elastic Inference on Amazon ECS +// (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-inference.html) +// in the Amazon Elastic Container Service Developer Guide +type EcsResourceRequirement struct { + + // The type of resource to assign to a container. The supported values are GPU or + // InferenceAccelerator. + // + // This member is required. + Type EcsResourceRequirementType + + // The value for the specified resource type. If the GPU type is used, the value is + // the number of physical GPUs the Amazon ECS container agent reserves for the + // container. The number of GPUs that's reserved for all containers in a task can't + // exceed the number of available GPUs on the container instance that the task is + // launched on. If the InferenceAccelerator type is used, the value matches the + // deviceName for an InferenceAccelerator specified in a task definition. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// The overrides that are associated with a task. +type EcsTaskOverride struct { + + // One or more container overrides that are sent to a task. + ContainerOverrides []EcsContainerOverride + + // The cpu override for the task. + Cpu *string + + // The ephemeral storage setting override for the task. This parameter is only + // supported for tasks hosted on Fargate that use the following platform + // versions: + // + // * Linux platform version 1.4.0 or later. + // + // * Windows platform version + // 1.0.0 or later. + EphemeralStorage *EcsEphemeralStorage + + // The Amazon Resource Name (ARN) of the task execution IAM role override for the + // task. For more information, see Amazon ECS task execution IAM role + // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) + // in the Amazon Elastic Container Service Developer Guide. + ExecutionRoleArn *string + + // The Elastic Inference accelerator override for the task. + InferenceAcceleratorOverrides []EcsInferenceAcceleratorOverride + + // The memory override for the task. + Memory *string + + // The Amazon Resource Name (ARN) of the IAM role that containers in this task can + // assume. All containers in this task are granted the permissions that are + // specified in this role. For more information, see IAM Role for Tasks + // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) + // in the Amazon Elastic Container Service Developer Guide. + TaskRoleArn *string + + noSmithyDocumentSerde +} + +// Filter events using an event pattern. For more information, see Events and Event +// Patterns +// (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) +// in the Amazon EventBridge User Guide. +type Filter struct { + + // The event pattern. + Pattern *string + + noSmithyDocumentSerde +} + +// The collection of event patterns used to filter events. For more information, +// see Events and Event Patterns +// (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) +// in the Amazon EventBridge User Guide. +type FilterCriteria struct { + + // The event patterns. + Filters []Filter + + noSmithyDocumentSerde +} + +// The Secrets Manager secret that stores your broker credentials. +// +// The following types satisfy this interface: +// +// MQBrokerAccessCredentialsMemberBasicAuth +type MQBrokerAccessCredentials interface { + isMQBrokerAccessCredentials() +} + +// The ARN of the Secrets Manager secret. +type MQBrokerAccessCredentialsMemberBasicAuth struct { + Value string + + noSmithyDocumentSerde +} + +func (*MQBrokerAccessCredentialsMemberBasicAuth) isMQBrokerAccessCredentials() {} + +// The Secrets Manager secret that stores your stream credentials. +// +// The following types satisfy this interface: +// +// MSKAccessCredentialsMemberClientCertificateTlsAuth +// MSKAccessCredentialsMemberSaslScram512Auth +type MSKAccessCredentials interface { + isMSKAccessCredentials() +} + +// The ARN of the Secrets Manager secret. +type MSKAccessCredentialsMemberClientCertificateTlsAuth struct { + Value string + + noSmithyDocumentSerde +} + +func (*MSKAccessCredentialsMemberClientCertificateTlsAuth) isMSKAccessCredentials() {} + +// The ARN of the Secrets Manager secret. +type MSKAccessCredentialsMemberSaslScram512Auth struct { + Value string + + noSmithyDocumentSerde +} + +func (*MSKAccessCredentialsMemberSaslScram512Auth) isMSKAccessCredentials() {} + +// This structure specifies the network configuration for an Amazon ECS task. +type NetworkConfiguration struct { + + // Use this structure to specify the VPC subnets and security groups for the task, + // and whether a public IP address is to be used. This structure is relevant only + // for ECS tasks that use the awsvpc network mode. + AwsvpcConfiguration *AwsVpcConfiguration + + noSmithyDocumentSerde +} + +// An object that represents a pipe. Amazon EventBridgePipes connect event sources +// to targets and reduces the need for specialized knowledge and integration code. +type Pipe struct { + + // The ARN of the pipe. + Arn *string + + // The time the pipe was created. + CreationTime *time.Time + + // The state the pipe is in. + CurrentState PipeState + + // The state the pipe should be in. + DesiredState RequestedPipeState + + // The ARN of the enrichment resource. + Enrichment *string + + // When the pipe was last updated, in ISO-8601 format + // (https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + LastModifiedTime *time.Time + + // The name of the pipe. + Name *string + + // The ARN of the source resource. + Source *string + + // The reason the pipe is in its current state. + StateReason *string + + // The ARN of the target resource. + Target *string + + noSmithyDocumentSerde +} + +// These are custom parameter to be used when the target is an API Gateway REST +// APIs or EventBridge ApiDestinations. In the latter case, these are merged with +// any InvocationParameters specified on the Connection, with any values from the +// Connection taking precedence. +type PipeEnrichmentHttpParameters struct { + + // The headers that need to be sent as part of request invoking the API Gateway + // REST API or EventBridge ApiDestination. + HeaderParameters map[string]string + + // The path parameter values to be used to populate API Gateway REST API or + // EventBridge ApiDestination path wildcards ("*"). + PathParameterValues []string + + // The query string keys/values that need to be sent as part of request invoking + // the API Gateway REST API or EventBridge ApiDestination. + QueryStringParameters map[string]string + + noSmithyDocumentSerde +} + +// The parameters required to set up enrichment on your pipe. +type PipeEnrichmentParameters struct { + + // Contains the HTTP parameters to use when the target is a API Gateway REST + // endpoint or EventBridge ApiDestination. If you specify an API Gateway REST API + // or EventBridge ApiDestination as a target, you can use this parameter to specify + // headers, path parameters, and query string keys/values as part of your target + // invoking request. If you're using ApiDestinations, the corresponding Connection + // can also have these values configured. In case of any conflicting keys, values + // from the Connection take precedence. + HttpParameters *PipeEnrichmentHttpParameters + + // Valid JSON text passed to the enrichment. In this case, nothing from the event + // itself is passed to the enrichment. For more information, see The JavaScript + // Object Notation (JSON) Data Interchange Format + // (http://www.rfc-editor.org/rfc/rfc7159.txt). + InputTemplate *string + + noSmithyDocumentSerde +} + +// The parameters for using an Active MQ broker as a source. +type PipeSourceActiveMQBrokerParameters struct { + + // The credentials needed to access the resource. + // + // This member is required. + Credentials MQBrokerAccessCredentials + + // The name of the destination queue to consume. + // + // This member is required. + QueueName *string + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + noSmithyDocumentSerde +} + +// The parameters for using a DynamoDB stream as a source. +type PipeSourceDynamoDBStreamParameters struct { + + // (Streams only) The position in a stream from which to start reading. + // + // This member is required. + StartingPosition DynamoDBStreamStartPosition + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // Define the target queue to send dead-letter queue events to. + DeadLetterConfig *DeadLetterConfig + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + // (Streams only) Discard records older than the specified age. The default value + // is -1, which sets the maximum age to infinite. When the value is set to + // infinite, EventBridge never discards old records. + MaximumRecordAgeInSeconds *int32 + + // (Streams only) Discard records after the specified number of retries. The + // default value is -1, which sets the maximum number of retries to infinite. When + // MaximumRetryAttempts is infinite, EventBridge retries failed records until the + // record expires in the event source. + MaximumRetryAttempts *int32 + + // (Streams only) Define how to handle item process failures. AUTOMATIC_BISECT + // halves each batch and retry each half until all the records are processed or + // there is one failed message left in the batch. + OnPartialBatchItemFailure OnPartialBatchItemFailureStreams + + // (Streams only) The number of batches to process concurrently from each shard. + // The default value is 1. + ParallelizationFactor *int32 + + noSmithyDocumentSerde +} + +// The parameters for using a Kinesis stream as a source. +type PipeSourceKinesisStreamParameters struct { + + // (Streams only) The position in a stream from which to start reading. + // + // This member is required. + StartingPosition KinesisStreamStartPosition + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // Define the target queue to send dead-letter queue events to. + DeadLetterConfig *DeadLetterConfig + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + // (Streams only) Discard records older than the specified age. The default value + // is -1, which sets the maximum age to infinite. When the value is set to + // infinite, EventBridge never discards old records. + MaximumRecordAgeInSeconds *int32 + + // (Streams only) Discard records after the specified number of retries. The + // default value is -1, which sets the maximum number of retries to infinite. When + // MaximumRetryAttempts is infinite, EventBridge retries failed records until the + // record expires in the event source. + MaximumRetryAttempts *int32 + + // (Streams only) Define how to handle item process failures. AUTOMATIC_BISECT + // halves each batch and retry each half until all the records are processed or + // there is one failed message left in the batch. + OnPartialBatchItemFailure OnPartialBatchItemFailureStreams + + // (Streams only) The number of batches to process concurrently from each shard. + // The default value is 1. + ParallelizationFactor *int32 + + // With StartingPosition set to AT_TIMESTAMP, the time from which to start reading, + // in Unix time seconds. + StartingPositionTimestamp *time.Time + + noSmithyDocumentSerde +} + +// The parameters for using an MSK stream as a source. +type PipeSourceManagedStreamingKafkaParameters struct { + + // The name of the topic that the pipe will read from. + // + // This member is required. + TopicName *string + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // The name of the destination queue to consume. + ConsumerGroupID *string + + // The credentials needed to access the resource. + Credentials MSKAccessCredentials + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + // (Streams only) The position in a stream from which to start reading. + StartingPosition MSKStartPosition + + noSmithyDocumentSerde +} + +// The parameters required to set up a source for your pipe. +type PipeSourceParameters struct { + + // The parameters for using an Active MQ broker as a source. + ActiveMQBrokerParameters *PipeSourceActiveMQBrokerParameters + + // The parameters for using a DynamoDB stream as a source. + DynamoDBStreamParameters *PipeSourceDynamoDBStreamParameters + + // The collection of event patterns used to filter events. For more information, + // see Events and Event Patterns + // (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) + // in the Amazon EventBridge User Guide. + FilterCriteria *FilterCriteria + + // The parameters for using a Kinesis stream as a source. + KinesisStreamParameters *PipeSourceKinesisStreamParameters + + // The parameters for using an MSK stream as a source. + ManagedStreamingKafkaParameters *PipeSourceManagedStreamingKafkaParameters + + // The parameters for using a Rabbit MQ broker as a source. + RabbitMQBrokerParameters *PipeSourceRabbitMQBrokerParameters + + // The parameters for using a self-managed Apache Kafka stream as a source. + SelfManagedKafkaParameters *PipeSourceSelfManagedKafkaParameters + + // The parameters for using a Amazon SQS stream as a source. + SqsQueueParameters *PipeSourceSqsQueueParameters + + noSmithyDocumentSerde +} + +// The parameters for using a Rabbit MQ broker as a source. +type PipeSourceRabbitMQBrokerParameters struct { + + // The credentials needed to access the resource. + // + // This member is required. + Credentials MQBrokerAccessCredentials + + // The name of the destination queue to consume. + // + // This member is required. + QueueName *string + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + // The name of the virtual host associated with the source broker. + VirtualHost *string + + noSmithyDocumentSerde +} + +// The parameters for using a self-managed Apache Kafka stream as a source. +type PipeSourceSelfManagedKafkaParameters struct { + + // The name of the topic that the pipe will read from. + // + // This member is required. + TopicName *string + + // An array of server URLs. + AdditionalBootstrapServers []string + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // The name of the destination queue to consume. + ConsumerGroupID *string + + // The credentials needed to access the resource. + Credentials SelfManagedKafkaAccessConfigurationCredentials + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + // The ARN of the Secrets Manager secret used for certification. + ServerRootCaCertificate *string + + // (Streams only) The position in a stream from which to start reading. + StartingPosition SelfManagedKafkaStartPosition + + // This structure specifies the VPC subnets and security groups for the stream, and + // whether a public IP address is to be used. + Vpc *SelfManagedKafkaAccessConfigurationVpc + + noSmithyDocumentSerde +} + +// The parameters for using a Amazon SQS stream as a source. +type PipeSourceSqsQueueParameters struct { + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + noSmithyDocumentSerde +} + +// The parameters for using an Batch job as a target. +type PipeTargetBatchJobParameters struct { + + // The job definition used by this job. This value can be one of name, + // name:revision, or the Amazon Resource Name (ARN) for the job definition. If name + // is specified without a revision then the latest active revision is used. + // + // This member is required. + JobDefinition *string + + // The name of the job. It can be up to 128 letters long. The first character must + // be alphanumeric, can contain uppercase and lowercase letters, numbers, hyphens + // (-), and underscores (_). + // + // This member is required. + JobName *string + + // The array properties for the submitted job, such as the size of the array. The + // array size can be between 2 and 10,000. If you specify array properties for a + // job, it becomes an array job. This parameter is used only if the target is an + // Batch job. + ArrayProperties *BatchArrayProperties + + // The overrides that are sent to a container. + ContainerOverrides *BatchContainerOverrides + + // A list of dependencies for the job. A job can depend upon a maximum of 20 jobs. + // You can specify a SEQUENTIAL type dependency without specifying a job ID for + // array jobs so that each child array job completes sequentially, starting at + // index 0. You can also specify an N_TO_N type dependency with a job ID for array + // jobs. In that case, each index child of this job must wait for the corresponding + // index child of each dependency to complete before it can begin. + DependsOn []BatchJobDependency + + // Additional parameters passed to the job that replace parameter substitution + // placeholders that are set in the job definition. Parameters are specified as a + // key and value pair mapping. Parameters included here override any corresponding + // parameter defaults from the job definition. + Parameters map[string]string + + // The retry strategy to use for failed jobs. When a retry strategy is specified + // here, it overrides the retry strategy defined in the job definition. + RetryStrategy *BatchRetryStrategy + + noSmithyDocumentSerde +} + +// The parameters for using an CloudWatch Logs log stream as a target. +type PipeTargetCloudWatchLogsParameters struct { + + // The name of the log stream. + LogStreamName *string + + // The time the event occurred, expressed as the number of milliseconds after Jan + // 1, 1970 00:00:00 UTC. + Timestamp *string + + noSmithyDocumentSerde +} + +// The parameters for using an Amazon ECS task as a target. +type PipeTargetEcsTaskParameters struct { + + // The ARN of the task definition to use if the event target is an Amazon ECS task. + // + // This member is required. + TaskDefinitionArn *string + + // The capacity provider strategy to use for the task. If a + // capacityProviderStrategy is specified, the launchType parameter must be omitted. + // If no capacityProviderStrategy or launchType is specified, the + // defaultCapacityProviderStrategy for the cluster is used. + CapacityProviderStrategy []CapacityProviderStrategyItem + + // Specifies whether to enable Amazon ECS managed tags for the task. For more + // information, see Tagging Your Amazon ECS Resources + // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) + // in the Amazon Elastic Container Service Developer Guide. + EnableECSManagedTags bool + + // Whether or not to enable the execute command functionality for the containers in + // this task. If true, this enables execute command functionality on all containers + // in the task. + EnableExecuteCommand bool + + // Specifies an Amazon ECS task group for the task. The maximum length is 255 + // characters. + Group *string + + // Specifies the launch type on which your task is running. The launch type that + // you specify here must match one of the launch type (compatibilities) of the + // target task. The FARGATE value is supported only in the Regions where Fargate + // with Amazon ECS is supported. For more information, see Fargate on Amazon ECS + // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS-Fargate.html) + // in the Amazon Elastic Container Service Developer Guide. + LaunchType LaunchType + + // Use this structure if the Amazon ECS task uses the awsvpc network mode. This + // structure specifies the VPC subnets and security groups associated with the + // task, and whether a public IP address is to be used. This structure is required + // if LaunchType is FARGATE because the awsvpc mode is required for Fargate tasks. + // If you specify NetworkConfiguration when the target ECS task does not use the + // awsvpc network mode, the task fails. + NetworkConfiguration *NetworkConfiguration + + // The overrides that are associated with a task. + Overrides *EcsTaskOverride + + // An array of placement constraint objects to use for the task. You can specify up + // to 10 constraints per task (including constraints in the task definition and + // those specified at runtime). + PlacementConstraints []PlacementConstraint + + // The placement strategy objects to use for the task. You can specify a maximum of + // five strategy rules per task. + PlacementStrategy []PlacementStrategy + + // Specifies the platform version for the task. Specify only the numeric portion of + // the platform version, such as 1.1.0. This structure is used only if LaunchType + // is FARGATE. For more information about valid platform versions, see Fargate + // Platform Versions + // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) + // in the Amazon Elastic Container Service Developer Guide. + PlatformVersion *string + + // Specifies whether to propagate the tags from the task definition to the task. If + // no value is specified, the tags are not propagated. Tags can only be propagated + // to the task during task creation. To add tags to a task after task creation, use + // the TagResource API action. + PropagateTags PropagateTags + + // The reference ID to use for the task. + ReferenceId *string + + // The metadata that you apply to the task to help you categorize and organize + // them. Each tag consists of a key and an optional value, both of which you + // define. To learn more, see RunTask + // (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-tags) + // in the Amazon ECS API Reference. + Tags []Tag + + // The number of tasks to create based on TaskDefinition. The default is 1. + TaskCount *int32 + + noSmithyDocumentSerde +} + +// The parameters for using an EventBridge event bus as a target. +type PipeTargetEventBridgeEventBusParameters struct { + + // A free-form string, with a maximum of 128 characters, used to decide what fields + // to expect in the event detail. + DetailType *string + + // The URL subdomain of the endpoint. For example, if the URL for Endpoint is + // https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is + // abcde.veo. When using Java, you must include auth-crt on the class path. + EndpointId *string + + // Amazon Web Services resources, identified by Amazon Resource Name (ARN), which + // the event primarily concerns. Any number, including zero, may be present. + Resources []string + + // The source of the event. + Source *string + + // The time stamp of the event, per RFC3339 + // (https://www.rfc-editor.org/rfc/rfc3339.txt). If no time stamp is provided, the + // time stamp of the PutEvents + // (https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) + // call is used. + Time *string + + noSmithyDocumentSerde +} + +// These are custom parameter to be used when the target is an API Gateway REST +// APIs or EventBridge ApiDestinations. +type PipeTargetHttpParameters struct { + + // The headers that need to be sent as part of request invoking the API Gateway + // REST API or EventBridge ApiDestination. + HeaderParameters map[string]string + + // The path parameter values to be used to populate API Gateway REST API or + // EventBridge ApiDestination path wildcards ("*"). + PathParameterValues []string + + // The query string keys/values that need to be sent as part of request invoking + // the API Gateway REST API or EventBridge ApiDestination. + QueryStringParameters map[string]string + + noSmithyDocumentSerde +} + +// The parameters for using a Kinesis stream as a source. +type PipeTargetKinesisStreamParameters struct { + + // Determines which shard in the stream the data record is assigned to. Partition + // keys are Unicode strings with a maximum length limit of 256 characters for each + // key. Amazon Kinesis Data Streams uses the partition key as input to a hash + // function that maps the partition key and associated data to a specific shard. + // Specifically, an MD5 hash function is used to map partition keys to 128-bit + // integer values and to map associated data records to shards. As a result of this + // hashing mechanism, all data records with the same partition key map to the same + // shard within the stream. + // + // This member is required. + PartitionKey *string + + noSmithyDocumentSerde +} + +// The parameters for using a Lambda function as a target. +type PipeTargetLambdaFunctionParameters struct { + + // Choose from the following options. + // + // * RequestResponse (default) - Invoke the + // function synchronously. Keep the connection open until the function returns a + // response or times out. The API response includes the function response and + // additional data. + // + // * Event - Invoke the function asynchronously. Send events that + // fail multiple times to the function's dead-letter queue (if it's configured). + // The API response only includes a status code. + // + // * DryRun - Validate parameter + // values and verify that the user or role has permission to invoke the function. + InvocationType PipeTargetInvocationType + + noSmithyDocumentSerde +} + +// The parameters required to set up a target for your pipe. +type PipeTargetParameters struct { + + // The parameters for using an Batch job as a target. + BatchJobParameters *PipeTargetBatchJobParameters + + // The parameters for using an CloudWatch Logs log stream as a target. + CloudWatchLogsParameters *PipeTargetCloudWatchLogsParameters + + // The parameters for using an Amazon ECS task as a target. + EcsTaskParameters *PipeTargetEcsTaskParameters + + // The parameters for using an EventBridge event bus as a target. + EventBridgeEventBusParameters *PipeTargetEventBridgeEventBusParameters + + // These are custom parameter to be used when the target is an API Gateway REST + // APIs or EventBridge ApiDestinations. + HttpParameters *PipeTargetHttpParameters + + // Valid JSON text passed to the target. In this case, nothing from the event + // itself is passed to the target. For more information, see The JavaScript Object + // Notation (JSON) Data Interchange Format + // (http://www.rfc-editor.org/rfc/rfc7159.txt). + InputTemplate *string + + // The parameters for using a Kinesis stream as a source. + KinesisStreamParameters *PipeTargetKinesisStreamParameters + + // The parameters for using a Lambda function as a target. + LambdaFunctionParameters *PipeTargetLambdaFunctionParameters + + // These are custom parameters to be used when the target is a Amazon Redshift + // cluster to invoke the Amazon Redshift Data API ExecuteStatement. + RedshiftDataParameters *PipeTargetRedshiftDataParameters + + // The parameters for using a SageMaker pipeline as a target. + SageMakerPipelineParameters *PipeTargetSageMakerPipelineParameters + + // The parameters for using a Amazon SQS stream as a source. + SqsQueueParameters *PipeTargetSqsQueueParameters + + // The parameters for using a Step Functions state machine as a target. + StepFunctionStateMachineParameters *PipeTargetStateMachineParameters + + noSmithyDocumentSerde +} + +// These are custom parameters to be used when the target is a Amazon Redshift +// cluster to invoke the Amazon Redshift Data API ExecuteStatement. +type PipeTargetRedshiftDataParameters struct { + + // The name of the database. Required when authenticating using temporary + // credentials. + // + // This member is required. + Database *string + + // The SQL statement text to run. + // + // This member is required. + Sqls []string + + // The database user name. Required when authenticating using temporary + // credentials. + DbUser *string + + // The name or ARN of the secret that enables access to the database. Required when + // authenticating using SageMaker. + SecretManagerArn *string + + // The name of the SQL statement. You can name the SQL statement when you create it + // to identify the query. + StatementName *string + + // Indicates whether to send an event back to EventBridge after the SQL statement + // runs. + WithEvent bool + + noSmithyDocumentSerde +} + +// The parameters for using a SageMaker pipeline as a target. +type PipeTargetSageMakerPipelineParameters struct { + + // List of Parameter names and values for SageMaker Model Building Pipeline + // execution. + PipelineParameterList []SageMakerPipelineParameter + + noSmithyDocumentSerde +} + +// The parameters for using a Amazon SQS stream as a source. +type PipeTargetSqsQueueParameters struct { + + // This parameter applies only to FIFO (first-in-first-out) queues. The token used + // for deduplication of sent messages. + MessageDeduplicationId *string + + // The FIFO message group ID to use as the target. + MessageGroupId *string + + noSmithyDocumentSerde +} + +// The parameters for using a Step Functions state machine as a target. +type PipeTargetStateMachineParameters struct { + + // Specify whether to wait for the state machine to finish or not. + InvocationType PipeTargetInvocationType + + noSmithyDocumentSerde +} + +// An object representing a constraint on task placement. To learn more, see Task +// Placement Constraints +// (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) +// in the Amazon Elastic Container Service Developer Guide. +type PlacementConstraint struct { + + // A cluster query language expression to apply to the constraint. You cannot + // specify an expression if the constraint type is distinctInstance. To learn more, + // see Cluster Query Language + // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) + // in the Amazon Elastic Container Service Developer Guide. + Expression *string + + // The type of constraint. Use distinctInstance to ensure that each task in a + // particular group is running on a different container instance. Use memberOf to + // restrict the selection to a group of valid candidates. + Type PlacementConstraintType + + noSmithyDocumentSerde +} + +// The task placement strategy for a task or service. To learn more, see Task +// Placement Strategies +// (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html) +// in the Amazon Elastic Container Service Service Developer Guide. +type PlacementStrategy struct { + + // The field to apply the placement strategy against. For the spread placement + // strategy, valid values are instanceId (or host, which has the same effect), or + // any platform or custom attribute that is applied to a container instance, such + // as attribute:ecs.availability-zone. For the binpack placement strategy, valid + // values are cpu and memory. For the random placement strategy, this field is not + // used. + Field *string + + // The type of placement strategy. The random placement strategy randomly places + // tasks on available candidates. The spread placement strategy spreads placement + // across available candidates evenly based on the field parameter. The binpack + // strategy places tasks on available candidates that have the least available + // amount of the resource that is specified with the field parameter. For example, + // if you binpack on memory, a task is placed on the instance with the least amount + // of remaining memory (but still enough to run the task). + Type PlacementStrategyType + + noSmithyDocumentSerde +} + +// Name/Value pair of a parameter to start execution of a SageMaker Model Building +// Pipeline. +type SageMakerPipelineParameter struct { + + // Name of parameter to start execution of a SageMaker Model Building Pipeline. + // + // This member is required. + Name *string + + // Value of parameter to start execution of a SageMaker Model Building Pipeline. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// The Secrets Manager secret that stores your stream credentials. +// +// The following types satisfy this interface: +// +// SelfManagedKafkaAccessConfigurationCredentialsMemberBasicAuth +// SelfManagedKafkaAccessConfigurationCredentialsMemberClientCertificateTlsAuth +// SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram256Auth +// SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram512Auth +type SelfManagedKafkaAccessConfigurationCredentials interface { + isSelfManagedKafkaAccessConfigurationCredentials() +} + +// The ARN of the Secrets Manager secret. +type SelfManagedKafkaAccessConfigurationCredentialsMemberBasicAuth struct { + Value string + + noSmithyDocumentSerde +} + +func (*SelfManagedKafkaAccessConfigurationCredentialsMemberBasicAuth) isSelfManagedKafkaAccessConfigurationCredentials() { +} + +// The ARN of the Secrets Manager secret. +type SelfManagedKafkaAccessConfigurationCredentialsMemberClientCertificateTlsAuth struct { + Value string + + noSmithyDocumentSerde +} + +func (*SelfManagedKafkaAccessConfigurationCredentialsMemberClientCertificateTlsAuth) isSelfManagedKafkaAccessConfigurationCredentials() { +} + +// The ARN of the Secrets Manager secret. +type SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram256Auth struct { + Value string + + noSmithyDocumentSerde +} + +func (*SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram256Auth) isSelfManagedKafkaAccessConfigurationCredentials() { +} + +// The ARN of the Secrets Manager secret. +type SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram512Auth struct { + Value string + + noSmithyDocumentSerde +} + +func (*SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram512Auth) isSelfManagedKafkaAccessConfigurationCredentials() { +} + +// This structure specifies the VPC subnets and security groups for the stream, and +// whether a public IP address is to be used. +type SelfManagedKafkaAccessConfigurationVpc struct { + + // Specifies the security groups associated with the stream. These security groups + // must all be in the same VPC. You can specify as many as five security groups. If + // you do not specify a security group, the default security group for the VPC is + // used. + SecurityGroup []string + + // Specifies the subnets associated with the stream. These subnets must all be in + // the same VPC. You can specify as many as 16 subnets. + Subnets []string + + noSmithyDocumentSerde +} + +// A key-value pair associated with an Amazon Web Services resource. In +// EventBridge, rules and event buses support tagging. +type Tag struct { + + // A string you can use to assign a value. The combination of tag keys and values + // can help you organize and categorize your resources. + // + // This member is required. + Key *string + + // The value for the specified tag key. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// The parameters for using an Active MQ broker as a source. +type UpdatePipeSourceActiveMQBrokerParameters struct { + + // The credentials needed to access the resource. + // + // This member is required. + Credentials MQBrokerAccessCredentials + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + noSmithyDocumentSerde +} + +// The parameters for using a DynamoDB stream as a source. +type UpdatePipeSourceDynamoDBStreamParameters struct { + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // Define the target queue to send dead-letter queue events to. + DeadLetterConfig *DeadLetterConfig + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + // (Streams only) Discard records older than the specified age. The default value + // is -1, which sets the maximum age to infinite. When the value is set to + // infinite, EventBridge never discards old records. + MaximumRecordAgeInSeconds *int32 + + // (Streams only) Discard records after the specified number of retries. The + // default value is -1, which sets the maximum number of retries to infinite. When + // MaximumRetryAttempts is infinite, EventBridge retries failed records until the + // record expires in the event source. + MaximumRetryAttempts *int32 + + // (Streams only) Define how to handle item process failures. AUTOMATIC_BISECT + // halves each batch and retry each half until all the records are processed or + // there is one failed message left in the batch. + OnPartialBatchItemFailure OnPartialBatchItemFailureStreams + + // (Streams only) The number of batches to process concurrently from each shard. + // The default value is 1. + ParallelizationFactor *int32 + + noSmithyDocumentSerde +} + +// The parameters for using a Kinesis stream as a source. +type UpdatePipeSourceKinesisStreamParameters struct { + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // Define the target queue to send dead-letter queue events to. + DeadLetterConfig *DeadLetterConfig + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + // (Streams only) Discard records older than the specified age. The default value + // is -1, which sets the maximum age to infinite. When the value is set to + // infinite, EventBridge never discards old records. + MaximumRecordAgeInSeconds *int32 + + // (Streams only) Discard records after the specified number of retries. The + // default value is -1, which sets the maximum number of retries to infinite. When + // MaximumRetryAttempts is infinite, EventBridge retries failed records until the + // record expires in the event source. + MaximumRetryAttempts *int32 + + // (Streams only) Define how to handle item process failures. AUTOMATIC_BISECT + // halves each batch and retry each half until all the records are processed or + // there is one failed message left in the batch. + OnPartialBatchItemFailure OnPartialBatchItemFailureStreams + + // (Streams only) The number of batches to process concurrently from each shard. + // The default value is 1. + ParallelizationFactor *int32 + + noSmithyDocumentSerde +} + +// The parameters for using an MSK stream as a source. +type UpdatePipeSourceManagedStreamingKafkaParameters struct { + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // The credentials needed to access the resource. + Credentials MSKAccessCredentials + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + noSmithyDocumentSerde +} + +// The parameters required to set up a source for your pipe. +type UpdatePipeSourceParameters struct { + + // The parameters for using an Active MQ broker as a source. + ActiveMQBrokerParameters *UpdatePipeSourceActiveMQBrokerParameters + + // The parameters for using a DynamoDB stream as a source. + DynamoDBStreamParameters *UpdatePipeSourceDynamoDBStreamParameters + + // The collection of event patterns used to filter events. For more information, + // see Events and Event Patterns + // (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) + // in the Amazon EventBridge User Guide. + FilterCriteria *FilterCriteria + + // The parameters for using a Kinesis stream as a source. + KinesisStreamParameters *UpdatePipeSourceKinesisStreamParameters + + // The parameters for using an MSK stream as a source. + ManagedStreamingKafkaParameters *UpdatePipeSourceManagedStreamingKafkaParameters + + // The parameters for using a Rabbit MQ broker as a source. + RabbitMQBrokerParameters *UpdatePipeSourceRabbitMQBrokerParameters + + // The parameters for using a self-managed Apache Kafka stream as a source. + SelfManagedKafkaParameters *UpdatePipeSourceSelfManagedKafkaParameters + + // The parameters for using a Amazon SQS stream as a source. + SqsQueueParameters *UpdatePipeSourceSqsQueueParameters + + noSmithyDocumentSerde +} + +// The parameters for using a Rabbit MQ broker as a source. +type UpdatePipeSourceRabbitMQBrokerParameters struct { + + // The credentials needed to access the resource. + // + // This member is required. + Credentials MQBrokerAccessCredentials + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + noSmithyDocumentSerde +} + +// The parameters for using a self-managed Apache Kafka stream as a source. +type UpdatePipeSourceSelfManagedKafkaParameters struct { + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // The credentials needed to access the resource. + Credentials SelfManagedKafkaAccessConfigurationCredentials + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + // The ARN of the Secrets Manager secret used for certification. + ServerRootCaCertificate *string + + // This structure specifies the VPC subnets and security groups for the stream, and + // whether a public IP address is to be used. + Vpc *SelfManagedKafkaAccessConfigurationVpc + + noSmithyDocumentSerde +} + +// The parameters for using a Amazon SQS stream as a source. +type UpdatePipeSourceSqsQueueParameters struct { + + // The maximum number of records to include in each batch. + BatchSize *int32 + + // The maximum length of a time to wait for events. + MaximumBatchingWindowInSeconds *int32 + + noSmithyDocumentSerde +} + +// Indicates that an error has occurred while performing a validate operation. +type ValidationExceptionField struct { + + // The message of the exception. + // + // This member is required. + Message *string + + // The name of the exception. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +// UnknownUnionMember is returned when a union member is returned over the wire, +// but has an unknown tag. +type UnknownUnionMember struct { + Tag string + Value []byte + + noSmithyDocumentSerde +} + +func (*UnknownUnionMember) isMQBrokerAccessCredentials() {} +func (*UnknownUnionMember) isMSKAccessCredentials() {} +func (*UnknownUnionMember) isSelfManagedKafkaAccessConfigurationCredentials() {} diff --git a/service/pipes/types/types_exported_test.go b/service/pipes/types/types_exported_test.go new file mode 100644 index 00000000000..b82e458d8d5 --- /dev/null +++ b/service/pipes/types/types_exported_test.go @@ -0,0 +1,74 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/pipes/types" +) + +func ExampleMQBrokerAccessCredentials_outputUsage() { + var union types.MQBrokerAccessCredentials + // type switches can be used to check the union value + switch v := union.(type) { + case *types.MQBrokerAccessCredentialsMemberBasicAuth: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string + +func ExampleMSKAccessCredentials_outputUsage() { + var union types.MSKAccessCredentials + // type switches can be used to check the union value + switch v := union.(type) { + case *types.MSKAccessCredentialsMemberClientCertificateTlsAuth: + _ = v.Value // Value is string + + case *types.MSKAccessCredentialsMemberSaslScram512Auth: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string + +func ExampleSelfManagedKafkaAccessConfigurationCredentials_outputUsage() { + var union types.SelfManagedKafkaAccessConfigurationCredentials + // type switches can be used to check the union value + switch v := union.(type) { + case *types.SelfManagedKafkaAccessConfigurationCredentialsMemberBasicAuth: + _ = v.Value // Value is string + + case *types.SelfManagedKafkaAccessConfigurationCredentialsMemberClientCertificateTlsAuth: + _ = v.Value // Value is string + + case *types.SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram256Auth: + _ = v.Value // Value is string + + case *types.SelfManagedKafkaAccessConfigurationCredentialsMemberSaslScram512Auth: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string diff --git a/service/pipes/validators.go b/service/pipes/validators.go new file mode 100644 index 00000000000..3fb56ca06b1 --- /dev/null +++ b/service/pipes/validators.go @@ -0,0 +1,1064 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/pipes/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreatePipe struct { +} + +func (*validateOpCreatePipe) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreatePipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreatePipeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreatePipeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeletePipe struct { +} + +func (*validateOpDeletePipe) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeletePipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeletePipeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeletePipeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribePipe struct { +} + +func (*validateOpDescribePipe) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribePipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribePipeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribePipeInput(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 validateOpStartPipe struct { +} + +func (*validateOpStartPipe) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartPipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartPipeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartPipeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStopPipe struct { +} + +func (*validateOpStopPipe) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopPipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopPipeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopPipeInput(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 validateOpUpdatePipe struct { +} + +func (*validateOpUpdatePipe) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePipeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePipeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreatePipeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreatePipe{}, middleware.After) +} + +func addOpDeletePipeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeletePipe{}, middleware.After) +} + +func addOpDescribePipeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribePipe{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpStartPipeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartPipe{}, middleware.After) +} + +func addOpStopPipeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopPipe{}, 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 addOpUpdatePipeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePipe{}, middleware.After) +} + +func validateAwsVpcConfiguration(v *types.AwsVpcConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AwsVpcConfiguration"} + if v.Subnets == nil { + invalidParams.Add(smithy.NewErrParamRequired("Subnets")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBatchContainerOverrides(v *types.BatchContainerOverrides) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchContainerOverrides"} + if v.ResourceRequirements != nil { + if err := validateBatchResourceRequirementsList(v.ResourceRequirements); err != nil { + invalidParams.AddNested("ResourceRequirements", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBatchResourceRequirement(v *types.BatchResourceRequirement) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchResourceRequirement"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBatchResourceRequirementsList(v []types.BatchResourceRequirement) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchResourceRequirementsList"} + for i := range v { + if err := validateBatchResourceRequirement(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCapacityProviderStrategy(v []types.CapacityProviderStrategyItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CapacityProviderStrategy"} + for i := range v { + if err := validateCapacityProviderStrategyItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCapacityProviderStrategyItem(v *types.CapacityProviderStrategyItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CapacityProviderStrategyItem"} + if v.CapacityProvider == nil { + invalidParams.Add(smithy.NewErrParamRequired("CapacityProvider")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEcsContainerOverride(v *types.EcsContainerOverride) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EcsContainerOverride"} + if v.EnvironmentFiles != nil { + if err := validateEcsEnvironmentFileList(v.EnvironmentFiles); err != nil { + invalidParams.AddNested("EnvironmentFiles", err.(smithy.InvalidParamsError)) + } + } + if v.ResourceRequirements != nil { + if err := validateEcsResourceRequirementsList(v.ResourceRequirements); err != nil { + invalidParams.AddNested("ResourceRequirements", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEcsContainerOverrideList(v []types.EcsContainerOverride) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EcsContainerOverrideList"} + for i := range v { + if err := validateEcsContainerOverride(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEcsEnvironmentFile(v *types.EcsEnvironmentFile) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EcsEnvironmentFile"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEcsEnvironmentFileList(v []types.EcsEnvironmentFile) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EcsEnvironmentFileList"} + for i := range v { + if err := validateEcsEnvironmentFile(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEcsEphemeralStorage(v *types.EcsEphemeralStorage) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EcsEphemeralStorage"} + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEcsResourceRequirement(v *types.EcsResourceRequirement) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EcsResourceRequirement"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEcsResourceRequirementsList(v []types.EcsResourceRequirement) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EcsResourceRequirementsList"} + for i := range v { + if err := validateEcsResourceRequirement(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEcsTaskOverride(v *types.EcsTaskOverride) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EcsTaskOverride"} + if v.ContainerOverrides != nil { + if err := validateEcsContainerOverrideList(v.ContainerOverrides); err != nil { + invalidParams.AddNested("ContainerOverrides", err.(smithy.InvalidParamsError)) + } + } + if v.EphemeralStorage != nil { + if err := validateEcsEphemeralStorage(v.EphemeralStorage); err != nil { + invalidParams.AddNested("EphemeralStorage", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateNetworkConfiguration(v *types.NetworkConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "NetworkConfiguration"} + if v.AwsvpcConfiguration != nil { + if err := validateAwsVpcConfiguration(v.AwsvpcConfiguration); err != nil { + invalidParams.AddNested("AwsvpcConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeSourceActiveMQBrokerParameters(v *types.PipeSourceActiveMQBrokerParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeSourceActiveMQBrokerParameters"} + if v.Credentials == nil { + invalidParams.Add(smithy.NewErrParamRequired("Credentials")) + } + if v.QueueName == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueueName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeSourceDynamoDBStreamParameters(v *types.PipeSourceDynamoDBStreamParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeSourceDynamoDBStreamParameters"} + if len(v.StartingPosition) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("StartingPosition")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeSourceKinesisStreamParameters(v *types.PipeSourceKinesisStreamParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeSourceKinesisStreamParameters"} + if len(v.StartingPosition) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("StartingPosition")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeSourceManagedStreamingKafkaParameters(v *types.PipeSourceManagedStreamingKafkaParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeSourceManagedStreamingKafkaParameters"} + if v.TopicName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TopicName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeSourceParameters(v *types.PipeSourceParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeSourceParameters"} + if v.KinesisStreamParameters != nil { + if err := validatePipeSourceKinesisStreamParameters(v.KinesisStreamParameters); err != nil { + invalidParams.AddNested("KinesisStreamParameters", err.(smithy.InvalidParamsError)) + } + } + if v.DynamoDBStreamParameters != nil { + if err := validatePipeSourceDynamoDBStreamParameters(v.DynamoDBStreamParameters); err != nil { + invalidParams.AddNested("DynamoDBStreamParameters", err.(smithy.InvalidParamsError)) + } + } + if v.ActiveMQBrokerParameters != nil { + if err := validatePipeSourceActiveMQBrokerParameters(v.ActiveMQBrokerParameters); err != nil { + invalidParams.AddNested("ActiveMQBrokerParameters", err.(smithy.InvalidParamsError)) + } + } + if v.RabbitMQBrokerParameters != nil { + if err := validatePipeSourceRabbitMQBrokerParameters(v.RabbitMQBrokerParameters); err != nil { + invalidParams.AddNested("RabbitMQBrokerParameters", err.(smithy.InvalidParamsError)) + } + } + if v.ManagedStreamingKafkaParameters != nil { + if err := validatePipeSourceManagedStreamingKafkaParameters(v.ManagedStreamingKafkaParameters); err != nil { + invalidParams.AddNested("ManagedStreamingKafkaParameters", err.(smithy.InvalidParamsError)) + } + } + if v.SelfManagedKafkaParameters != nil { + if err := validatePipeSourceSelfManagedKafkaParameters(v.SelfManagedKafkaParameters); err != nil { + invalidParams.AddNested("SelfManagedKafkaParameters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeSourceRabbitMQBrokerParameters(v *types.PipeSourceRabbitMQBrokerParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeSourceRabbitMQBrokerParameters"} + if v.Credentials == nil { + invalidParams.Add(smithy.NewErrParamRequired("Credentials")) + } + if v.QueueName == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueueName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeSourceSelfManagedKafkaParameters(v *types.PipeSourceSelfManagedKafkaParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeSourceSelfManagedKafkaParameters"} + if v.TopicName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TopicName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeTargetBatchJobParameters(v *types.PipeTargetBatchJobParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeTargetBatchJobParameters"} + if v.JobDefinition == nil { + invalidParams.Add(smithy.NewErrParamRequired("JobDefinition")) + } + if v.JobName == nil { + invalidParams.Add(smithy.NewErrParamRequired("JobName")) + } + if v.ContainerOverrides != nil { + if err := validateBatchContainerOverrides(v.ContainerOverrides); err != nil { + invalidParams.AddNested("ContainerOverrides", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeTargetEcsTaskParameters(v *types.PipeTargetEcsTaskParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeTargetEcsTaskParameters"} + if v.TaskDefinitionArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TaskDefinitionArn")) + } + if v.NetworkConfiguration != nil { + if err := validateNetworkConfiguration(v.NetworkConfiguration); err != nil { + invalidParams.AddNested("NetworkConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.CapacityProviderStrategy != nil { + if err := validateCapacityProviderStrategy(v.CapacityProviderStrategy); err != nil { + invalidParams.AddNested("CapacityProviderStrategy", err.(smithy.InvalidParamsError)) + } + } + if v.Overrides != nil { + if err := validateEcsTaskOverride(v.Overrides); err != nil { + invalidParams.AddNested("Overrides", err.(smithy.InvalidParamsError)) + } + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeTargetKinesisStreamParameters(v *types.PipeTargetKinesisStreamParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeTargetKinesisStreamParameters"} + if v.PartitionKey == nil { + invalidParams.Add(smithy.NewErrParamRequired("PartitionKey")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeTargetParameters(v *types.PipeTargetParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeTargetParameters"} + if v.KinesisStreamParameters != nil { + if err := validatePipeTargetKinesisStreamParameters(v.KinesisStreamParameters); err != nil { + invalidParams.AddNested("KinesisStreamParameters", err.(smithy.InvalidParamsError)) + } + } + if v.EcsTaskParameters != nil { + if err := validatePipeTargetEcsTaskParameters(v.EcsTaskParameters); err != nil { + invalidParams.AddNested("EcsTaskParameters", err.(smithy.InvalidParamsError)) + } + } + if v.BatchJobParameters != nil { + if err := validatePipeTargetBatchJobParameters(v.BatchJobParameters); err != nil { + invalidParams.AddNested("BatchJobParameters", err.(smithy.InvalidParamsError)) + } + } + if v.RedshiftDataParameters != nil { + if err := validatePipeTargetRedshiftDataParameters(v.RedshiftDataParameters); err != nil { + invalidParams.AddNested("RedshiftDataParameters", err.(smithy.InvalidParamsError)) + } + } + if v.SageMakerPipelineParameters != nil { + if err := validatePipeTargetSageMakerPipelineParameters(v.SageMakerPipelineParameters); err != nil { + invalidParams.AddNested("SageMakerPipelineParameters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeTargetRedshiftDataParameters(v *types.PipeTargetRedshiftDataParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeTargetRedshiftDataParameters"} + if v.Database == nil { + invalidParams.Add(smithy.NewErrParamRequired("Database")) + } + if v.Sqls == nil { + invalidParams.Add(smithy.NewErrParamRequired("Sqls")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePipeTargetSageMakerPipelineParameters(v *types.PipeTargetSageMakerPipelineParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeTargetSageMakerPipelineParameters"} + if v.PipelineParameterList != nil { + if err := validateSageMakerPipelineParameterList(v.PipelineParameterList); err != nil { + invalidParams.AddNested("PipelineParameterList", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSageMakerPipelineParameter(v *types.SageMakerPipelineParameter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SageMakerPipelineParameter"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSageMakerPipelineParameterList(v []types.SageMakerPipelineParameter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SageMakerPipelineParameterList"} + for i := range v { + if err := validateSageMakerPipelineParameter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTag(v *types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Tag"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTagList(v []types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagList"} + for i := range v { + if err := validateTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUpdatePipeSourceActiveMQBrokerParameters(v *types.UpdatePipeSourceActiveMQBrokerParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePipeSourceActiveMQBrokerParameters"} + if v.Credentials == nil { + invalidParams.Add(smithy.NewErrParamRequired("Credentials")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUpdatePipeSourceParameters(v *types.UpdatePipeSourceParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePipeSourceParameters"} + if v.ActiveMQBrokerParameters != nil { + if err := validateUpdatePipeSourceActiveMQBrokerParameters(v.ActiveMQBrokerParameters); err != nil { + invalidParams.AddNested("ActiveMQBrokerParameters", err.(smithy.InvalidParamsError)) + } + } + if v.RabbitMQBrokerParameters != nil { + if err := validateUpdatePipeSourceRabbitMQBrokerParameters(v.RabbitMQBrokerParameters); err != nil { + invalidParams.AddNested("RabbitMQBrokerParameters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUpdatePipeSourceRabbitMQBrokerParameters(v *types.UpdatePipeSourceRabbitMQBrokerParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePipeSourceRabbitMQBrokerParameters"} + if v.Credentials == nil { + invalidParams.Add(smithy.NewErrParamRequired("Credentials")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreatePipeInput(v *CreatePipeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreatePipeInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.SourceParameters != nil { + if err := validatePipeSourceParameters(v.SourceParameters); err != nil { + invalidParams.AddNested("SourceParameters", err.(smithy.InvalidParamsError)) + } + } + if v.Target == nil { + invalidParams.Add(smithy.NewErrParamRequired("Target")) + } + if v.TargetParameters != nil { + if err := validatePipeTargetParameters(v.TargetParameters); err != nil { + invalidParams.AddNested("TargetParameters", err.(smithy.InvalidParamsError)) + } + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeletePipeInput(v *DeletePipeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeletePipeInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribePipeInput(v *DescribePipeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribePipeInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + 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 validateOpStartPipeInput(v *StartPipeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartPipeInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStopPipeInput(v *StopPipeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopPipeInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + 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 validateOpUpdatePipeInput(v *UpdatePipeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePipeInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.SourceParameters != nil { + if err := validateUpdatePipeSourceParameters(v.SourceParameters); err != nil { + invalidParams.AddNested("SourceParameters", err.(smithy.InvalidParamsError)) + } + } + if v.TargetParameters != nil { + if err := validatePipeTargetParameters(v.TargetParameters); err != nil { + invalidParams.AddNested("TargetParameters", err.(smithy.InvalidParamsError)) + } + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/sfn/api_op_DeleteStateMachine.go b/service/sfn/api_op_DeleteStateMachine.go index 395643b912c..aeba32a923d 100644 --- a/service/sfn/api_op_DeleteStateMachine.go +++ b/service/sfn/api_op_DeleteStateMachine.go @@ -11,9 +11,16 @@ import ( ) // Deletes a state machine. This is an asynchronous operation: It sets the state -// machine's status to DELETING and begins the deletion process. For EXPRESS state -// machines, the deletion will happen eventually (usually less than a minute). -// Running executions may emit logs after DeleteStateMachine API is called. +// machine's status to DELETING and begins the deletion process. If the given state +// machine Amazon Resource Name (ARN) is a qualified state machine ARN, it will +// fail with ValidationException. A qualified state machine ARN refers to a +// Distributed Map state defined within a state machine. For example, the qualified +// state machine ARN +// arn:partition:states:region:account-id:stateMachine:stateMachineName/mapStateLabel +// refers to a Distributed Map state with a label mapStateLabel in the state +// machine named stateMachineName. For EXPRESS state machines, the deletion will +// happen eventually (usually less than a minute). Running executions may emit logs +// after DeleteStateMachine API is called. func (c *Client) DeleteStateMachine(ctx context.Context, params *DeleteStateMachineInput, optFns ...func(*Options)) (*DeleteStateMachineOutput, error) { if params == nil { params = &DeleteStateMachineInput{} diff --git a/service/sfn/api_op_DescribeExecution.go b/service/sfn/api_op_DescribeExecution.go index ae20cd321cd..216079561c7 100644 --- a/service/sfn/api_op_DescribeExecution.go +++ b/service/sfn/api_op_DescribeExecution.go @@ -12,9 +12,13 @@ import ( "time" ) -// Describes an execution. This operation is eventually consistent. The results are -// best effort and may not reflect very recent updates and changes. This API action -// is not supported by EXPRESS state machines. +// Provides all information about a state machine execution, such as the state +// machine associated with the execution, the execution input and output, and +// relevant execution metadata. Use this API action to return the Map Run ARN if +// the execution was dispatched by a Map Run. This operation is eventually +// consistent. The results are best effort and may not reflect very recent updates +// and changes. This API action is not supported by EXPRESS state machine +// executions unless they were dispatched by a Map Run. func (c *Client) DescribeExecution(ctx context.Context, params *DescribeExecutionInput, optFns ...func(*Options)) (*DescribeExecutionOutput, error) { if params == nil { params = &DescribeExecutionInput{} @@ -62,6 +66,12 @@ type DescribeExecutionOutput struct { // This member is required. Status types.ExecutionStatus + // The cause string if the state machine execution failed. + Cause *string + + // The error string if the state machine execution failed. + Error *string + // The string that contains the JSON input data of the execution. Length // constraints apply to the payload size, and are expressed as bytes in UTF-8 // encoding. @@ -70,6 +80,10 @@ type DescribeExecutionOutput struct { // Provides details about execution input or output. InputDetails *types.CloudWatchEventsExecutionDataDetails + // The Amazon Resource Name (ARN) that identifies a Map Run, which dispatched this + // execution. + MapRunArn *string + // The name of the execution. A name must not contain: // // * white space diff --git a/service/sfn/api_op_DescribeMapRun.go b/service/sfn/api_op_DescribeMapRun.go new file mode 100644 index 00000000000..d61fc67ef02 --- /dev/null +++ b/service/sfn/api_op_DescribeMapRun.go @@ -0,0 +1,176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sfn + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/sfn/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Provides information about a Map Run's configuration, progress, and results. For +// more information, see Examining Map Run +// (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-examine-map-run.html) +// in the Step Functions Developer Guide. +func (c *Client) DescribeMapRun(ctx context.Context, params *DescribeMapRunInput, optFns ...func(*Options)) (*DescribeMapRunOutput, error) { + if params == nil { + params = &DescribeMapRunInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeMapRun", params, optFns, c.addOperationDescribeMapRunMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeMapRunOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeMapRunInput struct { + + // The Amazon Resource Name (ARN) that identifies a Map Run. + // + // This member is required. + MapRunArn *string + + noSmithyDocumentSerde +} + +type DescribeMapRunOutput struct { + + // The Amazon Resource Name (ARN) that identifies the execution in which the Map + // Run was started. + // + // This member is required. + ExecutionArn *string + + // A JSON object that contains information about the total number of child workflow + // executions for the Map Run, and the count of child workflow executions for each + // status, such as failed and succeeded. + // + // This member is required. + ExecutionCounts *types.MapRunExecutionCounts + + // A JSON object that contains information about the total number of items, and the + // item count for each processing status, such as pending and failed. + // + // This member is required. + ItemCounts *types.MapRunItemCounts + + // The Amazon Resource Name (ARN) that identifies a Map Run. + // + // This member is required. + MapRunArn *string + + // The maximum number of child workflow executions configured to run in parallel + // for the Map Run at the same time. + // + // This member is required. + MaxConcurrency int32 + + // The date when the Map Run was started. + // + // This member is required. + StartDate *time.Time + + // The current status of the Map Run. + // + // This member is required. + Status types.MapRunStatus + + // The maximum number of failed child workflow executions before the Map Run fails. + // + // This member is required. + ToleratedFailureCount int64 + + // The maximum percentage of failed child workflow executions before the Map Run + // fails. + // + // This member is required. + ToleratedFailurePercentage float32 + + // The date when the Map Run was stopped. + StopDate *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeMapRunMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeMapRun{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeMapRun{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeMapRunValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMapRun(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeMapRun(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "states", + OperationName: "DescribeMapRun", + } +} diff --git a/service/sfn/api_op_DescribeStateMachine.go b/service/sfn/api_op_DescribeStateMachine.go index f51d1dc8f2b..1b70c9da8ec 100644 --- a/service/sfn/api_op_DescribeStateMachine.go +++ b/service/sfn/api_op_DescribeStateMachine.go @@ -12,8 +12,15 @@ import ( "time" ) -// Describes a state machine. This operation is eventually consistent. The results -// are best effort and may not reflect very recent updates and changes. +// Provides information about a state machine's definition, its IAM role Amazon +// Resource Name (ARN), and configuration. If the state machine ARN is a qualified +// state machine ARN, the response returned includes the Map state's label. A +// qualified state machine ARN refers to a Distributed Map state defined within a +// state machine. For example, the qualified state machine ARN +// arn:partition:states:region:account-id:stateMachine:stateMachineName/mapStateLabel +// refers to a Distributed Map state with a label mapStateLabel in the state +// machine named stateMachineName. This operation is eventually consistent. The +// results are best effort and may not reflect very recent updates and changes. func (c *Client) DescribeStateMachine(ctx context.Context, params *DescribeStateMachineInput, optFns ...func(*Options)) (*DescribeStateMachineOutput, error) { if params == nil { params = &DescribeStateMachineInput{} @@ -91,6 +98,11 @@ type DescribeStateMachineOutput struct { // This member is required. Type types.StateMachineType + // A user-defined or an auto-generated string that identifies a Map state. This + // parameter is present only if the stateMachineArn specified in input is a + // qualified state machine ARN. + Label *string + // The LoggingConfiguration data type is used to set CloudWatch Logs options. LoggingConfiguration *types.LoggingConfiguration diff --git a/service/sfn/api_op_DescribeStateMachineForExecution.go b/service/sfn/api_op_DescribeStateMachineForExecution.go index 346e05c2f55..3d168425b5c 100644 --- a/service/sfn/api_op_DescribeStateMachineForExecution.go +++ b/service/sfn/api_op_DescribeStateMachineForExecution.go @@ -12,10 +12,12 @@ import ( "time" ) -// Describes the state machine associated with a specific execution. This operation -// is eventually consistent. The results are best effort and may not reflect very -// recent updates and changes. This API action is not supported by EXPRESS state -// machines. +// Provides information about a state machine's definition, its execution role ARN, +// and configuration. If an execution was dispatched by a Map Run, the Map Run is +// returned in the response. Additionally, the state machine returned will be the +// state machine associated with the Map Run. This operation is eventually +// consistent. The results are best effort and may not reflect very recent updates +// and changes. This API action is not supported by EXPRESS state machines. func (c *Client) DescribeStateMachineForExecution(ctx context.Context, params *DescribeStateMachineForExecutionInput, optFns ...func(*Options)) (*DescribeStateMachineForExecutionOutput, error) { if params == nil { params = &DescribeStateMachineForExecutionInput{} @@ -74,9 +76,19 @@ type DescribeStateMachineForExecutionOutput struct { // This member is required. UpdateDate *time.Time + // A user-defined or an auto-generated string that identifies a Map state. This + // field is returned only if the executionArn is a child workflow execution that was + // started by a Distributed Map state. + Label *string + // The LoggingConfiguration data type is used to set CloudWatch Logs options. LoggingConfiguration *types.LoggingConfiguration + // The Amazon Resource Name (ARN) of the Map Run that started the child workflow + // execution. This field is returned only if the executionArn is a child workflow + // execution that was started by a Distributed Map state. + MapRunArn *string + // Selects whether X-Ray tracing is enabled. TracingConfiguration *types.TracingConfiguration diff --git a/service/sfn/api_op_ListExecutions.go b/service/sfn/api_op_ListExecutions.go index 77775229c9f..1d718689088 100644 --- a/service/sfn/api_op_ListExecutions.go +++ b/service/sfn/api_op_ListExecutions.go @@ -12,7 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the executions of a state machine that meet the filtering criteria. +// Lists all executions of a state machine or a Map Run. You can list all +// executions related to a state machine by specifying a state machine Amazon +// Resource Name (ARN), or those related to a Map Run by specifying a Map Run ARN. // Results are sorted by time, with the most recent execution first. If nextToken // is returned, there are more results available. The value of nextToken is a // unique pagination token for each page. Make the call again using the returned @@ -38,10 +40,14 @@ func (c *Client) ListExecutions(ctx context.Context, params *ListExecutionsInput type ListExecutionsInput struct { - // The Amazon Resource Name (ARN) of the state machine whose executions is listed. - // - // This member is required. - StateMachineArn *string + // The Amazon Resource Name (ARN) of the Map Run that started the child workflow + // executions. If the mapRunArn field is specified, a list of all of the child + // workflow executions started by a Map Run is returned. For more information, see + // Examining Map Run + // (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-examine-map-run.html) + // in the Step Functions Developer Guide. You can specify either a mapRunArn or a + // stateMachineArn, but not both. + MapRunArn *string // The maximum number of results that are returned per call. You can use nextToken // to obtain further pages of results. The default is 100 and the maximum allowed @@ -57,6 +63,10 @@ type ListExecutionsInput struct { // pagination token will return an HTTP 400 InvalidToken error. NextToken *string + // The Amazon Resource Name (ARN) of the state machine whose executions is listed. + // You can specify either a mapRunArn or a stateMachineArn, but not both. + StateMachineArn *string + // If specified, only list the executions whose current execution status matches // the given filter. StatusFilter types.ExecutionStatus @@ -129,9 +139,6 @@ func (c *Client) addOperationListExecutionsMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = addOpListExecutionsValidationMiddleware(stack); err != nil { - return err - } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListExecutions(options.Region), middleware.Before); err != nil { return err } diff --git a/service/sfn/api_op_ListMapRuns.go b/service/sfn/api_op_ListMapRuns.go new file mode 100644 index 00000000000..8fa3721dc82 --- /dev/null +++ b/service/sfn/api_op_ListMapRuns.go @@ -0,0 +1,239 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sfn + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/sfn/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all Map Runs that were started by a given state machine execution. Use +// this API action to obtain Map Run ARNs, and then call DescribeMapRun to obtain +// more information, if needed. +func (c *Client) ListMapRuns(ctx context.Context, params *ListMapRunsInput, optFns ...func(*Options)) (*ListMapRunsOutput, error) { + if params == nil { + params = &ListMapRunsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListMapRuns", params, optFns, c.addOperationListMapRunsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListMapRunsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListMapRunsInput struct { + + // The Amazon Resource Name (ARN) of the execution for which the Map Runs must be + // listed. + // + // This member is required. + ExecutionArn *string + + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. The default is 100 and the maximum allowed + // page size is 1000. A value of 0 uses the default. This is only an upper limit. + // The actual number of results returned per call might be fewer than the specified + // maximum. + MaxResults int32 + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. Using an expired + // pagination token will return an HTTP 400 InvalidToken error. + NextToken *string + + noSmithyDocumentSerde +} + +type ListMapRunsOutput struct { + + // An array that lists information related to a Map Run, such as the Amazon + // Resource Name (ARN) of the Map Run and the ARN of the state machine that started + // the Map Run. + // + // This member is required. + MapRuns []types.MapRunListItem + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. Keep all other arguments + // unchanged. Each pagination token expires after 24 hours. Using an expired + // pagination token will return an HTTP 400 InvalidToken error. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListMapRunsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListMapRuns{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListMapRuns{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListMapRunsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMapRuns(options.Region), middleware.Before); 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 + } + return nil +} + +// ListMapRunsAPIClient is a client that implements the ListMapRuns operation. +type ListMapRunsAPIClient interface { + ListMapRuns(context.Context, *ListMapRunsInput, ...func(*Options)) (*ListMapRunsOutput, error) +} + +var _ ListMapRunsAPIClient = (*Client)(nil) + +// ListMapRunsPaginatorOptions is the paginator options for ListMapRuns +type ListMapRunsPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. The default is 100 and the maximum allowed + // page size is 1000. A value of 0 uses the default. This is only an upper limit. + // The actual number of results returned per call might be fewer than the specified + // maximum. + 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 +} + +// ListMapRunsPaginator is a paginator for ListMapRuns +type ListMapRunsPaginator struct { + options ListMapRunsPaginatorOptions + client ListMapRunsAPIClient + params *ListMapRunsInput + nextToken *string + firstPage bool +} + +// NewListMapRunsPaginator returns a new ListMapRunsPaginator +func NewListMapRunsPaginator(client ListMapRunsAPIClient, params *ListMapRunsInput, optFns ...func(*ListMapRunsPaginatorOptions)) *ListMapRunsPaginator { + if params == nil { + params = &ListMapRunsInput{} + } + + options := ListMapRunsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListMapRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMapRunsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListMapRuns page. +func (p *ListMapRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMapRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListMapRuns(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 +} + +func newServiceMetadataMiddleware_opListMapRuns(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "states", + OperationName: "ListMapRuns", + } +} diff --git a/service/sfn/api_op_StartExecution.go b/service/sfn/api_op_StartExecution.go index 4b96b3fa0d0..e0914da5e87 100644 --- a/service/sfn/api_op_StartExecution.go +++ b/service/sfn/api_op_StartExecution.go @@ -11,7 +11,14 @@ import ( "time" ) -// Starts a state machine execution. StartExecution is idempotent for STANDARD +// Starts a state machine execution. If the given state machine Amazon Resource +// Name (ARN) is a qualified state machine ARN, it will fail with +// ValidationException. A qualified state machine ARN refers to a Distributed Map +// state defined within a state machine. For example, the qualified state machine +// ARN +// arn:partition:states:region:account-id:stateMachine:stateMachineName/mapStateLabel +// refers to a Distributed Map state with a label mapStateLabel in the state +// machine named stateMachineName. StartExecution is idempotent for STANDARD // workflows. For a STANDARD workflow, if StartExecution is called with the same // name and input as a running execution, the call will succeed and return the same // response as the original request. If the execution is closed or if the input is diff --git a/service/sfn/api_op_UpdateMapRun.go b/service/sfn/api_op_UpdateMapRun.go new file mode 100644 index 00000000000..917baaafdf2 --- /dev/null +++ b/service/sfn/api_op_UpdateMapRun.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sfn + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an in-progress Map Run's configuration to include changes to the +// settings that control maximum concurrency and Map Run failure. +func (c *Client) UpdateMapRun(ctx context.Context, params *UpdateMapRunInput, optFns ...func(*Options)) (*UpdateMapRunOutput, error) { + if params == nil { + params = &UpdateMapRunInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateMapRun", params, optFns, c.addOperationUpdateMapRunMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateMapRunOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateMapRunInput struct { + + // The Amazon Resource Name (ARN) of a Map Run. + // + // This member is required. + MapRunArn *string + + // The maximum number of child workflow executions that can be specified to run in + // parallel for the Map Run at the same time. + MaxConcurrency *int32 + + // The maximum number of failed items before the Map Run fails. + ToleratedFailureCount *int64 + + // The maximum percentage of failed items before the Map Run fails. + ToleratedFailurePercentage *float32 + + noSmithyDocumentSerde +} + +type UpdateMapRunOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateMapRunMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateMapRun{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateMapRun{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateMapRunValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMapRun(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateMapRun(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "states", + OperationName: "UpdateMapRun", + } +} diff --git a/service/sfn/api_op_UpdateStateMachine.go b/service/sfn/api_op_UpdateStateMachine.go index 9922be1537e..9c57cbdf7ef 100644 --- a/service/sfn/api_op_UpdateStateMachine.go +++ b/service/sfn/api_op_UpdateStateMachine.go @@ -15,10 +15,17 @@ import ( // Updates an existing state machine by modifying its definition, roleArn, or // loggingConfiguration. Running executions will continue to use the previous // definition and roleArn. You must include at least one of definition or roleArn -// or you will receive a MissingRequiredParameter error. All StartExecution calls -// within a few seconds will use the updated definition and roleArn. Executions -// started immediately after calling UpdateStateMachine may use the previous state -// machine definition and roleArn. +// or you will receive a MissingRequiredParameter error. If the given state machine +// Amazon Resource Name (ARN) is a qualified state machine ARN, it will fail with +// ValidationException. A qualified state machine ARN refers to a Distributed Map +// state defined within a state machine. For example, the qualified state machine +// ARN +// arn:partition:states:region:account-id:stateMachine:stateMachineName/mapStateLabel +// refers to a Distributed Map state with a label mapStateLabel in the state +// machine named stateMachineName. All StartExecution calls within a few seconds +// will use the updated definition and roleArn. Executions started immediately +// after calling UpdateStateMachine may use the previous state machine definition +// and roleArn. func (c *Client) UpdateStateMachine(ctx context.Context, params *UpdateStateMachineInput, optFns ...func(*Options)) (*UpdateStateMachineOutput, error) { if params == nil { params = &UpdateStateMachineInput{} diff --git a/service/sfn/deserializers.go b/service/sfn/deserializers.go index 70205bf5918..0f6e79bcbbd 100644 --- a/service/sfn/deserializers.go +++ b/service/sfn/deserializers.go @@ -16,6 +16,7 @@ import ( smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" + "math" "strings" ) @@ -486,6 +487,9 @@ func awsAwsjson10_deserializeOpErrorDeleteStateMachine(response *smithyhttp.Resp case strings.EqualFold("InvalidArn", errorCode): return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -724,6 +728,120 @@ func awsAwsjson10_deserializeOpErrorDescribeExecution(response *smithyhttp.Respo } } +type awsAwsjson10_deserializeOpDescribeMapRun struct { +} + +func (*awsAwsjson10_deserializeOpDescribeMapRun) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDescribeMapRun) 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, awsAwsjson10_deserializeOpErrorDescribeMapRun(response, &metadata) + } + output := &DescribeMapRunOutput{} + 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 = awsAwsjson10_deserializeOpDocumentDescribeMapRunOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorDescribeMapRun(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidArn", errorCode): + return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) + + case strings.EqualFold("ResourceNotFound", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpDescribeStateMachine struct { } @@ -1401,12 +1519,135 @@ func awsAwsjson10_deserializeOpErrorListExecutions(response *smithyhttp.Response case strings.EqualFold("InvalidToken", errorCode): return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody) + case strings.EqualFold("ResourceNotFound", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody) + case strings.EqualFold("StateMachineDoesNotExist", errorCode): return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody) case strings.EqualFold("StateMachineTypeNotSupported", errorCode): return awsAwsjson10_deserializeErrorStateMachineTypeNotSupported(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListMapRuns struct { +} + +func (*awsAwsjson10_deserializeOpListMapRuns) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListMapRuns) 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, awsAwsjson10_deserializeOpErrorListMapRuns(response, &metadata) + } + output := &ListMapRunsOutput{} + 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 = awsAwsjson10_deserializeOpDocumentListMapRunsOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorListMapRuns(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ExecutionDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorExecutionDoesNotExist(response, errorBody) + + case strings.EqualFold("InvalidArn", errorCode): + return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) + + case strings.EqualFold("InvalidToken", errorCode): + return awsAwsjson10_deserializeErrorInvalidToken(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2115,6 +2356,9 @@ func awsAwsjson10_deserializeOpErrorStartExecution(response *smithyhttp.Response case strings.EqualFold("StateMachineDoesNotExist", errorCode): return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2355,6 +2599,9 @@ func awsAwsjson10_deserializeOpErrorStopExecution(response *smithyhttp.Response, case strings.EqualFold("InvalidArn", errorCode): return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2596,14 +2843,14 @@ func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsAwsjson10_deserializeOpUpdateStateMachine struct { +type awsAwsjson10_deserializeOpUpdateMapRun struct { } -func (*awsAwsjson10_deserializeOpUpdateStateMachine) ID() string { +func (*awsAwsjson10_deserializeOpUpdateMapRun) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateStateMachine) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpUpdateMapRun) 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) @@ -2617,9 +2864,9 @@ func (m *awsAwsjson10_deserializeOpUpdateStateMachine) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateStateMachine(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateMapRun(response, &metadata) } - output := &UpdateStateMachineOutput{} + output := &UpdateMapRunOutput{} out.Result = output var buff [1024]byte @@ -2639,7 +2886,7 @@ func (m *awsAwsjson10_deserializeOpUpdateStateMachine) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateStateMachineOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentUpdateMapRunOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2653,7 +2900,7 @@ func (m *awsAwsjson10_deserializeOpUpdateStateMachine) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateStateMachine(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorUpdateMapRun(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)} @@ -2697,23 +2944,11 @@ func awsAwsjson10_deserializeOpErrorUpdateStateMachine(response *smithyhttp.Resp case strings.EqualFold("InvalidArn", errorCode): return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) - case strings.EqualFold("InvalidDefinition", errorCode): - return awsAwsjson10_deserializeErrorInvalidDefinition(response, errorBody) - - case strings.EqualFold("InvalidLoggingConfiguration", errorCode): - return awsAwsjson10_deserializeErrorInvalidLoggingConfiguration(response, errorBody) - - case strings.EqualFold("InvalidTracingConfiguration", errorCode): - return awsAwsjson10_deserializeErrorInvalidTracingConfiguration(response, errorBody) - - case strings.EqualFold("MissingRequiredParameter", errorCode): - return awsAwsjson10_deserializeErrorMissingRequiredParameter(response, errorBody) - - case strings.EqualFold("StateMachineDeleting", errorCode): - return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody) + case strings.EqualFold("ResourceNotFound", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFound(response, errorBody) - case strings.EqualFold("StateMachineDoesNotExist", errorCode): - return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -2725,12 +2960,144 @@ func awsAwsjson10_deserializeOpErrorUpdateStateMachine(response *smithyhttp.Resp } } -func awsAwsjson10_deserializeErrorActivityDoesNotExist(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) +type awsAwsjson10_deserializeOpUpdateStateMachine struct { +} - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) +func (*awsAwsjson10_deserializeOpUpdateStateMachine) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateStateMachine) 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, awsAwsjson10_deserializeOpErrorUpdateStateMachine(response, &metadata) + } + output := &UpdateStateMachineOutput{} + 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 = awsAwsjson10_deserializeOpDocumentUpdateStateMachineOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdateStateMachine(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidArn", errorCode): + return awsAwsjson10_deserializeErrorInvalidArn(response, errorBody) + + case strings.EqualFold("InvalidDefinition", errorCode): + return awsAwsjson10_deserializeErrorInvalidDefinition(response, errorBody) + + case strings.EqualFold("InvalidLoggingConfiguration", errorCode): + return awsAwsjson10_deserializeErrorInvalidLoggingConfiguration(response, errorBody) + + case strings.EqualFold("InvalidTracingConfiguration", errorCode): + return awsAwsjson10_deserializeErrorInvalidTracingConfiguration(response, errorBody) + + case strings.EqualFold("MissingRequiredParameter", errorCode): + return awsAwsjson10_deserializeErrorMissingRequiredParameter(response, errorBody) + + case strings.EqualFold("StateMachineDeleting", errorCode): + return awsAwsjson10_deserializeErrorStateMachineDeleting(response, errorBody) + + case strings.EqualFold("StateMachineDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorStateMachineDoesNotExist(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson10_deserializeErrorActivityDoesNotExist(response *smithyhttp.Response, errorBody *bytes.Reader) error { + 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 { @@ -3565,6 +3932,41 @@ func awsAwsjson10_deserializeErrorTooManyTags(response *smithyhttp.Response, err return output } +func awsAwsjson10_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + 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 + } + + output := &types.ValidationException{} + err := awsAwsjson10_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 awsAwsjson10_deserializeDocumentActivityDoesNotExist(v **types.ActivityDoesNotExist, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4516,6 +4918,28 @@ func awsAwsjson10_deserializeDocumentExecutionListItem(v **types.ExecutionListIt sv.ExecutionArn = ptr.String(jtv) } + case "itemCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ItemCount = ptr.Int32(int32(i64)) + } + + case "mapRunArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LongArn to be of type string, got %T instead", value) + } + sv.MapRunArn = ptr.String(jtv) + } + case "name": if value != nil { jtv, ok := value.(string) @@ -4872,6 +5296,16 @@ func awsAwsjson10_deserializeDocumentHistoryEvent(v **types.HistoryEvent, value return err } + case "mapRunFailedEventDetails": + if err := awsAwsjson10_deserializeDocumentMapRunFailedEventDetails(&sv.MapRunFailedEventDetails, value); err != nil { + return err + } + + case "mapRunStartedEventDetails": + if err := awsAwsjson10_deserializeDocumentMapRunStartedEventDetails(&sv.MapRunStartedEventDetails, value); err != nil { + return err + } + case "mapStateStartedEventDetails": if err := awsAwsjson10_deserializeDocumentMapStateStartedEventDetails(&sv.MapStateStartedEventDetails, value); err != nil { return err @@ -5858,7 +6292,7 @@ func awsAwsjson10_deserializeDocumentMapIterationEventDetails(v **types.MapItera return nil } -func awsAwsjson10_deserializeDocumentMapStateStartedEventDetails(v **types.MapStateStartedEventDetails, value interface{}) error { +func awsAwsjson10_deserializeDocumentMapRunExecutionCounts(v **types.MapRunExecutionCounts, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5871,73 +6305,556 @@ func awsAwsjson10_deserializeDocumentMapStateStartedEventDetails(v **types.MapSt return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MapStateStartedEventDetails + var sv *types.MapRunExecutionCounts if *v == nil { - sv = &types.MapStateStartedEventDetails{} + sv = &types.MapRunExecutionCounts{} } else { sv = *v } for key, value := range shape { switch key { - case "length": + case "aborted": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected UnsignedInteger to be json.Number, got %T instead", value) + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.Length = int32(i64) + sv.Aborted = i64 } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson10_deserializeDocumentMissingRequiredParameter(v **types.MissingRequiredParameter, 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.MissingRequiredParameter - if *v == nil { - sv = &types.MissingRequiredParameter{} - } else { - sv = *v - } + case "failed": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Failed = i64 + } - for key, value := range shape { - switch key { - case "message": + case "pending": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) } - sv.Message = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Pending = i64 } - default: - _, _ = key, value + case "resultsWritten": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ResultsWritten = i64 + } - } - } + case "running": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Running = i64 + } + + case "succeeded": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Succeeded = i64 + } + + case "timedOut": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TimedOut = i64 + } + + case "total": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Total = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentMapRunFailedEventDetails(v **types.MapRunFailedEventDetails, 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.MapRunFailedEventDetails + if *v == nil { + sv = &types.MapRunFailedEventDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "cause": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveCause to be of type string, got %T instead", value) + } + sv.Cause = ptr.String(jtv) + } + + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value) + } + sv.Error = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentMapRunItemCounts(v **types.MapRunItemCounts, 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.MapRunItemCounts + if *v == nil { + sv = &types.MapRunItemCounts{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aborted": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Aborted = i64 + } + + case "failed": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Failed = i64 + } + + case "pending": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Pending = i64 + } + + case "resultsWritten": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ResultsWritten = i64 + } + + case "running": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Running = i64 + } + + case "succeeded": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Succeeded = i64 + } + + case "timedOut": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TimedOut = i64 + } + + case "total": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Total = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentMapRunList(v *[]types.MapRunListItem, 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.MapRunListItem + if *v == nil { + cv = []types.MapRunListItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MapRunListItem + destAddr := &col + if err := awsAwsjson10_deserializeDocumentMapRunListItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentMapRunListItem(v **types.MapRunListItem, 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.MapRunListItem + if *v == nil { + sv = &types.MapRunListItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "executionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ExecutionArn = ptr.String(jtv) + } + + case "mapRunArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LongArn to be of type string, got %T instead", value) + } + sv.MapRunArn = ptr.String(jtv) + } + + case "startDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "stateMachineArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.StateMachineArn = ptr.String(jtv) + } + + case "stopDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StopDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentMapRunStartedEventDetails(v **types.MapRunStartedEventDetails, 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.MapRunStartedEventDetails + if *v == nil { + sv = &types.MapRunStartedEventDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "mapRunArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LongArn to be of type string, got %T instead", value) + } + sv.MapRunArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentMapStateStartedEventDetails(v **types.MapStateStartedEventDetails, 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.MapStateStartedEventDetails + if *v == nil { + sv = &types.MapStateStartedEventDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "length": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnsignedInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Length = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentMissingRequiredParameter(v **types.MissingRequiredParameter, 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.MissingRequiredParameter + if *v == nil { + sv = &types.MissingRequiredParameter{} + } 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 ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } *v = sv return nil } @@ -7213,22 +8130,71 @@ func awsAwsjson10_deserializeDocumentTracingConfiguration(v **types.TracingConfi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.TracingConfiguration + var sv *types.TracingConfiguration + if *v == nil { + sv = &types.TracingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) + } + sv.Enabled = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_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.TracingConfiguration{} + sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { - case "enabled": + case "message": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.Enabled = jtv + sv.Message = ptr.String(jtv) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) } default: @@ -7501,6 +8467,24 @@ func awsAwsjson10_deserializeOpDocumentDescribeExecutionOutput(v **DescribeExecu for key, value := range shape { switch key { + case "cause": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveCause to be of type string, got %T instead", value) + } + sv.Cause = ptr.String(jtv) + } + + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveError to be of type string, got %T instead", value) + } + sv.Error = ptr.String(jtv) + } + case "executionArn": if value != nil { jtv, ok := value.(string) @@ -7524,6 +8508,15 @@ func awsAwsjson10_deserializeOpDocumentDescribeExecutionOutput(v **DescribeExecu return err } + case "mapRunArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LongArn to be of type string, got %T instead", value) + } + sv.MapRunArn = ptr.String(jtv) + } + case "name": if value != nil { jtv, ok := value.(string) @@ -7615,6 +8608,166 @@ func awsAwsjson10_deserializeOpDocumentDescribeExecutionOutput(v **DescribeExecu return nil } +func awsAwsjson10_deserializeOpDocumentDescribeMapRunOutput(v **DescribeMapRunOutput, 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 *DescribeMapRunOutput + if *v == nil { + sv = &DescribeMapRunOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "executionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ExecutionArn = ptr.String(jtv) + } + + case "executionCounts": + if err := awsAwsjson10_deserializeDocumentMapRunExecutionCounts(&sv.ExecutionCounts, value); err != nil { + return err + } + + case "itemCounts": + if err := awsAwsjson10_deserializeDocumentMapRunItemCounts(&sv.ItemCounts, value); err != nil { + return err + } + + case "mapRunArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LongArn to be of type string, got %T instead", value) + } + sv.MapRunArn = ptr.String(jtv) + } + + case "maxConcurrency": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaxConcurrency to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxConcurrency = int32(i64) + } + + case "startDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MapRunStatus to be of type string, got %T instead", value) + } + sv.Status = types.MapRunStatus(jtv) + } + + case "stopDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StopDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "toleratedFailureCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ToleratedFailureCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ToleratedFailureCount = i64 + } + + case "toleratedFailurePercentage": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ToleratedFailurePercentage = float32(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.ToleratedFailurePercentage = float32(f64) + + default: + return fmt.Errorf("expected ToleratedFailurePercentage to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentDescribeStateMachineForExecutionOutput(v **DescribeStateMachineForExecutionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7646,11 +8799,29 @@ func awsAwsjson10_deserializeOpDocumentDescribeStateMachineForExecutionOutput(v sv.Definition = ptr.String(jtv) } + case "label": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MapRunLabel to be of type string, got %T instead", value) + } + sv.Label = ptr.String(jtv) + } + case "loggingConfiguration": if err := awsAwsjson10_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil { return err } + case "mapRunArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LongArn to be of type string, got %T instead", value) + } + sv.MapRunArn = ptr.String(jtv) + } + case "name": if value != nil { jtv, ok := value.(string) @@ -7755,6 +8926,15 @@ func awsAwsjson10_deserializeOpDocumentDescribeStateMachineOutput(v **DescribeSt sv.Definition = ptr.String(jtv) } + case "label": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MapRunLabel to be of type string, got %T instead", value) + } + sv.Label = ptr.String(jtv) + } + case "loggingConfiguration": if err := awsAwsjson10_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil { return err @@ -8003,6 +9183,51 @@ func awsAwsjson10_deserializeOpDocumentListExecutionsOutput(v **ListExecutionsOu return nil } +func awsAwsjson10_deserializeOpDocumentListMapRunsOutput(v **ListMapRunsOutput, 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 *ListMapRunsOutput + if *v == nil { + sv = &ListMapRunsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "mapRuns": + if err := awsAwsjson10_deserializeDocumentMapRunList(&sv.MapRuns, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PageToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentListStateMachinesOutput(v **ListStateMachinesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8501,6 +9726,37 @@ func awsAwsjson10_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutp return nil } +func awsAwsjson10_deserializeOpDocumentUpdateMapRunOutput(v **UpdateMapRunOutput, 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 *UpdateMapRunOutput + if *v == nil { + sv = &UpdateMapRunOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentUpdateStateMachineOutput(v **UpdateStateMachineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/sfn/generated.json b/service/sfn/generated.json index 20663e61359..4a17aaafad1 100644 --- a/service/sfn/generated.json +++ b/service/sfn/generated.json @@ -14,12 +14,14 @@ "api_op_DeleteStateMachine.go", "api_op_DescribeActivity.go", "api_op_DescribeExecution.go", + "api_op_DescribeMapRun.go", "api_op_DescribeStateMachine.go", "api_op_DescribeStateMachineForExecution.go", "api_op_GetActivityTask.go", "api_op_GetExecutionHistory.go", "api_op_ListActivities.go", "api_op_ListExecutions.go", + "api_op_ListMapRuns.go", "api_op_ListStateMachines.go", "api_op_ListTagsForResource.go", "api_op_SendTaskFailure.go", @@ -30,6 +32,7 @@ "api_op_StopExecution.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdateMapRun.go", "api_op_UpdateStateMachine.go", "deserializers.go", "doc.go", diff --git a/service/sfn/serializers.go b/service/sfn/serializers.go index 6531d8cbb06..c9c38e20779 100644 --- a/service/sfn/serializers.go +++ b/service/sfn/serializers.go @@ -12,6 +12,7 @@ import ( smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "math" "path" ) @@ -345,6 +346,61 @@ func (m *awsAwsjson10_serializeOpDescribeExecution) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpDescribeMapRun struct { +} + +func (*awsAwsjson10_serializeOpDescribeMapRun) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDescribeMapRun) 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.(*DescribeMapRunInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSStepFunctions.DescribeMapRun") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDescribeMapRunInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpDescribeStateMachine struct { } @@ -675,6 +731,61 @@ func (m *awsAwsjson10_serializeOpListExecutions) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpListMapRuns struct { +} + +func (*awsAwsjson10_serializeOpListMapRuns) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListMapRuns) 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.(*ListMapRunsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSStepFunctions.ListMapRuns") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListMapRunsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpListStateMachines struct { } @@ -1225,6 +1336,61 @@ func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpUpdateMapRun struct { +} + +func (*awsAwsjson10_serializeOpUpdateMapRun) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateMapRun) 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.(*UpdateMapRunInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSStepFunctions.UpdateMapRun") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateMapRunInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpUpdateStateMachine struct { } @@ -1510,6 +1676,18 @@ func awsAwsjson10_serializeOpDocumentDescribeExecutionInput(v *DescribeExecution return nil } +func awsAwsjson10_serializeOpDocumentDescribeMapRunInput(v *DescribeMapRunInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MapRunArn != nil { + ok := object.Key("mapRunArn") + ok.String(*v.MapRunArn) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDescribeStateMachineForExecutionInput(v *DescribeStateMachineForExecutionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1604,6 +1782,11 @@ func awsAwsjson10_serializeOpDocumentListExecutionsInput(v *ListExecutionsInput, object := value.Object() defer object.Close() + if v.MapRunArn != nil { + ok := object.Key("mapRunArn") + ok.String(*v.MapRunArn) + } + if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) @@ -1627,6 +1810,28 @@ func awsAwsjson10_serializeOpDocumentListExecutionsInput(v *ListExecutionsInput, return nil } +func awsAwsjson10_serializeOpDocumentListMapRunsInput(v *ListMapRunsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExecutionArn != nil { + ok := object.Key("executionArn") + ok.String(*v.ExecutionArn) + } + + if v.MaxResults != 0 { + ok := object.Key("maxResults") + ok.Integer(v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentListStateMachinesInput(v *ListStateMachinesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1821,6 +2026,46 @@ func awsAwsjson10_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, v return nil } +func awsAwsjson10_serializeOpDocumentUpdateMapRunInput(v *UpdateMapRunInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MapRunArn != nil { + ok := object.Key("mapRunArn") + ok.String(*v.MapRunArn) + } + + if v.MaxConcurrency != nil { + ok := object.Key("maxConcurrency") + ok.Integer(*v.MaxConcurrency) + } + + if v.ToleratedFailureCount != nil { + ok := object.Key("toleratedFailureCount") + ok.Long(*v.ToleratedFailureCount) + } + + if v.ToleratedFailurePercentage != nil { + ok := object.Key("toleratedFailurePercentage") + switch { + case math.IsNaN(float64(*v.ToleratedFailurePercentage)): + ok.String("NaN") + + case math.IsInf(float64(*v.ToleratedFailurePercentage), 1): + ok.String("Infinity") + + case math.IsInf(float64(*v.ToleratedFailurePercentage), -1): + ok.String("-Infinity") + + default: + ok.Float(*v.ToleratedFailurePercentage) + + } + } + + return nil +} + func awsAwsjson10_serializeOpDocumentUpdateStateMachineInput(v *UpdateStateMachineInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/sfn/types/enums.go b/service/sfn/types/enums.go index 0bbd6ebdfcc..c3a04801e84 100644 --- a/service/sfn/types/enums.go +++ b/service/sfn/types/enums.go @@ -85,6 +85,10 @@ const ( HistoryEventTypeWaitStateAborted HistoryEventType = "WaitStateAborted" HistoryEventTypeWaitStateEntered HistoryEventType = "WaitStateEntered" HistoryEventTypeWaitStateExited HistoryEventType = "WaitStateExited" + HistoryEventTypeMapRunAborted HistoryEventType = "MapRunAborted" + HistoryEventTypeMapRunFailed HistoryEventType = "MapRunFailed" + HistoryEventTypeMapRunStarted HistoryEventType = "MapRunStarted" + HistoryEventTypeMapRunSucceeded HistoryEventType = "MapRunSucceeded" ) // Values returns all known values for HistoryEventType. Note that this can be @@ -147,6 +151,10 @@ func (HistoryEventType) Values() []HistoryEventType { "WaitStateAborted", "WaitStateEntered", "WaitStateExited", + "MapRunAborted", + "MapRunFailed", + "MapRunStarted", + "MapRunSucceeded", } } @@ -172,6 +180,28 @@ func (LogLevel) Values() []LogLevel { } } +type MapRunStatus string + +// Enum values for MapRunStatus +const ( + MapRunStatusRunning MapRunStatus = "RUNNING" + MapRunStatusSucceeded MapRunStatus = "SUCCEEDED" + MapRunStatusFailed MapRunStatus = "FAILED" + MapRunStatusAborted MapRunStatus = "ABORTED" +) + +// Values returns all known values for MapRunStatus. 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 (MapRunStatus) Values() []MapRunStatus { + return []MapRunStatus{ + "RUNNING", + "SUCCEEDED", + "FAILED", + "ABORTED", + } +} + type StateMachineStatus string // Enum values for StateMachineStatus @@ -227,3 +257,23 @@ func (SyncExecutionStatus) Values() []SyncExecutionStatus { "TIMED_OUT", } } + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonApiDoesNotSupportLabeledArns ValidationExceptionReason = "API_DOES_NOT_SUPPORT_LABELED_ARNS" + ValidationExceptionReasonMissingRequiredParameter ValidationExceptionReason = "MISSING_REQUIRED_PARAMETER" + ValidationExceptionReasonCannotUpdateCompletedMapRun ValidationExceptionReason = "CANNOT_UPDATE_COMPLETED_MAP_RUN" +) + +// Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "API_DOES_NOT_SUPPORT_LABELED_ARNS", + "MISSING_REQUIRED_PARAMETER", + "CANNOT_UPDATE_COMPLETED_MAP_RUN", + } +} diff --git a/service/sfn/types/errors.go b/service/sfn/types/errors.go index 12138743fb7..9ff7ad4bc58 100644 --- a/service/sfn/types/errors.go +++ b/service/sfn/types/errors.go @@ -125,7 +125,7 @@ func (e *ExecutionLimitExceeded) ErrorMessage() string { func (e *ExecutionLimitExceeded) ErrorCode() string { return "ExecutionLimitExceeded" } func (e *ExecutionLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The provided Amazon Resource Name (ARN) is invalid. +// The provided Amazon Resource Name (ARN) is not valid. type InvalidArn struct { Message *string @@ -144,7 +144,7 @@ func (e *InvalidArn) ErrorMessage() string { func (e *InvalidArn) ErrorCode() string { return "InvalidArn" } func (e *InvalidArn) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The provided Amazon States Language definition is invalid. +// The provided Amazon States Language definition is not valid. type InvalidDefinition struct { Message *string @@ -163,7 +163,7 @@ func (e *InvalidDefinition) ErrorMessage() string { func (e *InvalidDefinition) ErrorCode() string { return "InvalidDefinition" } func (e *InvalidDefinition) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The provided JSON input data is invalid. +// The provided JSON input data is not valid. type InvalidExecutionInput struct { Message *string @@ -200,7 +200,7 @@ func (e *InvalidLoggingConfiguration) ErrorMessage() string { func (e *InvalidLoggingConfiguration) ErrorCode() string { return "InvalidLoggingConfiguration" } func (e *InvalidLoggingConfiguration) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The provided name is invalid. +// The provided name is not valid. type InvalidName struct { Message *string @@ -219,7 +219,7 @@ func (e *InvalidName) ErrorMessage() string { func (e *InvalidName) ErrorCode() string { return "InvalidName" } func (e *InvalidName) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The provided JSON output data is invalid. +// The provided JSON output data is not valid. type InvalidOutput struct { Message *string @@ -238,7 +238,7 @@ func (e *InvalidOutput) ErrorMessage() string { func (e *InvalidOutput) ErrorCode() string { return "InvalidOutput" } func (e *InvalidOutput) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The provided token is invalid. +// The provided token is not valid. type InvalidToken struct { Message *string @@ -473,3 +473,25 @@ func (e *TooManyTags) ErrorMessage() string { } func (e *TooManyTags) ErrorCode() string { return "TooManyTags" } func (e *TooManyTags) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input does not satisfy the constraints specified by an Amazon Web Services +// service. +type ValidationException struct { + Message *string + + Reason ValidationExceptionReason + + 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 { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/sfn/types/types.go b/service/sfn/types/types.go index 5d48e9a4a4a..689ed78d2be 100644 --- a/service/sfn/types/types.go +++ b/service/sfn/types/types.go @@ -226,6 +226,17 @@ type ExecutionListItem struct { // This member is required. Status ExecutionStatus + // The total number of items processed in a child workflow execution. This field is + // returned only if mapRunArn was specified in the ListExecutions API action. If + // stateMachineArn was specified in ListExecutions, the itemCount field isn't + // returned. + ItemCount *int32 + + // The Amazon Resource Name (ARN) of a Map Run. This field is returned only if + // mapRunArn was specified in the ListExecutions API action. If stateMachineArn was + // specified in ListExecutions, the mapRunArn isn't returned. + MapRunArn *string + // If the execution already ended, the date the execution stopped. StopDate *time.Time @@ -360,6 +371,13 @@ type HistoryEvent struct { // Contains details about an iteration of a Map state that succeeded. MapIterationSucceededEventDetails *MapIterationEventDetails + // Contains error and cause details about a Map Run that failed. + MapRunFailedEventDetails *MapRunFailedEventDetails + + // Contains details, such as mapRunArn, and the start date and time of a Map Run. + // mapRunArn is the Amazon Resource Name (ARN) of the Map Run that was started. + MapRunStartedEventDetails *MapRunStartedEventDetails + // Contains details about Map state that was started. MapStateStartedEventDetails *MapStateStartedEventDetails @@ -538,6 +556,172 @@ type MapIterationEventDetails struct { noSmithyDocumentSerde } +// Contains details about all of the child workflow executions started by a Map +// Run. +type MapRunExecutionCounts struct { + + // The total number of child workflow executions that were started by a Map Run and + // were running, but were either stopped by the user or by Step Functions because + // the Map Run failed. + // + // This member is required. + Aborted int64 + + // The total number of child workflow executions that were started by a Map Run, + // but have failed. + // + // This member is required. + Failed int64 + + // The total number of child workflow executions that were started by a Map Run, + // but haven't started executing yet. + // + // This member is required. + Pending int64 + + // Returns the count of child workflow executions whose results were written by + // ResultWriter. For more information, see ResultWriter + // (https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultwriter.html) + // in the Step Functions Developer Guide. + // + // This member is required. + ResultsWritten int64 + + // The total number of child workflow executions that were started by a Map Run and + // are currently in-progress. + // + // This member is required. + Running int64 + + // The total number of child workflow executions that were started by a Map Run and + // have completed successfully. + // + // This member is required. + Succeeded int64 + + // The total number of child workflow executions that were started by a Map Run and + // have timed out. + // + // This member is required. + TimedOut int64 + + // The total number of child workflow executions that were started by a Map Run. + // + // This member is required. + Total int64 + + noSmithyDocumentSerde +} + +// Contains details about a Map Run failure event that occurred during a state +// machine execution. +type MapRunFailedEventDetails struct { + + // A more detailed explanation of the cause of the failure. + Cause *string + + // The error code of the Map Run failure. + Error *string + + noSmithyDocumentSerde +} + +// Contains details about items that were processed in all of the child workflow +// executions that were started by a Map Run. +type MapRunItemCounts struct { + + // The total number of items processed in child workflow executions that were + // either stopped by the user or by Step Functions, because the Map Run failed. + // + // This member is required. + Aborted int64 + + // The total number of items processed in child workflow executions that have + // failed. + // + // This member is required. + Failed int64 + + // The total number of items to process in child workflow executions that haven't + // started running yet. + // + // This member is required. + Pending int64 + + // Returns the count of items whose results were written by ResultWriter. For more + // information, see ResultWriter + // (https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultwriter.html) + // in the Step Functions Developer Guide. + // + // This member is required. + ResultsWritten int64 + + // The total number of items being processed in child workflow executions that are + // currently in-progress. + // + // This member is required. + Running int64 + + // The total number of items processed in child workflow executions that have + // completed successfully. + // + // This member is required. + Succeeded int64 + + // The total number of items processed in child workflow executions that have timed + // out. + // + // This member is required. + TimedOut int64 + + // The total number of items processed in all the child workflow executions started + // by a Map Run. + // + // This member is required. + Total int64 + + noSmithyDocumentSerde +} + +// Contains details about a specific Map Run. +type MapRunListItem struct { + + // The executionArn of the execution from which the Map Run was started. + // + // This member is required. + ExecutionArn *string + + // The Amazon Resource Name (ARN) of the Map Run. + // + // This member is required. + MapRunArn *string + + // The date on which the Map Run started. + // + // This member is required. + StartDate *time.Time + + // The Amazon Resource Name (ARN) of the executed state machine. + // + // This member is required. + StateMachineArn *string + + // The date on which the Map Run stopped. + StopDate *time.Time + + noSmithyDocumentSerde +} + +// Contains details about a Map Run that was started during a state machine +// execution. +type MapRunStartedEventDetails struct { + + // The Amazon Resource Name (ARN) of a Map Run that was started. + MapRunArn *string + + noSmithyDocumentSerde +} + // Details about a Map state that was started. type MapStateStartedEventDetails struct { diff --git a/service/sfn/validators.go b/service/sfn/validators.go index 3a4e578b70d..e0eabdc2b96 100644 --- a/service/sfn/validators.go +++ b/service/sfn/validators.go @@ -129,6 +129,26 @@ func (m *validateOpDescribeExecution) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDescribeMapRun struct { +} + +func (*validateOpDescribeMapRun) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeMapRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeMapRunInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeMapRunInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeStateMachineForExecution struct { } @@ -209,21 +229,21 @@ func (m *validateOpGetExecutionHistory) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } -type validateOpListExecutions struct { +type validateOpListMapRuns struct { } -func (*validateOpListExecutions) ID() string { +func (*validateOpListMapRuns) ID() string { return "OperationInputValidation" } -func (m *validateOpListExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( +func (m *validateOpListMapRuns) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { - input, ok := in.Parameters.(*ListExecutionsInput) + input, ok := in.Parameters.(*ListMapRunsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } - if err := validateOpListExecutionsInput(input); err != nil { + if err := validateOpListMapRunsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) @@ -409,6 +429,26 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateMapRun struct { +} + +func (*validateOpUpdateMapRun) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateMapRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateMapRunInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateMapRunInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateStateMachine struct { } @@ -453,6 +493,10 @@ func addOpDescribeExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeExecution{}, middleware.After) } +func addOpDescribeMapRunValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeMapRun{}, middleware.After) +} + func addOpDescribeStateMachineForExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeStateMachineForExecution{}, middleware.After) } @@ -469,8 +513,8 @@ func addOpGetExecutionHistoryValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpGetExecutionHistory{}, middleware.After) } -func addOpListExecutionsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListExecutions{}, middleware.After) +func addOpListMapRunsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListMapRuns{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { @@ -509,6 +553,10 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateMapRunValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateMapRun{}, middleware.After) +} + func addOpUpdateStateMachineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateStateMachine{}, middleware.After) } @@ -609,6 +657,21 @@ func validateOpDescribeExecutionInput(v *DescribeExecutionInput) error { } } +func validateOpDescribeMapRunInput(v *DescribeMapRunInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeMapRunInput"} + if v.MapRunArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("MapRunArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeStateMachineForExecutionInput(v *DescribeStateMachineForExecutionInput) error { if v == nil { return nil @@ -669,13 +732,13 @@ func validateOpGetExecutionHistoryInput(v *GetExecutionHistoryInput) error { } } -func validateOpListExecutionsInput(v *ListExecutionsInput) error { +func validateOpListMapRunsInput(v *ListMapRunsInput) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "ListExecutionsInput"} - if v.StateMachineArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("StateMachineArn")) + invalidParams := smithy.InvalidParamsError{Context: "ListMapRunsInput"} + if v.ExecutionArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExecutionArn")) } if invalidParams.Len() > 0 { return invalidParams @@ -828,6 +891,21 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { } } +func validateOpUpdateMapRunInput(v *UpdateMapRunInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateMapRunInput"} + if v.MapRunArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("MapRunArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateStateMachineInput(v *UpdateStateMachineInput) error { if v == nil { return nil