From f7499b33d8313d1cda4ebcab822eaf036eeb032d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Nov 2026 00:44:03 +0000 Subject: [PATCH] chore(deps): bump github.com/aws/aws-sdk-go-v2/config Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.33.6 to 1.33.12. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.33.6...config/v1.33.12) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-version: 1.33.12 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 28 +- go.sum | 56 +- .../aws-sdk-go-v2/aws/go_module_metadata.go | 2 +- .../aws/protocol/restjson/decoder_util.go | 85 - .../aws/aws-sdk-go-v2/config/CHANGELOG.md | 28 + .../config/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/credentials/CHANGELOG.md | 30 + .../credentials/go_module_metadata.go | 2 +- .../credentials/logincreds/provider.go | 4 +- .../credentials/logincreds/token.go | 25 +- .../stscreds/assume_role_provider.go | 11 +- .../stscreds/web_identity_provider.go | 14 +- .../feature/ec2/imds/CHANGELOG.md | 20 + .../feature/ec2/imds/go_module_metadata.go | 2 +- .../internal/configsources/CHANGELOG.md | 5 + .../configsources/go_module_metadata.go | 2 +- .../internal/endpoints/v2/CHANGELOG.md | 5 + .../endpoints/v2/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/internal/v4a/CHANGELOG.md | 19 + .../internal/v4a/go_module_metadata.go | 2 +- .../internal/accept-encoding/CHANGELOG.md | 16 + .../accept-encoding/go_module_metadata.go | 2 +- .../internal/presigned-url/CHANGELOG.md | 20 + .../presigned-url/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/signin/CHANGELOG.md | 29 + .../service/signin/api_client.go | 100 + .../signin/api_op_CreateOAuth2Token.go | 96 +- .../signin/api_op_CreateOAuth2TokenWithIAM.go | 73 +- ...i_op_CreateOAuth2TokenWithTokenExchange.go | 198 ++ ...DeleteConsoleAuthorizationConfiguration.go | 52 +- ...pi_op_DeleteResourcePermissionStatement.go | 37 +- ...op_GetConsoleAuthorizationConfiguration.go | 52 +- .../signin/api_op_GetResourcePolicy.go | 39 +- .../api_op_IntrospectOAuth2TokenWithIAM.go | 165 +- ...api_op_ListResourcePermissionStatements.go | 46 +- ...op_PutConsoleAuthorizationConfiguration.go | 52 +- .../api_op_PutResourcePermissionStatement.go | 61 +- .../signin/api_op_RevokeOAuth2TokenWithIAM.go | 48 +- .../aws/aws-sdk-go-v2/service/signin/auth.go | 6 + .../service/signin/common_serde.go | 243 ++ .../service/signin/deserializers.go | 3085 ----------------- .../aws/aws-sdk-go-v2/service/signin/doc.go | 5 +- .../service/signin/generated.json | 8 +- .../service/signin/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/signin/options.go | 2 + .../service/signin/schemas/schemas.go | 1009 ++++++ .../service/signin/serializers.go | 977 ------ .../service/signin/type_registry.go | 55 + .../service/signin/types/common_serde.go | 242 ++ .../service/signin/types/enums.go | 34 +- .../service/signin/types/errors.go | 438 ++- .../service/signin/types/types.go | 301 +- .../service/signin/validators.go | 39 + .../aws-sdk-go-v2/service/sso/CHANGELOG.md | 25 + .../aws-sdk-go-v2/service/sso/api_client.go | 100 + .../service/sso/api_op_GetRoleCredentials.go | 49 +- .../service/sso/api_op_ListAccountRoles.go | 53 +- .../service/sso/api_op_ListAccounts.go | 50 +- .../service/sso/api_op_Logout.go | 35 +- .../aws-sdk-go-v2/service/sso/common_serde.go | 78 + .../service/sso/deserializers.go | 1183 ------- .../aws-sdk-go-v2/service/sso/generated.json | 7 +- .../service/sso/go_module_metadata.go | 2 +- .../aws/aws-sdk-go-v2/service/sso/options.go | 2 + .../service/sso/schemas/schemas.go | 300 ++ .../aws-sdk-go-v2/service/sso/serializers.go | 309 -- .../service/sso/type_registry.go | 31 + .../service/sso/types/common_serde.go | 77 + .../aws-sdk-go-v2/service/sso/types/errors.go | 85 + .../aws-sdk-go-v2/service/sso/types/types.go | 103 + .../service/ssooidc/CHANGELOG.md | 25 + .../service/ssooidc/api_client.go | 100 + .../service/ssooidc/api_op_CreateToken.go | 86 +- .../ssooidc/api_op_CreateTokenWithIAM.go | 109 +- .../service/ssooidc/api_op_RegisterClient.go | 81 +- .../api_op_StartDeviceAuthorization.go | 75 +- .../service/ssooidc/common_serde.go | 103 + .../service/ssooidc/deserializers.go | 2256 ------------ .../service/ssooidc/generated.json | 7 +- .../service/ssooidc/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/ssooidc/options.go | 2 + .../service/ssooidc/schemas/schemas.go | 694 ++++ .../service/ssooidc/serializers.go | 512 --- .../service/ssooidc/type_registry.go | 71 + .../service/ssooidc/types/common_serde.go | 103 + .../service/ssooidc/types/errors.go | 411 +++ .../service/ssooidc/types/types.go | 24 + .../aws-sdk-go-v2/service/sts/CHANGELOG.md | 24 + .../service/sts/deserializers.go | 121 +- .../service/sts/go_module_metadata.go | 2 +- vendor/github.com/aws/smithy-go/CHANGELOG.md | 10 + .../aws/smithy-go/go_module_metadata.go | 2 +- .../transport/http/middleware_http_logging.go | 2 + .../internal/httpbinding/deserializer.go | 518 +++ .../http/protocol/internal/httpbinding/ext.go | 34 + .../internal/httpbinding/serializer.go | 641 ++++ .../internal/httpbinding/timestamp.go | 44 + .../internal/json/shape_deserializer.go | 25 +- .../http/protocol/restjson1/restjson1.go | 235 ++ vendor/modules.txt | 34 +- 100 files changed, 7920 insertions(+), 8800 deletions(-) delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithTokenExchange.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/signin/common_serde.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/signin/deserializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/signin/schemas/schemas.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/signin/serializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/signin/type_registry.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/common_serde.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/common_serde.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/schemas/schemas.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/type_registry.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/common_serde.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/common_serde.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas/schemas.go delete mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/type_registry.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/common_serde.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/deserializer.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/ext.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/serializer.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/timestamp.go create mode 100644 vendor/github.com/aws/smithy-go/transport/http/protocol/restjson1/restjson1.go diff --git a/go.mod b/go.mod index d9a62f930..f4004d4db 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( require ( github.com/alecthomas/kong v1.16.1 github.com/alicebob/miniredis/v2 v2.39.0 - github.com/aws/aws-sdk-go-v2 v1.47.4 - github.com/aws/aws-sdk-go-v2/config v1.33.6 - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.1 + github.com/aws/aws-sdk-go-v2 v1.47.5 + github.com/aws/aws-sdk-go-v2/config v1.33.12 + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.5 github.com/aws/aws-sdk-go-v2/service/acm v1.50.6 github.com/aws/aws-sdk-go-v2/service/dynamodb v1.69.1 github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.50.1 @@ -39,18 +39,18 @@ require ( dario.cat/mergo v1.0.2 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.7 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.7 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.4 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.12 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.8 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.8 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.8 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.23 // indirect github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.13.4 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.4 // indirect - github.com/aws/aws-sdk-go-v2/service/signin v1.10.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.38.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.51.1 // indirect - github.com/aws/smithy-go v1.28.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.8 // indirect + github.com/aws/aws-sdk-go-v2/service/signin v1.12.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.39.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.51.6 // indirect + github.com/aws/smithy-go v1.28.7 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect diff --git a/go.sum b/go.sum index a9502b0e9..dac51133f 100644 --- a/go.sum +++ b/go.sum @@ -27,44 +27,44 @@ github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go-v2 v1.47.4 h1:bTvk6UdSSSvaQsfLVj1JRDEEqj/PDRwGf1KanaRzau0= -github.com/aws/aws-sdk-go-v2 v1.47.4/go.mod h1:XkrjAZvr705Nytv6PkPUhoSB2W9+vVHBp5oAWpkh8Ak= -github.com/aws/aws-sdk-go-v2/config v1.33.6 h1:MBjkSTLczek/UgiK+EYPIoRTqE7gP8vtW3OFbFo7Nug= -github.com/aws/aws-sdk-go-v2/config v1.33.6/go.mod h1:grRAFzdAZJrwcbasJRg2MPvIrVjtlfXllHssN6+E1JE= -github.com/aws/aws-sdk-go-v2/credentials v1.20.6 h1:NpAFXCU7NzXNkdGK3zQTtsRJ+3v9tZQV0xcdRw8uBdw= -github.com/aws/aws-sdk-go-v2/credentials v1.20.6/go.mod h1:mcZCoiPnyMvP8VMNbygNX5lLqSlkYJIMPODylQMurOk= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.1 h1:8gALAAmacnIXh+z6VkdDanv4/IkG5APdg4DZLDTmLog= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.1/go.mod h1:Z7IJhJU+poOdJjUR2wpyY21ossQ1XS/R3Lk9Msq5kM4= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.7 h1:fSNAt6hs4qLjb9tMZc6vj3PHlOCYGXK2JjJZ7AW2tf4= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.7/go.mod h1:TMav+EuXQu5kNpZZz/6rIC8xx4mCsW+6AKHrjvOSAsE= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.7 h1:7NS6kqBjkWIN8P/AEdmtyq6eQGAhN1oHTZdzXclpH6Y= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.7/go.mod h1:1PFqtAUsIgF1nEVojzRJSf/v88zjzqrGW+w+UAtkXyQ= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.4 h1:7Wo47d/xn/7KttCSBd8EGYeZ7ULRFRkUHr6vkZPBzVQ= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.4/go.mod h1:tDB2IVC1xC3vX8o+6uRlzhTxP3g1b77CZXFX/oD2FnQ= +github.com/aws/aws-sdk-go-v2 v1.47.5 h1:5yA+A+BiXbDq1ZLbYwPViwhEGDMdR0MEhL8Jh2LnLS4= +github.com/aws/aws-sdk-go-v2 v1.47.5/go.mod h1:iNIkogrRvFwm+1OQIUOP2lPBtlXZboOIUWiCa+pHEMw= +github.com/aws/aws-sdk-go-v2/config v1.33.12 h1:IV1YARaXahwCqUIyP8IlWsP85Lil+5ozTozDQXPumRk= +github.com/aws/aws-sdk-go-v2/config v1.33.12/go.mod h1:h51R06bzMVwNBRZOX5ylHhNDnkB/azZeq/LvxM6q2pQ= +github.com/aws/aws-sdk-go-v2/credentials v1.20.12 h1:6P7Q7yH/GIwHg6MLKv3ySsBqaCoE1z+C0OTzYMenhEY= +github.com/aws/aws-sdk-go-v2/credentials v1.20.12/go.mod h1:Kw/SaoW/wc7IqJErqXJIzKo8b7Aelxfbuc6XlbrRnsc= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.5 h1:iXjy2SFhGYNB1jWZBhQqq8HbhsbPF23w+/zbMvPXsTg= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.5/go.mod h1:k0RUiBnyXU0AXRJ9tJmY2jQke6XUIX2PNVnWtvgaPtc= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.8 h1:gzIWc3DTPfPbWKrQnmL6BV6WD7NPD1htxzgdk/bQ/Z4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.8/go.mod h1:vvUA5cDAZWGo4R14FZPZfXfJCmgsafOWEq78Kg0D+ug= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.8 h1:PWv+vG8aCLS8qd+HPdYhK7Vees90aKHWFFQ1AGYD/8E= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.8/go.mod h1:xxPZEpflYHJA12366ZGyq66z9dHPCoeCIu99Jck+MPw= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.8 h1:WOp5De9iWdEHDPh2Kb0tBP3vGBm/dVAuRGh4a4tqduo= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.8/go.mod h1:z8W8YgfhbWl62XqcTtK+CxPrE+iHGRVUOtrrbIOp7ZY= github.com/aws/aws-sdk-go-v2/service/acm v1.50.6 h1:KPUbBMV2WsOLdx4EXjn+H20RNEZdZ0OnlfIQN3xod1s= github.com/aws/aws-sdk-go-v2/service/acm v1.50.6/go.mod h1:dKnz1ijMd3vYf47vvDQ+cJzMIGguO57EsmvAhfa8lQo= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.69.1 h1:bKwiQA6SKqFXBO+1IwP/hTwCU5RlqeitG4gVvSuMN8U= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.69.1/go.mod h1:Gm+i2GlUsFNlzoBq8VXF44XHbKANn3tV8nYBBp3rN8Q= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19 h1:bAdDl/HkGCcGPoe25ToSHEw23VIxt6CT5fLcg111BKg= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19/go.mod h1:KaUzbLxv4CeSxh6ZCl9B4m7CuFenS8kUEaDs+f/DQr4= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.23 h1:MCIR6iZaCKO4UE0hUvoWWLI6JVjppopV64JfAJaMjng= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.23/go.mod h1:pphWFS+z0MmIPivj8c/6bATd1Z+Av7Ust75DPdEFsPA= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.13.4 h1:6HvmOQ1rBRrZ4qPJSWxd5szPKUsngXCwSw+V3UaJHmw= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.13.4/go.mod h1:zv2N29aiQUhG2XZNM9zgwCnAyVBdTBbcIpfNAlNmA20= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.4 h1:29SvnfGhXjTl8ONxFwbj2rs6lbhiFXD2CgFQmbT/bXY= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.4/go.mod h1:wm04I5DMuNVvZHFe/dHnUxincvNbbK7AiNBbYsQivek= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.8 h1:+PMpWlJYOn2tm7sm6OZ/ZLd4jStl17T7wjNapd1Rczs= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.8/go.mod h1:cnG3xZLGQL4c/bt8pjdzlFtZsW7epBBuNS04a5xMjdo= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.50.1 h1:xYoGDAZtoSXI5wOfjv1jzG1AUOdXZthz4YL9DFvunrQ= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.50.1/go.mod h1:dgXxccOMNsXm/eOkrQbBfxm4a6H8IiRphA7z69RG8hM= -github.com/aws/aws-sdk-go-v2/service/signin v1.10.1 h1:DzCCWLzcIRQ77F3DEUljud7bEjTgFOIKXP52NmVRyhU= -github.com/aws/aws-sdk-go-v2/service/signin v1.10.1/go.mod h1:xpo/geVldu8payT375WekctUzopG/hBU7miiqItMUlw= +github.com/aws/aws-sdk-go-v2/service/signin v1.12.0 h1:3vu/eUqh0rjh7Zy4N4YKcpZX4Aud+zinB3VsLhhlQFw= +github.com/aws/aws-sdk-go-v2/service/signin v1.12.0/go.mod h1:wxAk0D2oVBSjuXEIzvcKxTZfM90zticdAbh/VD42L0Y= github.com/aws/aws-sdk-go-v2/service/ssm v1.81.0 h1:Kgekk4+MRuxavh9kCYpmbLMnmG7Pv76TNPga4s39hSA= github.com/aws/aws-sdk-go-v2/service/ssm v1.81.0/go.mod h1:oQUVZCeDudYiQIFVGKKHPCNFKha7khP+flig98xaEFI= -github.com/aws/aws-sdk-go-v2/service/sso v1.38.1 h1:Umtl/0YZhng4xndfW3lKJrYYP7NLEjI6bGXVomwLcs0= -github.com/aws/aws-sdk-go-v2/service/sso v1.38.1/go.mod h1:rRD/dnm7q0HYE/I5TMaPgkWyyUGLcwuxHLABsLnQ3e0= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.1 h1:orIWdNiLgzrhu/11RcPPKO/SBzUUymbUQuZbSPImghg= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.1/go.mod h1:skwM/xsbR/1ReUTesv9BhpJp1VjajR7DWQnuVLwiXsQ= -github.com/aws/aws-sdk-go-v2/service/sts v1.51.1 h1:0HOqZXRvMytH6bFHVIc0oJX07sZjfhz0zXtjs6gdE8s= -github.com/aws/aws-sdk-go-v2/service/sts v1.51.1/go.mod h1:26zA0GhDrLo+yiLI2yXWxqB1PdsShfLikoI7GOEgugM= -github.com/aws/smithy-go v1.28.6 h1:Pj+/sUviNYjow8ELRtNwKHZ9ECeF+7pATX3+shjLIrw= -github.com/aws/smithy-go v1.28.6/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/aws/aws-sdk-go-v2/service/sso v1.39.0 h1:kIEpD5dUry7VET3Ybl7zj7PPHRB4lb52G9iTz+a1Tqk= +github.com/aws/aws-sdk-go-v2/service/sso v1.39.0/go.mod h1:UGsEYgWz4Gi+46vDQ5zkFLqUgJziyOE2SXjZjgmfmHc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.0 h1:WfFev+HgTodggcNon5HieiLxxwWwb8Br8R2+nDkixvk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.0/go.mod h1:gJSdIY6YUzDvqQLcMtPVZgBRHrFwzHryvpE8Igzbxps= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.6 h1:BVjKrtRUtSYKztBCCfE1oAB+d3ViKcW2cKZfserOqMQ= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.6/go.mod h1:eSukFLeLkPMm+1OxDR+F0joauZdyBkF47Ow7MqjZiJw= +github.com/aws/smithy-go v1.28.7 h1:h/n1SHrwVtaDYLz8mR1/Kq4Xh4RaFbFW7bOYckg9mfE= +github.com/aws/smithy-go v1.28.7/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go index 880875ae2..24c4f5c7a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go @@ -3,4 +3,4 @@ package aws // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.47.4" +const goModuleVersion = "1.47.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.go deleted file mode 100644 index 1bce78a4d..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.go +++ /dev/null @@ -1,85 +0,0 @@ -package restjson - -import ( - "encoding/json" - "io" - "strings" - - "github.com/aws/smithy-go" -) - -// GetErrorInfo util looks for code, __type, and message members in the -// json body. These members are optionally available, and the function -// returns the value of member if it is available. This function is useful to -// identify the error code, msg in a REST JSON error response. -func GetErrorInfo(decoder *json.Decoder) (errorType string, message string, err error) { - var errInfo struct { - Code string - Type string `json:"__type"` - Message string - } - - err = decoder.Decode(&errInfo) - if err != nil { - if err == io.EOF { - return errorType, message, nil - } - return errorType, message, err - } - - // assign error type - if len(errInfo.Code) != 0 { - errorType = errInfo.Code - } else if len(errInfo.Type) != 0 { - errorType = errInfo.Type - } - - // assign error message - if len(errInfo.Message) != 0 { - message = errInfo.Message - } - - // sanitize error - if len(errorType) != 0 { - errorType = SanitizeErrorCode(errorType) - } - - return errorType, message, nil -} - -// SanitizeErrorCode sanitizes the errorCode string . -// The rule for sanitizing is if a `:` character is present, then take only the -// contents before the first : character in the value. -// If a # character is present, then take only the contents after the -// first # character in the value. -func SanitizeErrorCode(errorCode string) string { - if strings.ContainsAny(errorCode, ":") { - errorCode = strings.SplitN(errorCode, ":", 2)[0] - } - - if strings.ContainsAny(errorCode, "#") { - errorCode = strings.SplitN(errorCode, "#", 2)[1] - } - - return errorCode -} - -// GetSmithyGenericAPIError returns smithy generic api error and an error interface. -// Takes in json decoder, and error Code string as args. The function retrieves error message -// and error code from the decoder body. If errorCode of length greater than 0 is passed in as -// an argument, it is used instead. -func GetSmithyGenericAPIError(decoder *json.Decoder, errorCode string) (*smithy.GenericAPIError, error) { - errorType, message, err := GetErrorInfo(decoder) - if err != nil { - return nil, err - } - - if len(errorCode) == 0 { - errorCode = errorType - } - - return &smithy.GenericAPIError{ - Code: errorCode, - Message: message, - }, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md index c16921415..272d90bbc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md @@ -1,3 +1,31 @@ +# v1.33.12 (2026-10-27) + +* **Dependency Update**: Update to smithy-go v1.28.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.11 (2026-10-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.10 (2026-10-22) + +* **Bug Fix**: Update smithy-go to v1.28.6 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.9 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.8 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.7 (2026-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.33.6 (2026-09-24) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go index c47c1625a..1244de579 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go @@ -3,4 +3,4 @@ package config // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.33.6" +const goModuleVersion = "1.33.12" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md index 59c2310b9..92dfa3379 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md @@ -1,3 +1,33 @@ +# v1.20.12 (2026-10-27) + +* **Bug Fix**: Fixed the login credential panic when a retrieved token missed required fields +* **Bug Fix**: Return an error instead of panicking when an STS AssumeRole or AssumeRoleWithWebIdentity response is missing credentials. +* **Dependency Update**: Update to smithy-go v1.28.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.11 (2026-10-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.10 (2026-10-22) + +* **Bug Fix**: Update smithy-go to v1.28.6 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.9 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.8 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.7 (2026-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.20.6 (2026-09-24) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go index 00d49733b..b7bed4ca4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go @@ -3,4 +3,4 @@ package credentials // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.20.6" +const goModuleVersion = "1.20.12" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/provider.go index 1ca2a586b..7d3669dee 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/provider.go @@ -103,7 +103,9 @@ func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { return aws.Credentials{}, fmt.Errorf("create oauth2 token: %w", err) } - token.Update(out) + if err := token.Update(out); err != nil { + return aws.Credentials{}, fmt.Errorf("update token: %w", err) + } if err := p.saveToken(token); err != nil { return aws.Credentials{}, fmt.Errorf("save token: %w", err) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/token.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/token.go index 1a97b98cd..2b1e5ae11 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/token.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/token.go @@ -101,10 +101,25 @@ func (t *loginToken) Credentials() aws.Credentials { } } -func (t *loginToken) Update(out *signin.CreateOAuth2TokenOutput) { - t.AccessToken.AccessKeyID = *out.TokenOutput.AccessToken.AccessKeyId - t.AccessToken.SecretAccessKey = *out.TokenOutput.AccessToken.SecretAccessKey - t.AccessToken.SessionToken = *out.TokenOutput.AccessToken.SessionToken +func (t *loginToken) Update(out *signin.CreateOAuth2TokenOutput) error { + if out == nil { + return fmt.Errorf("missing CreateOAuth2Token response") + } + if out.TokenOutput == nil { + return fmt.Errorf("missing TokenOutput in CreateOAuth2Token response") + } + if out.TokenOutput.AccessToken == nil { + return fmt.Errorf("missing AccessToken in CreateOAuth2Token response") + } + if out.TokenOutput.ExpiresIn == nil { + return fmt.Errorf("missing ExpiresIn in CreateOAuth2Token response") + } + + t.AccessToken.AccessKeyID = aws.ToString(out.TokenOutput.AccessToken.AccessKeyId) + t.AccessToken.SecretAccessKey = aws.ToString(out.TokenOutput.AccessToken.SecretAccessKey) + t.AccessToken.SessionToken = aws.ToString(out.TokenOutput.AccessToken.SessionToken) t.AccessToken.ExpiresAt = sdk.NowTime().Add(time.Duration(*out.TokenOutput.ExpiresIn) * time.Second) - t.RefreshToken = *out.TokenOutput.RefreshToken + t.RefreshToken = aws.ToString(out.TokenOutput.RefreshToken) + + return t.Validate() } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go index 1ccf71e77..c1427f960 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go @@ -311,6 +311,9 @@ func (p *AssumeRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, err if err != nil { return aws.Credentials{Source: ProviderName}, err } + if err := validateCredentials(resp.Credentials); err != nil { + return aws.Credentials{Source: ProviderName}, fmt.Errorf("validate credentials, %w", err) + } var accountID string if resp.AssumedRoleUser != nil { @@ -318,13 +321,13 @@ func (p *AssumeRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, err } return aws.Credentials{ - AccessKeyID: *resp.Credentials.AccessKeyId, - SecretAccessKey: *resp.Credentials.SecretAccessKey, - SessionToken: *resp.Credentials.SessionToken, + AccessKeyID: aws.ToString(resp.Credentials.AccessKeyId), + SecretAccessKey: aws.ToString(resp.Credentials.SecretAccessKey), + SessionToken: aws.ToString(resp.Credentials.SessionToken), Source: ProviderName, CanExpire: true, - Expires: *resp.Credentials.Expiration, + Expires: aws.ToTime(resp.Credentials.Expiration), AccountID: accountID, }, nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go index e3d4a3cd4..0ae04cee6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go @@ -2,6 +2,7 @@ package stscreds import ( "context" + "errors" "fmt" "os" "strconv" @@ -139,6 +140,9 @@ func (p *WebIdentityRoleProvider) Retrieve(ctx context.Context) (aws.Credentials if err != nil { return aws.Credentials{}, fmt.Errorf("failed to retrieve credentials, %w", err) } + if err := validateCredentials(resp.Credentials); err != nil { + return aws.Credentials{}, fmt.Errorf("validate credentials, %w", err) + } var accountID string if resp.AssumedRoleUser != nil { @@ -154,12 +158,20 @@ func (p *WebIdentityRoleProvider) Retrieve(ctx context.Context) (aws.Credentials SessionToken: aws.ToString(resp.Credentials.SessionToken), Source: WebIdentityProviderName, CanExpire: true, - Expires: *resp.Credentials.Expiration, + Expires: aws.ToTime(resp.Credentials.Expiration), AccountID: accountID, } return value, nil } +func validateCredentials(c *types.Credentials) error { + if c == nil { + return errors.New("response did not contain credentials") + } + + return nil +} + // extract accountID from arn with format "arn:partition:service:region:account-id:[resource-section]" func getAccountID(u *types.AssumedRoleUser) string { if u.Arn == nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md index f15072b68..1e7b32c58 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md @@ -1,3 +1,23 @@ +# v1.20.5 (2026-10-27) + +* **Dependency Update**: Update to smithy-go v1.28.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.4 (2026-10-22) + +* **Bug Fix**: Update smithy-go to v1.28.6 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.3 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.2 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.20.1 (2026-09-24) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go index baf15c947..5d6041dd5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go @@ -3,4 +3,4 @@ package imds // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.20.1" +const goModuleVersion = "1.20.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md index e690de43f..70a5be059 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md @@ -1,3 +1,8 @@ +# v1.5.8 (2026-10-27) + +* **Dependency Update**: Update to smithy-go v1.28.7. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.5.7 (2026-10-22) * **Bug Fix**: Update smithy-go to v1.28.6 diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go index 67531933d..d01dbaf3b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go @@ -3,4 +3,4 @@ package configsources // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.5.7" +const goModuleVersion = "1.5.8" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md index fabd3306a..a1da2e63e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md @@ -1,3 +1,8 @@ +# v2.8.8 (2026-10-27) + +* **Dependency Update**: Update to smithy-go v1.28.7. +* **Dependency Update**: Updated to the latest SDK module versions + # v2.8.7 (2026-10-22) * **Bug Fix**: Update smithy-go to v1.28.6 diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go index 4619ce116..901fee755 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go @@ -3,4 +3,4 @@ package endpoints // goModuleVersion is the tagged release for this module -const goModuleVersion = "2.8.7" +const goModuleVersion = "2.8.8" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md index 2058fadb1..41d8d0414 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md @@ -1,3 +1,22 @@ +# v1.5.8 (2026-10-27) + +* **Dependency Update**: Update to smithy-go v1.28.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.7 (2026-10-22) + +* **Bug Fix**: Update smithy-go to v1.28.6 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.6 (2026-10-09.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.5 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.5.4 (2026-09-24) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go index b10d86aa6..ce49fdb82 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go @@ -3,4 +3,4 @@ package v4a // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.5.4" +const goModuleVersion = "1.5.8" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md index 6723895d1..e4a47c9c9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md @@ -1,3 +1,19 @@ +# v1.13.23 (2026-10-27) + +* **Dependency Update**: Update to smithy-go v1.28.7. + +# v1.13.22 (2026-10-22) + +* **Bug Fix**: Update smithy-go to v1.28.6 + +# v1.13.21 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. + +# v1.13.20 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. + # v1.13.19 (2026-08-26) * **Dependency Update**: Update to smithy-go v1.28.0. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go index f5bc392a4..a0921cda1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go @@ -3,4 +3,4 @@ package acceptencoding // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.19" +const goModuleVersion = "1.13.23" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md index 0d7ac987a..71e0414f5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md @@ -1,3 +1,23 @@ +# v1.14.8 (2026-10-27) + +* **Dependency Update**: Update to smithy-go v1.28.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.7 (2026-10-22) + +* **Bug Fix**: Update smithy-go to v1.28.6 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.6 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.5 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.14.4 (2026-09-24) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go index 05dc98848..c1c6994af 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go @@ -3,4 +3,4 @@ package presignedurl // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.14.4" +const goModuleVersion = "1.14.8" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/CHANGELOG.md index 5b2e9bf15..e77e7dc22 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/CHANGELOG.md @@ -1,3 +1,32 @@ +# v1.12.0 (2026-10-27) + +* **Feature**: Enable schema-based (de)serialization for this service. +* **Dependency Update**: Update to smithy-go v1.28.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2026-10-26) + +* **Feature**: Adds support for the OAuth 2.0 Token Exchange grant (RFC 8693), enabling applications to exchange identity provider issued JSON Web Tokens (JWTs) for short-lived OAuth access tokens to access supported AWS services without managing separate AWS credentials. + +# v1.10.5 (2026-10-22) + +* **Bug Fix**: Update smithy-go to v1.28.6 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.4 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.3 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.2 (2026-10-06) + +* No change notes available for this release. + # v1.10.1 (2026-09-24) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_client.go index b7040dc6b..a0127dd1c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_client.go @@ -17,6 +17,7 @@ import ( internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" "github.com/aws/aws-sdk-go-v2/internal/timeouts" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" @@ -25,6 +26,7 @@ import ( smithyrand "github.com/aws/smithy-go/rand" "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/aws/smithy-go/transport/http/protocol/restjson1" "net" "net/http" "sync/atomic" @@ -214,6 +216,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveAuthSchemeResolver(&options) + options.Protocol = restjson1.New(schemas.Signin) + for _, fn := range optFns { fn(&options) } @@ -431,6 +435,102 @@ func resolveAuthSchemes(options *Options) { } } +type serializeRequestMiddleware struct { + options *Options + operationSchema *smithy.OperationSchema +} + +func (*serializeRequestMiddleware) ID() string { + return "OperationSerializer" +} + +func (m *serializeRequestMiddleware) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return middleware.SerializeOutput{}, middleware.Metadata{}, fmt.Errorf("unexpected transport type %T", in.Request) + } + + input, ok := in.Parameters.(smithy.Serializable) + if !ok { + return middleware.SerializeOutput{}, middleware.Metadata{}, fmt.Errorf("input %T is not Serializable", in.Request) + } + + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + + err := m.options.Protocol.SerializeRequest(ctx, m.operationSchema, input, req) + + endTimer() + span.End() + + if err != nil { + return middleware.SerializeOutput{}, middleware.Metadata{}, err + } + + return next.HandleSerialize(ctx, in) +} + +type deserializeResponseMiddleware struct { + options *Options + operationSchema *smithy.OperationSchema + output smithy.Deserializable +} + +func (*deserializeResponseMiddleware) ID() string { + return "OperationDeserializer" +} + +func (m *deserializeResponseMiddleware) HandleDeserialize( + ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, +) ( + middleware.DeserializeOutput, middleware.Metadata, error, +) { + out, md, err := next.HandleDeserialize(ctx, in) + + resp, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, md, err + } + return out, md, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + // Close the response body on return. CloseResponseBody keeps the body + // open only for a successful caller-owned stream (a streaming payload + // with a nil error); on any error -- including one surfaced by an + // interceptor that runs after OperationDeserializer (after transmit or + // before deserialization) -- it closes the received body. Registering + // this before the error check below is what covers those interceptor + // aborts. Event streams close their own body in the event stream + // deserializer. + if !m.operationSchema.IsInputEventStream() && !m.operationSchema.IsOutputEventStream() { + _, isStreamingPayload := m.output.(smithy.StreamingOutput) + defer func() { + smithyhttp.CloseResponseBody(ctx, resp, isStreamingPayload, err) + }() + } + + if err != nil { + return out, md, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + + err = m.options.Protocol.DeserializeResponse(ctx, m.operationSchema, TypeRegistry, resp, m.output) + out.Result = m.output + + endTimer() + span.End() + + return out, md, err +} + type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2Token.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2Token.go index d58473ac8..72b679f5e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2Token.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2Token.go @@ -4,53 +4,15 @@ package signin import ( "context" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" "github.com/aws/aws-sdk-go-v2/service/signin/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" ) -// CreateOAuth2Token API -// -// Path: /v1/token Request Method: POST Content-Type: application/json or -// application/x-www-form-urlencoded -// -// This API implements OAuth 2.0 flows for AWS Sign-In CLI clients, supporting -// both: -// -// - Authorization code redemption (grant_type=authorization_code) - NOT -// idempotent -// - Token refresh (grant_type=refresh_token) - Idempotent within token validity -// window -// -// The operation behavior is determined by the grant_type parameter in the request -// body: -// -// Authorization Code Flow (NOT Idempotent): -// -// - JSON or form-encoded body with client_id, grant_type=authorization_code, -// code, redirect_uri, code_verifier -// - Returns access_token, token_type, expires_in, refresh_token, and id_token -// - Each authorization code can only be used ONCE for security (prevents replay -// attacks) -// -// Token Refresh Flow (Idempotent): -// -// - JSON or form-encoded body with client_id, grant_type=refresh_token, -// refresh_token -// - Returns access_token, token_type, expires_in, and refresh_token (no -// id_token) -// - Multiple calls with same refresh_token return consistent results within -// validity window -// -// Authentication and authorization: -// -// - Confidential clients: sigv4 signing required with signin:ExchangeToken -// permissions -// - CLI clients (public): authn/authz skipped based on client_id & grant_type -// -// Note: This operation cannot be marked as @idempotent because it handles both -// idempotent (token refresh) and non-idempotent (auth code redemption) flows in a -// single endpoint. +// Exchanges an authorization code or refresh token for an OAuth 2.0 access token +// and refresh token. func (c *Client) CreateOAuth2Token(ctx context.Context, params *CreateOAuth2TokenInput, optFns ...func(*Options)) (*CreateOAuth2TokenOutput, error) { if params == nil { params = &CreateOAuth2TokenInput{} @@ -73,8 +35,8 @@ func (c *Client) CreateOAuth2Token(ctx context.Context, params *CreateOAuth2Toke // parameter in the request body. type CreateOAuth2TokenInput struct { - // Flattened token operation inputs The specific operation is determined by - // grant_type in the request body + // Flattened token operation inputs. The "grant_type" in the request body + // determines the specific operation. // // This member is required. TokenInput *types.CreateOAuth2TokenRequestBody @@ -82,6 +44,19 @@ type CreateOAuth2TokenInput struct { noSmithyDocumentSerde } +func (v *CreateOAuth2TokenInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateOAuth2TokenRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateOAuth2TokenInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TokenInput != nil { + s.WriteStruct(schemas.CreateOAuth2TokenRequest_tokenInput) + v.TokenInput.SerializeMembers(s) + s.CloseStruct() + } +} func (in *CreateOAuth2TokenInput) bindEndpointParams(p *EndpointParameters) { p.IsControlPlane = ptr.Bool(false) @@ -94,8 +69,8 @@ func (in *CreateOAuth2TokenInput) bindEndpointParams(p *EndpointParameters) { // original request. type CreateOAuth2TokenOutput struct { - // Flattened token operation outputs The specific response fields depend on the - // grant_type used in the request + // Flattened token operation outputs. The specific response fields depend on the + // grant_type used in the request. // // This member is required. TokenOutput *types.CreateOAuth2TokenResponseBody @@ -106,13 +81,34 @@ type CreateOAuth2TokenOutput struct { noSmithyDocumentSerde } +func (v *CreateOAuth2TokenOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateOAuth2TokenResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateOAuth2TokenOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TokenOutput != nil { + s.WriteStruct(schemas.CreateOAuth2TokenResponse_tokenOutput) + v.TokenOutput.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *CreateOAuth2TokenOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateOAuth2TokenResponse, func(s *smithy.Schema) error { + switch s { + case schemas.CreateOAuth2TokenResponse_tokenOutput: + v.TokenOutput = &types.CreateOAuth2TokenResponseBody{} + return v.TokenOutput.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationCreateOAuth2TokenMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateOAuth2Token{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateOAuth2Token, schemas.CreateOAuth2TokenRequest, schemas.CreateOAuth2TokenResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateOAuth2Token{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateOAuth2Token, schemas.CreateOAuth2TokenRequest, schemas.CreateOAuth2TokenResponse), output: &CreateOAuth2TokenOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithIAM.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithIAM.go index ee19239b2..ca3431a9c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithIAM.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithIAM.go @@ -4,12 +4,14 @@ package signin import ( "context" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" ) -// Grants permission to exchange client credentials for an OAuth 2.0 access token -// scoped to a resource that can be used to access AWS services from applications +// Exchanges client credentials for an OAuth 2.0 access token scoped to a +// resource, which you can use to access AWS services from applications. func (c *Client) CreateOAuth2TokenWithIAM(ctx context.Context, params *CreateOAuth2TokenWithIAMInput, optFns ...func(*Options)) (*CreateOAuth2TokenWithIAMOutput, error) { if params == nil { params = &CreateOAuth2TokenWithIAMInput{} @@ -28,7 +30,7 @@ func (c *Client) CreateOAuth2TokenWithIAM(ctx context.Context, params *CreateOAu // Input structure for CreateOAuth2TokenWithIAM operation type CreateOAuth2TokenWithIAMInput struct { - // OAuth 2.0 grant type. Must be "client_credentials". + // The OAuth 2.0 grant type. Must be "client_credentials". // // This member is required. GrantType *string @@ -42,6 +44,20 @@ type CreateOAuth2TokenWithIAMInput struct { noSmithyDocumentSerde } +func (v *CreateOAuth2TokenWithIAMInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateOAuth2TokenWithIAMRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateOAuth2TokenWithIAMInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GrantType != nil { + s.WriteString(schemas.CreateOAuth2TokenWithIAMRequest_grantType, *v.GrantType) + } + if v.Resource != nil { + s.WriteString(schemas.CreateOAuth2TokenWithIAMRequest_resource, *v.Resource) + } +} func (in *CreateOAuth2TokenWithIAMInput) bindEndpointParams(p *EndpointParameters) { p.IsOAuthEndpoint = ptr.Bool(true) @@ -49,21 +65,23 @@ func (in *CreateOAuth2TokenWithIAMInput) bindEndpointParams(p *EndpointParameter // Output structure for CreateOAuth2TokenWithIAM operation // -// Contains the JWT access token, token type, and expiration per RFC 6749 §5.1. +// Contains the access token, token type, and expiration as defined in RFC 6749 +// §5.1. type CreateOAuth2TokenWithIAMOutput struct { - // JWT access token containing principal identity, resource scope, and session - // metadata + // Access token containing principal identity, resource scope, and session + // metadata. // // This member is required. AccessToken *string - // Token lifetime in seconds. Value is the minimum of session validity and 1 hour. + // Token lifetime in seconds. Value is the minimum of the caller's session + // validity and 1 hour (3600 seconds). // // This member is required. ExpiresIn *int32 - // Always "Bearer" per OAuth 2.1 specification + // The token type. Always "Bearer" as defined in RFC 6749. // // This member is required. TokenType *string @@ -74,13 +92,44 @@ type CreateOAuth2TokenWithIAMOutput struct { noSmithyDocumentSerde } +func (v *CreateOAuth2TokenWithIAMOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateOAuth2TokenWithIAMResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateOAuth2TokenWithIAMOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccessToken != nil { + s.WriteString(schemas.CreateOAuth2TokenWithIAMResponse_accessToken, *v.AccessToken) + } + if v.ExpiresIn != nil { + s.WriteInt32(schemas.CreateOAuth2TokenWithIAMResponse_expiresIn, *v.ExpiresIn) + } + if v.TokenType != nil { + s.WriteString(schemas.CreateOAuth2TokenWithIAMResponse_tokenType, *v.TokenType) + } +} +func (v *CreateOAuth2TokenWithIAMOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateOAuth2TokenWithIAMResponse, func(s *smithy.Schema) error { + switch s { + case schemas.CreateOAuth2TokenWithIAMResponse_accessToken: + v.AccessToken = new(string) + return d.ReadString(schemas.CreateOAuth2TokenWithIAMResponse_accessToken, v.AccessToken) + case schemas.CreateOAuth2TokenWithIAMResponse_expiresIn: + v.ExpiresIn = new(int32) + return d.ReadInt32(schemas.CreateOAuth2TokenWithIAMResponse_expiresIn, v.ExpiresIn) + case schemas.CreateOAuth2TokenWithIAMResponse_tokenType: + v.TokenType = new(string) + return d.ReadString(schemas.CreateOAuth2TokenWithIAMResponse_tokenType, v.TokenType) + } + return nil + }) +} func (c *Client) addOperationCreateOAuth2TokenWithIAMMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateOAuth2TokenWithIAM{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateOAuth2TokenWithIAM, schemas.CreateOAuth2TokenWithIAMRequest, schemas.CreateOAuth2TokenWithIAMResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateOAuth2TokenWithIAM{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateOAuth2TokenWithIAM, schemas.CreateOAuth2TokenWithIAMRequest, schemas.CreateOAuth2TokenWithIAMResponse), output: &CreateOAuth2TokenWithIAMOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithTokenExchange.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithTokenExchange.go new file mode 100644 index 000000000..bc3cba52d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2TokenWithTokenExchange.go @@ -0,0 +1,198 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signin + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" +) + +// Exchanges a supported token for an OAuth 2.0 access token scoped to a resource, +// which you can use to access AWS services from applications. +func (c *Client) CreateOAuth2TokenWithTokenExchange(ctx context.Context, params *CreateOAuth2TokenWithTokenExchangeInput, optFns ...func(*Options)) (*CreateOAuth2TokenWithTokenExchangeOutput, error) { + if params == nil { + params = &CreateOAuth2TokenWithTokenExchangeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateOAuth2TokenWithTokenExchange", params, optFns, c.addOperationCreateOAuth2TokenWithTokenExchangeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateOAuth2TokenWithTokenExchangeOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input structure for CreateOAuth2TokenWithTokenExchange operation +type CreateOAuth2TokenWithTokenExchangeInput struct { + + // The OAuth 2.0 grant type. Currently only supports + // "urn:ietf:params:oauth:grant-type:token-exchange". + // + // This member is required. + GrantType *string + + // The OAuth resource for which the access token is requested. Required when + // "grant_type=urn:ietf:params:oauth:grant-type:token-exchange". Example: + // "glue.amazonaws.com". + Resource *string + + // IAM managed policy Amazon Resource Names (ARNs) to apply as session policies + // that further scope down the permissions of the issued access token, provided as + // a space-delimited list. Example: "arn:aws:iam::444455556666:policy/MyPolicy". + Scope *string + + // The subject token that represents the identity of the party on whose behalf the + // request is made. Required when + // "grant_type=urn:ietf:params:oauth:grant-type:token-exchange". + SubjectToken *string + + // The token type of the subject token. Currently only supports + // "urn:ietf:params:oauth:token-type:jwt". Required when + // "grant_type=urn:ietf:params:oauth:grant-type:token-exchange". + SubjectTokenType *string + + noSmithyDocumentSerde +} + +func (v *CreateOAuth2TokenWithTokenExchangeInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateOAuth2TokenWithTokenExchangeRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateOAuth2TokenWithTokenExchangeInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.GrantType != nil { + s.WriteString(schemas.CreateOAuth2TokenWithTokenExchangeRequest_grantType, *v.GrantType) + } + if v.Resource != nil { + s.WriteString(schemas.CreateOAuth2TokenWithTokenExchangeRequest_resource, *v.Resource) + } + if v.Scope != nil { + s.WriteString(schemas.CreateOAuth2TokenWithTokenExchangeRequest_scope, *v.Scope) + } + if v.SubjectToken != nil { + s.WriteString(schemas.CreateOAuth2TokenWithTokenExchangeRequest_subjectToken, *v.SubjectToken) + } + if v.SubjectTokenType != nil { + s.WriteString(schemas.CreateOAuth2TokenWithTokenExchangeRequest_subjectTokenType, *v.SubjectTokenType) + } +} +func (in *CreateOAuth2TokenWithTokenExchangeInput) bindEndpointParams(p *EndpointParameters) { + + p.IsOAuthEndpoint = ptr.Bool(true) +} + +// Output structure for CreateOAuth2TokenWithTokenExchange operation. +// +// Contains the access token, issued token type, token type, and expiration as +// defined in RFC 6749 §5.1 and RFC 8693 §2.2.1. +type CreateOAuth2TokenWithTokenExchangeOutput struct { + + // Access token containing principal identity, resource scope, and session + // metadata. + // + // This member is required. + AccessToken *string + + // Token lifetime in seconds. Value is the minimum of the subject token's validity + // and 1 hour (3600 seconds). + // + // This member is required. + ExpiresIn *int32 + + // The token type. Currently only supports "Bearer" as defined in RFC 6749. + // + // This member is required. + TokenType *string + + // The token type of the issued token. Always + // "urn:ietf:params:oauth:token-type:access_token" as defined in RFC 8693 §2.2.1. + IssuedTokenType *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (v *CreateOAuth2TokenWithTokenExchangeOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateOAuth2TokenWithTokenExchangeResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateOAuth2TokenWithTokenExchangeOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccessToken != nil { + s.WriteString(schemas.CreateOAuth2TokenWithTokenExchangeResponse_accessToken, *v.AccessToken) + } + if v.ExpiresIn != nil { + s.WriteInt32(schemas.CreateOAuth2TokenWithTokenExchangeResponse_expiresIn, *v.ExpiresIn) + } + if v.IssuedTokenType != nil { + s.WriteString(schemas.CreateOAuth2TokenWithTokenExchangeResponse_issuedTokenType, *v.IssuedTokenType) + } + if v.TokenType != nil { + s.WriteString(schemas.CreateOAuth2TokenWithTokenExchangeResponse_tokenType, *v.TokenType) + } +} +func (v *CreateOAuth2TokenWithTokenExchangeOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateOAuth2TokenWithTokenExchangeResponse, func(s *smithy.Schema) error { + switch s { + case schemas.CreateOAuth2TokenWithTokenExchangeResponse_accessToken: + v.AccessToken = new(string) + return d.ReadString(schemas.CreateOAuth2TokenWithTokenExchangeResponse_accessToken, v.AccessToken) + case schemas.CreateOAuth2TokenWithTokenExchangeResponse_expiresIn: + v.ExpiresIn = new(int32) + return d.ReadInt32(schemas.CreateOAuth2TokenWithTokenExchangeResponse_expiresIn, v.ExpiresIn) + case schemas.CreateOAuth2TokenWithTokenExchangeResponse_issuedTokenType: + v.IssuedTokenType = new(string) + return d.ReadString(schemas.CreateOAuth2TokenWithTokenExchangeResponse_issuedTokenType, v.IssuedTokenType) + case schemas.CreateOAuth2TokenWithTokenExchangeResponse_tokenType: + v.TokenType = new(string) + return d.ReadString(schemas.CreateOAuth2TokenWithTokenExchangeResponse_tokenType, v.TokenType) + } + return nil + }) +} +func (c *Client) addOperationCreateOAuth2TokenWithTokenExchangeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateOAuth2TokenWithTokenExchange, schemas.CreateOAuth2TokenWithTokenExchangeRequest, schemas.CreateOAuth2TokenWithTokenExchangeResponse)}, middleware.After); err != nil { + return err + } + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateOAuth2TokenWithTokenExchange, schemas.CreateOAuth2TokenWithTokenExchangeRequest, schemas.CreateOAuth2TokenWithTokenExchangeResponse), output: &CreateOAuth2TokenWithTokenExchangeOutput{}}, middleware.After); err != nil { + return err + } + + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRecordResponseTiming(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpCreateOAuth2TokenWithTokenExchangeValidationMiddleware(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptors(stack, options); err != nil { + return err + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteConsoleAuthorizationConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteConsoleAuthorizationConfiguration.go index 0471b9c56..f3596fa33 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteConsoleAuthorizationConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteConsoleAuthorizationConfiguration.go @@ -4,6 +4,8 @@ package signin import ( "context" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" ) @@ -33,6 +35,17 @@ type DeleteConsoleAuthorizationConfigurationInput struct { noSmithyDocumentSerde } +func (v *DeleteConsoleAuthorizationConfigurationInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteConsoleAuthorizationConfigurationInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteConsoleAuthorizationConfigurationInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TargetId != nil { + s.WriteString(schemas.DeleteConsoleAuthorizationConfigurationInput_targetId, *v.TargetId) + } +} func (in *DeleteConsoleAuthorizationConfigurationInput) bindEndpointParams(p *EndpointParameters) { p.IsControlPlane = ptr.Bool(true) @@ -62,13 +75,44 @@ type DeleteConsoleAuthorizationConfigurationOutput struct { noSmithyDocumentSerde } +func (v *DeleteConsoleAuthorizationConfigurationOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteConsoleAuthorizationConfigurationOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteConsoleAuthorizationConfigurationOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConsoleAuthorizationEnabled != nil { + s.WriteBool(schemas.DeleteConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled, *v.ConsoleAuthorizationEnabled) + } + if v.Scope != nil { + s.WriteString(schemas.DeleteConsoleAuthorizationConfigurationOutput_scope, *v.Scope) + } + if v.TargetId != nil { + s.WriteString(schemas.DeleteConsoleAuthorizationConfigurationOutput_targetId, *v.TargetId) + } +} +func (v *DeleteConsoleAuthorizationConfigurationOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteConsoleAuthorizationConfigurationOutput, func(s *smithy.Schema) error { + switch s { + case schemas.DeleteConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled: + v.ConsoleAuthorizationEnabled = new(bool) + return d.ReadBool(schemas.DeleteConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled, v.ConsoleAuthorizationEnabled) + case schemas.DeleteConsoleAuthorizationConfigurationOutput_scope: + v.Scope = new(string) + return d.ReadString(schemas.DeleteConsoleAuthorizationConfigurationOutput_scope, v.Scope) + case schemas.DeleteConsoleAuthorizationConfigurationOutput_targetId: + v.TargetId = new(string) + return d.ReadString(schemas.DeleteConsoleAuthorizationConfigurationOutput_targetId, v.TargetId) + } + return nil + }) +} func (c *Client) addOperationDeleteConsoleAuthorizationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteConsoleAuthorizationConfiguration{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteConsoleAuthorizationConfiguration, schemas.DeleteConsoleAuthorizationConfigurationInput, schemas.DeleteConsoleAuthorizationConfigurationOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteConsoleAuthorizationConfiguration{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteConsoleAuthorizationConfiguration, schemas.DeleteConsoleAuthorizationConfigurationInput, schemas.DeleteConsoleAuthorizationConfigurationOutput), output: &DeleteConsoleAuthorizationConfigurationOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteResourcePermissionStatement.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteResourcePermissionStatement.go index 513a82481..91d45ff02 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteResourcePermissionStatement.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_DeleteResourcePermissionStatement.go @@ -5,6 +5,8 @@ package signin import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" ) @@ -39,6 +41,20 @@ type DeleteResourcePermissionStatementInput struct { noSmithyDocumentSerde } +func (v *DeleteResourcePermissionStatementInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteResourcePermissionStatementInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteResourcePermissionStatementInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ClientToken != nil { + s.WriteString(schemas.DeleteResourcePermissionStatementInput_clientToken, *v.ClientToken) + } + if v.StatementId != nil { + s.WriteString(schemas.DeleteResourcePermissionStatementInput_statementId, *v.StatementId) + } +} func (in *DeleteResourcePermissionStatementInput) bindEndpointParams(p *EndpointParameters) { p.IsControlPlane = ptr.Bool(true) @@ -52,13 +68,26 @@ type DeleteResourcePermissionStatementOutput struct { noSmithyDocumentSerde } +func (v *DeleteResourcePermissionStatementOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.DeleteResourcePermissionStatementOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *DeleteResourcePermissionStatementOutput) SerializeMembers(s smithy.ShapeSerializer) { +} +func (v *DeleteResourcePermissionStatementOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.DeleteResourcePermissionStatementOutput, func(s *smithy.Schema) error { + switch s { + } + return nil + }) +} func (c *Client) addOperationDeleteResourcePermissionStatementMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteResourcePermissionStatement{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteResourcePermissionStatement, schemas.DeleteResourcePermissionStatementInput, schemas.DeleteResourcePermissionStatementOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteResourcePermissionStatement{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.DeleteResourcePermissionStatement, schemas.DeleteResourcePermissionStatementInput, schemas.DeleteResourcePermissionStatementOutput), output: &DeleteResourcePermissionStatementOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetConsoleAuthorizationConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetConsoleAuthorizationConfiguration.go index 90498a68c..3487f5e55 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetConsoleAuthorizationConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetConsoleAuthorizationConfiguration.go @@ -4,6 +4,8 @@ package signin import ( "context" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" ) @@ -33,6 +35,17 @@ type GetConsoleAuthorizationConfigurationInput struct { noSmithyDocumentSerde } +func (v *GetConsoleAuthorizationConfigurationInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GetConsoleAuthorizationConfigurationInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GetConsoleAuthorizationConfigurationInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TargetId != nil { + s.WriteString(schemas.GetConsoleAuthorizationConfigurationInput_targetId, *v.TargetId) + } +} func (in *GetConsoleAuthorizationConfigurationInput) bindEndpointParams(p *EndpointParameters) { p.IsControlPlane = ptr.Bool(true) @@ -62,13 +75,44 @@ type GetConsoleAuthorizationConfigurationOutput struct { noSmithyDocumentSerde } +func (v *GetConsoleAuthorizationConfigurationOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GetConsoleAuthorizationConfigurationOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GetConsoleAuthorizationConfigurationOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConsoleAuthorizationEnabled != nil { + s.WriteBool(schemas.GetConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled, *v.ConsoleAuthorizationEnabled) + } + if v.Scope != nil { + s.WriteString(schemas.GetConsoleAuthorizationConfigurationOutput_scope, *v.Scope) + } + if v.TargetId != nil { + s.WriteString(schemas.GetConsoleAuthorizationConfigurationOutput_targetId, *v.TargetId) + } +} +func (v *GetConsoleAuthorizationConfigurationOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GetConsoleAuthorizationConfigurationOutput, func(s *smithy.Schema) error { + switch s { + case schemas.GetConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled: + v.ConsoleAuthorizationEnabled = new(bool) + return d.ReadBool(schemas.GetConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled, v.ConsoleAuthorizationEnabled) + case schemas.GetConsoleAuthorizationConfigurationOutput_scope: + v.Scope = new(string) + return d.ReadString(schemas.GetConsoleAuthorizationConfigurationOutput_scope, v.Scope) + case schemas.GetConsoleAuthorizationConfigurationOutput_targetId: + v.TargetId = new(string) + return d.ReadString(schemas.GetConsoleAuthorizationConfigurationOutput_targetId, v.TargetId) + } + return nil + }) +} func (c *Client) addOperationGetConsoleAuthorizationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpGetConsoleAuthorizationConfiguration{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.GetConsoleAuthorizationConfiguration, schemas.GetConsoleAuthorizationConfigurationInput, schemas.GetConsoleAuthorizationConfigurationOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetConsoleAuthorizationConfiguration{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.GetConsoleAuthorizationConfiguration, schemas.GetConsoleAuthorizationConfigurationInput, schemas.GetConsoleAuthorizationConfigurationOutput), output: &GetConsoleAuthorizationConfigurationOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetResourcePolicy.go index 087ff167f..b5100b304 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetResourcePolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_GetResourcePolicy.go @@ -4,7 +4,9 @@ package signin import ( "context" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" "github.com/aws/aws-sdk-go-v2/service/signin/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" ) @@ -30,6 +32,14 @@ type GetResourcePolicyInput struct { noSmithyDocumentSerde } +func (v *GetResourcePolicyInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GetResourcePolicyInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GetResourcePolicyInput) SerializeMembers(s smithy.ShapeSerializer) { +} func (in *GetResourcePolicyInput) bindEndpointParams(p *EndpointParameters) { p.IsControlPlane = ptr.Bool(true) @@ -49,13 +59,34 @@ type GetResourcePolicyOutput struct { noSmithyDocumentSerde } +func (v *GetResourcePolicyOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GetResourcePolicyOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GetResourcePolicyOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.SigninResourceBasedPolicy != nil { + s.WriteStruct(schemas.GetResourcePolicyOutput_signinResourceBasedPolicy) + v.SigninResourceBasedPolicy.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *GetResourcePolicyOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GetResourcePolicyOutput, func(s *smithy.Schema) error { + switch s { + case schemas.GetResourcePolicyOutput_signinResourceBasedPolicy: + v.SigninResourceBasedPolicy = &types.SigninResourceBasedPolicy{} + return v.SigninResourceBasedPolicy.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpGetResourcePolicy{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.GetResourcePolicy, schemas.GetResourcePolicyInput, schemas.GetResourcePolicyOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetResourcePolicy{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.GetResourcePolicy, schemas.GetResourcePolicyInput, schemas.GetResourcePolicyOutput), output: &GetResourcePolicyOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_IntrospectOAuth2TokenWithIAM.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_IntrospectOAuth2TokenWithIAM.go index a2894eca9..06509b248 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_IntrospectOAuth2TokenWithIAM.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_IntrospectOAuth2TokenWithIAM.go @@ -4,20 +4,17 @@ package signin import ( "context" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" ) -// Grants permission to inspect the metadata and state of an OAuth 2.0 access -// token or refresh token +// Inspects the metadata and active state of an OAuth 2.0 access token or refresh +// token. // // Implements RFC 7662 OAuth 2.0 Token Introspection over a SigV4-authenticated -// endpoint. Inspects the metadata of an access_token or refresh_token issued by -// AWS Sign-In and returns the claims associated with it. -// -// Inactive token semantics (RFC 7662 §2.2): when the supplied token is unknown, -// expired, revoked, malformed, or owned by a different account, the response body -// is exactly { "active": false } with all other claims omitted. +// endpoint. Returns the claims associated with a token issued by AWS Sign-In. func (c *Client) IntrospectOAuth2TokenWithIAM(ctx context.Context, params *IntrospectOAuth2TokenWithIAMInput, optFns ...func(*Options)) (*IntrospectOAuth2TokenWithIAMOutput, error) { if params == nil { params = &IntrospectOAuth2TokenWithIAMInput{} @@ -39,20 +36,33 @@ func (c *Client) IntrospectOAuth2TokenWithIAM(ctx context.Context, params *Intro // optional hint about the token's type. type IntrospectOAuth2TokenWithIAMInput struct { - // The string value of the token to introspect. May be either an access_token or a - // refresh_token issued by AWS Sign-In. + // The access token or refresh token issued by AWS Sign-In. // // This member is required. Token *string - // Optional hint about the type of the token submitted for introspection. The - // server uses this hint to optimize lookup, but still falls back to the other - // token type on miss. Allowed values: access_token, refresh_token. + // An optional hint about the type of the token submitted for introspection, as + // defined in RFC 7662 §2.1. The server checks both token types regardless of the + // hint. Allowed values: "access_token", "refresh_token". TokenTypeHint *string noSmithyDocumentSerde } +func (v *IntrospectOAuth2TokenWithIAMInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.IntrospectOAuth2TokenWithIAMRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *IntrospectOAuth2TokenWithIAMInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.Token != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMRequest_token, *v.Token) + } + if v.TokenTypeHint != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMRequest_tokenTypeHint, *v.TokenTypeHint) + } +} func (in *IntrospectOAuth2TokenWithIAMInput) bindEndpointParams(p *EndpointParameters) { p.IsOAuthEndpoint = ptr.Bool(true) @@ -64,9 +74,9 @@ func (in *IntrospectOAuth2TokenWithIAMInput) bindEndpointParams(p *EndpointParam // are omitted when the token is inactive. type IntrospectOAuth2TokenWithIAMOutput struct { - // Indicates whether the token is currently active. true only when the token is - // valid, has not expired, has not been revoked, and belongs to the caller's - // account. + // Indicates whether the token is currently active. Returns "true" only when the + // token is valid, has not expired, has not been revoked, and belongs to the + // caller's account. // // This member is required. Active *bool @@ -74,8 +84,8 @@ type IntrospectOAuth2TokenWithIAMOutput struct { // 12-digit AWS account ID of the token's subject principal. AccountId *string - // Audience of the token: the OAuth resource the token is scoped to (for example, - // "aws-mcp.amazonaws.com"). Omitted for refresh tokens. + // The OAuth resource the token is scoped to. Omitted for refresh tokens. Example: + // "aws-mcp.amazonaws.com". Aud *string // Client identifier for the OAuth 2.0 client that requested the token. @@ -96,26 +106,24 @@ type IntrospectOAuth2TokenWithIAMOutput struct { // Token "not before" time as a NumericDate (Unix epoch seconds). Nbf *int64 - // The OAuth resource the token is scoped to during Human OAuth flow. Only present - // for refresh token introspection. + // The OAuth resource the token is scoped to. Only present for refresh token + // introspection. Resource *string // AWS Sign-In session ARN bound to the token, of the form // arn:aws:signin:{region}:{account}:session/{uuid}. SigninSession *string - // Subject of the token: the IAM principal ARN. For assumed-role sessions, this is - // the session ARN (matches sts:GetCallerIdentity's Arn field), e.g. - // arn:aws:sts::123456789012:assumed-role/MyRole/session-name. + // The IAM principal Amazon Resource Name (ARN). For assumed-role sessions, this + // is the session ARN. Sub *string // Indicates which kind of token was introspected. One of "access_token" or // "refresh_token". TokenType *string - // User identifier matching sts:GetCallerIdentity's UserId field for the token's - // subject principal (e.g. "AIDAEXAMPLE" for an IAM user, or - // "AROAEXAMPLE:session-name" for an assumed role). + // User identifier matching the "UserId" field from "sts:GetCallerIdentity" for + // the token's subject principal. UserId *string // Metadata pertaining to the operation's result. @@ -124,13 +132,110 @@ type IntrospectOAuth2TokenWithIAMOutput struct { noSmithyDocumentSerde } +func (v *IntrospectOAuth2TokenWithIAMOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.IntrospectOAuth2TokenWithIAMResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *IntrospectOAuth2TokenWithIAMOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccountId != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMResponse_accountId, *v.AccountId) + } + if v.Active != nil { + s.WriteBool(schemas.IntrospectOAuth2TokenWithIAMResponse_active, *v.Active) + } + if v.Aud != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMResponse_aud, *v.Aud) + } + if v.ClientId != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMResponse_clientId, *v.ClientId) + } + if v.Exp != nil { + s.WriteInt64(schemas.IntrospectOAuth2TokenWithIAMResponse_exp, *v.Exp) + } + if v.Iat != nil { + s.WriteInt64(schemas.IntrospectOAuth2TokenWithIAMResponse_iat, *v.Iat) + } + if v.Iss != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMResponse_iss, *v.Iss) + } + if v.Jti != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMResponse_jti, *v.Jti) + } + if v.Nbf != nil { + s.WriteInt64(schemas.IntrospectOAuth2TokenWithIAMResponse_nbf, *v.Nbf) + } + if v.Resource != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMResponse_resource, *v.Resource) + } + if v.SigninSession != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMResponse_signinSession, *v.SigninSession) + } + if v.Sub != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMResponse_sub, *v.Sub) + } + if v.TokenType != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMResponse_tokenType, *v.TokenType) + } + if v.UserId != nil { + s.WriteString(schemas.IntrospectOAuth2TokenWithIAMResponse_userId, *v.UserId) + } +} +func (v *IntrospectOAuth2TokenWithIAMOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.IntrospectOAuth2TokenWithIAMResponse, func(s *smithy.Schema) error { + switch s { + case schemas.IntrospectOAuth2TokenWithIAMResponse_accountId: + v.AccountId = new(string) + return d.ReadString(schemas.IntrospectOAuth2TokenWithIAMResponse_accountId, v.AccountId) + case schemas.IntrospectOAuth2TokenWithIAMResponse_active: + v.Active = new(bool) + return d.ReadBool(schemas.IntrospectOAuth2TokenWithIAMResponse_active, v.Active) + case schemas.IntrospectOAuth2TokenWithIAMResponse_aud: + v.Aud = new(string) + return d.ReadString(schemas.IntrospectOAuth2TokenWithIAMResponse_aud, v.Aud) + case schemas.IntrospectOAuth2TokenWithIAMResponse_clientId: + v.ClientId = new(string) + return d.ReadString(schemas.IntrospectOAuth2TokenWithIAMResponse_clientId, v.ClientId) + case schemas.IntrospectOAuth2TokenWithIAMResponse_exp: + v.Exp = new(int64) + return d.ReadInt64(schemas.IntrospectOAuth2TokenWithIAMResponse_exp, v.Exp) + case schemas.IntrospectOAuth2TokenWithIAMResponse_iat: + v.Iat = new(int64) + return d.ReadInt64(schemas.IntrospectOAuth2TokenWithIAMResponse_iat, v.Iat) + case schemas.IntrospectOAuth2TokenWithIAMResponse_iss: + v.Iss = new(string) + return d.ReadString(schemas.IntrospectOAuth2TokenWithIAMResponse_iss, v.Iss) + case schemas.IntrospectOAuth2TokenWithIAMResponse_jti: + v.Jti = new(string) + return d.ReadString(schemas.IntrospectOAuth2TokenWithIAMResponse_jti, v.Jti) + case schemas.IntrospectOAuth2TokenWithIAMResponse_nbf: + v.Nbf = new(int64) + return d.ReadInt64(schemas.IntrospectOAuth2TokenWithIAMResponse_nbf, v.Nbf) + case schemas.IntrospectOAuth2TokenWithIAMResponse_resource: + v.Resource = new(string) + return d.ReadString(schemas.IntrospectOAuth2TokenWithIAMResponse_resource, v.Resource) + case schemas.IntrospectOAuth2TokenWithIAMResponse_signinSession: + v.SigninSession = new(string) + return d.ReadString(schemas.IntrospectOAuth2TokenWithIAMResponse_signinSession, v.SigninSession) + case schemas.IntrospectOAuth2TokenWithIAMResponse_sub: + v.Sub = new(string) + return d.ReadString(schemas.IntrospectOAuth2TokenWithIAMResponse_sub, v.Sub) + case schemas.IntrospectOAuth2TokenWithIAMResponse_tokenType: + v.TokenType = new(string) + return d.ReadString(schemas.IntrospectOAuth2TokenWithIAMResponse_tokenType, v.TokenType) + case schemas.IntrospectOAuth2TokenWithIAMResponse_userId: + v.UserId = new(string) + return d.ReadString(schemas.IntrospectOAuth2TokenWithIAMResponse_userId, v.UserId) + } + return nil + }) +} func (c *Client) addOperationIntrospectOAuth2TokenWithIAMMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpIntrospectOAuth2TokenWithIAM{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.IntrospectOAuth2TokenWithIAM, schemas.IntrospectOAuth2TokenWithIAMRequest, schemas.IntrospectOAuth2TokenWithIAMResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpIntrospectOAuth2TokenWithIAM{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.IntrospectOAuth2TokenWithIAM, schemas.IntrospectOAuth2TokenWithIAMRequest, schemas.IntrospectOAuth2TokenWithIAMResponse), output: &IntrospectOAuth2TokenWithIAMOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_ListResourcePermissionStatements.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_ListResourcePermissionStatements.go index 22d0b58a9..c66a27838 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_ListResourcePermissionStatements.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_ListResourcePermissionStatements.go @@ -5,7 +5,9 @@ package signin import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" "github.com/aws/aws-sdk-go-v2/service/signin/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" ) @@ -38,6 +40,20 @@ type ListResourcePermissionStatementsInput struct { noSmithyDocumentSerde } +func (v *ListResourcePermissionStatementsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListResourcePermissionStatementsInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListResourcePermissionStatementsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.MaxResults != nil { + s.WriteInt32(schemas.ListResourcePermissionStatementsInput_maxResults, *v.MaxResults) + } + if v.NextToken != nil { + s.WriteString(schemas.ListResourcePermissionStatementsInput_nextToken, *v.NextToken) + } +} func (in *ListResourcePermissionStatementsInput) bindEndpointParams(p *EndpointParameters) { p.IsControlPlane = ptr.Bool(true) @@ -60,13 +76,35 @@ type ListResourcePermissionStatementsOutput struct { noSmithyDocumentSerde } +func (v *ListResourcePermissionStatementsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListResourcePermissionStatementsOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListResourcePermissionStatementsOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.NextToken != nil { + s.WriteString(schemas.ListResourcePermissionStatementsOutput_nextToken, *v.NextToken) + } + serializePermissionStatementSummaries(s, schemas.ListResourcePermissionStatementsOutput_permissionStatements, v.PermissionStatements) +} +func (v *ListResourcePermissionStatementsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ListResourcePermissionStatementsOutput, func(s *smithy.Schema) error { + switch s { + case schemas.ListResourcePermissionStatementsOutput_nextToken: + v.NextToken = new(string) + return d.ReadString(schemas.ListResourcePermissionStatementsOutput_nextToken, v.NextToken) + case schemas.ListResourcePermissionStatementsOutput_permissionStatements: + return deserializePermissionStatementSummaries(d, schemas.ListResourcePermissionStatementsOutput_permissionStatements, &v.PermissionStatements) + } + return nil + }) +} func (c *Client) addOperationListResourcePermissionStatementsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpListResourcePermissionStatements{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListResourcePermissionStatements, schemas.ListResourcePermissionStatementsInput, schemas.ListResourcePermissionStatementsOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListResourcePermissionStatements{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListResourcePermissionStatements, schemas.ListResourcePermissionStatementsInput, schemas.ListResourcePermissionStatementsOutput), output: &ListResourcePermissionStatementsOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutConsoleAuthorizationConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutConsoleAuthorizationConfiguration.go index ab698a339..9e27dcb3a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutConsoleAuthorizationConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutConsoleAuthorizationConfiguration.go @@ -4,6 +4,8 @@ package signin import ( "context" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" ) @@ -33,6 +35,17 @@ type PutConsoleAuthorizationConfigurationInput struct { noSmithyDocumentSerde } +func (v *PutConsoleAuthorizationConfigurationInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PutConsoleAuthorizationConfigurationInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PutConsoleAuthorizationConfigurationInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.TargetId != nil { + s.WriteString(schemas.PutConsoleAuthorizationConfigurationInput_targetId, *v.TargetId) + } +} func (in *PutConsoleAuthorizationConfigurationInput) bindEndpointParams(p *EndpointParameters) { p.IsControlPlane = ptr.Bool(true) @@ -62,13 +75,44 @@ type PutConsoleAuthorizationConfigurationOutput struct { noSmithyDocumentSerde } +func (v *PutConsoleAuthorizationConfigurationOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PutConsoleAuthorizationConfigurationOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PutConsoleAuthorizationConfigurationOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ConsoleAuthorizationEnabled != nil { + s.WriteBool(schemas.PutConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled, *v.ConsoleAuthorizationEnabled) + } + if v.Scope != nil { + s.WriteString(schemas.PutConsoleAuthorizationConfigurationOutput_scope, *v.Scope) + } + if v.TargetId != nil { + s.WriteString(schemas.PutConsoleAuthorizationConfigurationOutput_targetId, *v.TargetId) + } +} +func (v *PutConsoleAuthorizationConfigurationOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.PutConsoleAuthorizationConfigurationOutput, func(s *smithy.Schema) error { + switch s { + case schemas.PutConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled: + v.ConsoleAuthorizationEnabled = new(bool) + return d.ReadBool(schemas.PutConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled, v.ConsoleAuthorizationEnabled) + case schemas.PutConsoleAuthorizationConfigurationOutput_scope: + v.Scope = new(string) + return d.ReadString(schemas.PutConsoleAuthorizationConfigurationOutput_scope, v.Scope) + case schemas.PutConsoleAuthorizationConfigurationOutput_targetId: + v.TargetId = new(string) + return d.ReadString(schemas.PutConsoleAuthorizationConfigurationOutput_targetId, v.TargetId) + } + return nil + }) +} func (c *Client) addOperationPutConsoleAuthorizationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpPutConsoleAuthorizationConfiguration{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.PutConsoleAuthorizationConfiguration, schemas.PutConsoleAuthorizationConfigurationInput, schemas.PutConsoleAuthorizationConfigurationOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutConsoleAuthorizationConfiguration{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.PutConsoleAuthorizationConfiguration, schemas.PutConsoleAuthorizationConfigurationInput, schemas.PutConsoleAuthorizationConfigurationOutput), output: &PutConsoleAuthorizationConfigurationOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutResourcePermissionStatement.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutResourcePermissionStatement.go index 7013ae576..3f6153f56 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutResourcePermissionStatement.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_PutResourcePermissionStatement.go @@ -5,6 +5,8 @@ package signin import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" ) @@ -56,6 +58,38 @@ type PutResourcePermissionStatementInput struct { noSmithyDocumentSerde } +func (v *PutResourcePermissionStatementInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PutResourcePermissionStatementInput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PutResourcePermissionStatementInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ClientToken != nil { + s.WriteString(schemas.PutResourcePermissionStatementInput_clientToken, *v.ClientToken) + } + if v.ConsoleSourceVpce != nil { + s.WriteString(schemas.PutResourcePermissionStatementInput_consoleSourceVpce, *v.ConsoleSourceVpce) + } + if v.ExcludedPrincipal != nil { + s.WriteString(schemas.PutResourcePermissionStatementInput_excludedPrincipal, *v.ExcludedPrincipal) + } + if v.RequestedRegion != nil { + s.WriteString(schemas.PutResourcePermissionStatementInput_requestedRegion, *v.RequestedRegion) + } + if v.SigninSourceVpce != nil { + s.WriteString(schemas.PutResourcePermissionStatementInput_signinSourceVpce, *v.SigninSourceVpce) + } + if v.SourceIp != nil { + s.WriteString(schemas.PutResourcePermissionStatementInput_sourceIp, *v.SourceIp) + } + if v.SourceVpc != nil { + s.WriteString(schemas.PutResourcePermissionStatementInput_sourceVpc, *v.SourceVpc) + } + if v.VpcSourceIp != nil { + s.WriteString(schemas.PutResourcePermissionStatementInput_vpcSourceIp, *v.VpcSourceIp) + } +} func (in *PutResourcePermissionStatementInput) bindEndpointParams(p *EndpointParameters) { p.IsControlPlane = ptr.Bool(true) @@ -75,13 +109,32 @@ type PutResourcePermissionStatementOutput struct { noSmithyDocumentSerde } +func (v *PutResourcePermissionStatementOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PutResourcePermissionStatementOutput) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PutResourcePermissionStatementOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.StatementId != nil { + s.WriteString(schemas.PutResourcePermissionStatementOutput_statementId, *v.StatementId) + } +} +func (v *PutResourcePermissionStatementOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.PutResourcePermissionStatementOutput, func(s *smithy.Schema) error { + switch s { + case schemas.PutResourcePermissionStatementOutput_statementId: + v.StatementId = new(string) + return d.ReadString(schemas.PutResourcePermissionStatementOutput_statementId, v.StatementId) + } + return nil + }) +} func (c *Client) addOperationPutResourcePermissionStatementMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpPutResourcePermissionStatement{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.PutResourcePermissionStatement, schemas.PutResourcePermissionStatementInput, schemas.PutResourcePermissionStatementOutput)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutResourcePermissionStatement{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.PutResourcePermissionStatement, schemas.PutResourcePermissionStatementInput, schemas.PutResourcePermissionStatementOutput), output: &PutResourcePermissionStatementOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_RevokeOAuth2TokenWithIAM.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_RevokeOAuth2TokenWithIAM.go index 366d76c49..107ccf6fa 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_RevokeOAuth2TokenWithIAM.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_RevokeOAuth2TokenWithIAM.go @@ -4,19 +4,13 @@ package signin import ( "context" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" ) -// Grants permission to revoke an OAuth 2.0 refresh token and its associated -// refresh tokens -// -// Revokes a refresh_token issued by AWS Sign-In, invalidating the entire token -// chain so that the refresh_token can no longer be used to mint new access_tokens. -// -// Idempotency: revoking an already-revoked, expired, or otherwise invalid token -// still returns 200 OK with an empty body. Only the refresh_token type is -// accepted. +// Revokes an OAuth 2.0 refresh token and its associated token chain. func (c *Client) RevokeOAuth2TokenWithIAM(ctx context.Context, params *RevokeOAuth2TokenWithIAMInput, optFns ...func(*Options)) (*RevokeOAuth2TokenWithIAMOutput, error) { if params == nil { params = &RevokeOAuth2TokenWithIAMInput{} @@ -37,8 +31,8 @@ func (c *Client) RevokeOAuth2TokenWithIAM(ctx context.Context, params *RevokeOAu // RFC 7009 §2.1 revocation request. Contains the refresh_token to revoke. type RevokeOAuth2TokenWithIAMInput struct { - // The refresh_token to revoke. Must be a refresh_token issued by AWS Sign-In - // (prefix "ASOR"); access_tokens are not accepted for revocation. + // The refresh token to revoke. Must be a refresh token issued by AWS Sign-In. + // Access tokens are not accepted for revocation. // // This member is required. Token *string @@ -46,6 +40,17 @@ type RevokeOAuth2TokenWithIAMInput struct { noSmithyDocumentSerde } +func (v *RevokeOAuth2TokenWithIAMInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RevokeOAuth2TokenWithIAMRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RevokeOAuth2TokenWithIAMInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.Token != nil { + s.WriteString(schemas.RevokeOAuth2TokenWithIAMRequest_token, *v.Token) + } +} func (in *RevokeOAuth2TokenWithIAMInput) bindEndpointParams(p *EndpointParameters) { p.IsOAuthEndpoint = ptr.Bool(true) @@ -62,13 +67,26 @@ type RevokeOAuth2TokenWithIAMOutput struct { noSmithyDocumentSerde } +func (v *RevokeOAuth2TokenWithIAMOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RevokeOAuth2TokenWithIAMResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RevokeOAuth2TokenWithIAMOutput) SerializeMembers(s smithy.ShapeSerializer) { +} +func (v *RevokeOAuth2TokenWithIAMOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.RevokeOAuth2TokenWithIAMResponse, func(s *smithy.Schema) error { + switch s { + } + return nil + }) +} func (c *Client) addOperationRevokeOAuth2TokenWithIAMMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpRevokeOAuth2TokenWithIAM{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.RevokeOAuth2TokenWithIAM, schemas.RevokeOAuth2TokenWithIAMRequest, schemas.RevokeOAuth2TokenWithIAMResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRevokeOAuth2TokenWithIAM{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.RevokeOAuth2TokenWithIAM, schemas.RevokeOAuth2TokenWithIAMRequest, schemas.RevokeOAuth2TokenWithIAMResponse), output: &RevokeOAuth2TokenWithIAMOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/auth.go index c98762629..5c7caf6d7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/auth.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/auth.go @@ -130,6 +130,12 @@ var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyaut {SchemeID: smithyauth.SchemeIDAnonymous}, } }, + + "CreateOAuth2TokenWithTokenExchange": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, } func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/common_serde.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/common_serde.go new file mode 100644 index 000000000..024f56183 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/common_serde.go @@ -0,0 +1,243 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signin + +import ( + "github.com/aws/aws-sdk-go-v2/service/signin/types" + smithy "github.com/aws/smithy-go" +) + +func serializeConditionValues(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializePermissionStatementSummaries(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.PermissionStatementSummary) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializePolicyActions(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializePolicyStatements(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.PolicyStatement) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func deserializeConditionValues(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero string + *v = append(*v, zero) + return nil + } + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePermissionStatementSummaries(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.PermissionStatementSummary) error { + *v = make([]types.PermissionStatementSummary, 0) + var vv types.PermissionStatementSummary + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero types.PermissionStatementSummary + *v = append(*v, zero) + return nil + } + + vv = types.PermissionStatementSummary{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePolicyActions(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero string + *v = append(*v, zero) + return nil + } + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePolicyStatements(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.PolicyStatement) error { + *v = make([]types.PolicyStatement, 0) + var vv types.PolicyStatement + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero types.PolicyStatement + *v = append(*v, zero) + return nil + } + + vv = types.PolicyStatement{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func serializeCondition(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string][]string) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeConditionValues(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeConditionBlock(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]map[string][]string) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeCondition(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializePrincipal(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]string) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteString(schema.MapValue(), string(vv)) + } + s.CloseMap() +} + +func deserializeCondition(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string][]string) error { + *v = make(map[string][]string) + var vv []string + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero []string + (*v)[k] = zero + return nil + } + + vv = nil + if err := deserializeConditionValues(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeConditionBlock(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]map[string][]string) error { + *v = make(map[string]map[string][]string) + var vv map[string][]string + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero map[string][]string + (*v)[k] = zero + return nil + } + + vv = nil + if err := deserializeCondition(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializePrincipal(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]string) error { + *v = make(map[string]string) + var vv string + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero string + (*v)[k] = zero + return nil + } + + if err := d.ReadString(s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/deserializers.go deleted file mode 100644 index cc6b07d95..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/deserializers.go +++ /dev/null @@ -1,3085 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package signin - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" - "github.com/aws/aws-sdk-go-v2/service/signin/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" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "strings" -) - -type awsRestjson1_deserializeOpCreateOAuth2Token struct { -} - -func (*awsRestjson1_deserializeOpCreateOAuth2Token) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateOAuth2Token) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateOAuth2Token(response, &metadata) - } - output := &CreateOAuth2TokenOutput{} - 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_deserializeDocumentCreateOAuth2TokenResponseBody(&output.TokenOutput, 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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateOAuth2Token(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("TooManyRequestsError", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateOAuth2TokenOutput(v **CreateOAuth2TokenOutput, 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 *CreateOAuth2TokenOutput - if *v == nil { - sv = &CreateOAuth2TokenOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "tokenOutput": - if err := awsRestjson1_deserializeDocumentCreateOAuth2TokenResponseBody(&sv.TokenOutput, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateOAuth2TokenWithIAM struct { -} - -func (*awsRestjson1_deserializeOpCreateOAuth2TokenWithIAM) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateOAuth2TokenWithIAM) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateOAuth2TokenWithIAM(response, &metadata) - } - output := &CreateOAuth2TokenWithIAMOutput{} - 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_deserializeOpDocumentCreateOAuth2TokenWithIAMOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateOAuth2TokenWithIAM(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("TooManyRequestsError", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateOAuth2TokenWithIAMOutput(v **CreateOAuth2TokenWithIAMOutput, 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 *CreateOAuth2TokenWithIAMOutput - if *v == nil { - sv = &CreateOAuth2TokenWithIAMOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "access_token": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OAuthAccessToken to be of type string, got %T instead", value) - } - sv.AccessToken = ptr.String(jtv) - } - - case "expires_in": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected TokenExpiresIn to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ExpiresIn = ptr.Int32(int32(i64)) - } - - case "token_type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BearerTokenType to be of type string, got %T instead", value) - } - sv.TokenType = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDeleteConsoleAuthorizationConfiguration struct { -} - -func (*awsRestjson1_deserializeOpDeleteConsoleAuthorizationConfiguration) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteConsoleAuthorizationConfiguration) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteConsoleAuthorizationConfiguration(response, &metadata) - } - output := &DeleteConsoleAuthorizationConfigurationOutput{} - 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_deserializeOpDocumentDeleteConsoleAuthorizationConfigurationOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteConsoleAuthorizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsError", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDeleteConsoleAuthorizationConfigurationOutput(v **DeleteConsoleAuthorizationConfigurationOutput, 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 *DeleteConsoleAuthorizationConfigurationOutput - if *v == nil { - sv = &DeleteConsoleAuthorizationConfigurationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "consoleAuthorizationEnabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.ConsoleAuthorizationEnabled = ptr.Bool(jtv) - } - - case "scope": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Scope = ptr.String(jtv) - } - - case "targetId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TargetId to be of type string, got %T instead", value) - } - sv.TargetId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDeleteResourcePermissionStatement struct { -} - -func (*awsRestjson1_deserializeOpDeleteResourcePermissionStatement) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteResourcePermissionStatement) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteResourcePermissionStatement(response, &metadata) - } - output := &DeleteResourcePermissionStatementOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteResourcePermissionStatement(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsError", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpGetConsoleAuthorizationConfiguration struct { -} - -func (*awsRestjson1_deserializeOpGetConsoleAuthorizationConfiguration) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpGetConsoleAuthorizationConfiguration) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetConsoleAuthorizationConfiguration(response, &metadata) - } - output := &GetConsoleAuthorizationConfigurationOutput{} - 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_deserializeOpDocumentGetConsoleAuthorizationConfigurationOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorGetConsoleAuthorizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsError", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentGetConsoleAuthorizationConfigurationOutput(v **GetConsoleAuthorizationConfigurationOutput, 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 *GetConsoleAuthorizationConfigurationOutput - if *v == nil { - sv = &GetConsoleAuthorizationConfigurationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "consoleAuthorizationEnabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.ConsoleAuthorizationEnabled = ptr.Bool(jtv) - } - - case "scope": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Scope = ptr.String(jtv) - } - - case "targetId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TargetId to be of type string, got %T instead", value) - } - sv.TargetId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetResourcePolicy struct { -} - -func (*awsRestjson1_deserializeOpGetResourcePolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpGetResourcePolicy) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetResourcePolicy(response, &metadata) - } - output := &GetResourcePolicyOutput{} - 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_deserializeOpDocumentGetResourcePolicyOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsError", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentGetResourcePolicyOutput(v **GetResourcePolicyOutput, 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 *GetResourcePolicyOutput - if *v == nil { - sv = &GetResourcePolicyOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "signinResourceBasedPolicy": - if err := awsRestjson1_deserializeDocumentSigninResourceBasedPolicy(&sv.SigninResourceBasedPolicy, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpIntrospectOAuth2TokenWithIAM struct { -} - -func (*awsRestjson1_deserializeOpIntrospectOAuth2TokenWithIAM) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpIntrospectOAuth2TokenWithIAM) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorIntrospectOAuth2TokenWithIAM(response, &metadata) - } - output := &IntrospectOAuth2TokenWithIAMOutput{} - 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_deserializeOpDocumentIntrospectOAuth2TokenWithIAMOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorIntrospectOAuth2TokenWithIAM(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("TooManyRequestsError", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentIntrospectOAuth2TokenWithIAMOutput(v **IntrospectOAuth2TokenWithIAMOutput, 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 *IntrospectOAuth2TokenWithIAMOutput - if *v == nil { - sv = &IntrospectOAuth2TokenWithIAMOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "account_id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "active": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.Active = ptr.Bool(jtv) - } - - case "aud": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Aud = ptr.String(jtv) - } - - case "client_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.ClientId = ptr.String(jtv) - } - - case "exp": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Long to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Exp = ptr.Int64(i64) - } - - case "iat": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Long to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Iat = ptr.Int64(i64) - } - - case "iss": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Iss = ptr.String(jtv) - } - - case "jti": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Jti = ptr.String(jtv) - } - - case "nbf": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Long to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Nbf = ptr.Int64(i64) - } - - case "resource": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Resource = ptr.String(jtv) - } - - case "signin_session": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.SigninSession = ptr.String(jtv) - } - - case "sub": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Sub = ptr.String(jtv) - } - - case "token_type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected IntrospectedTokenType to be of type string, got %T instead", value) - } - sv.TokenType = ptr.String(jtv) - } - - case "user_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.UserId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListResourcePermissionStatements struct { -} - -func (*awsRestjson1_deserializeOpListResourcePermissionStatements) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListResourcePermissionStatements) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListResourcePermissionStatements(response, &metadata) - } - output := &ListResourcePermissionStatementsOutput{} - 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_deserializeOpDocumentListResourcePermissionStatementsOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListResourcePermissionStatements(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsError", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListResourcePermissionStatementsOutput(v **ListResourcePermissionStatementsOutput, 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 *ListResourcePermissionStatementsOutput - if *v == nil { - sv = &ListResourcePermissionStatementsOutput{} - } 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 "permissionStatements": - if err := awsRestjson1_deserializeDocumentPermissionStatementSummaries(&sv.PermissionStatements, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpPutConsoleAuthorizationConfiguration struct { -} - -func (*awsRestjson1_deserializeOpPutConsoleAuthorizationConfiguration) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpPutConsoleAuthorizationConfiguration) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutConsoleAuthorizationConfiguration(response, &metadata) - } - output := &PutConsoleAuthorizationConfigurationOutput{} - 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_deserializeOpDocumentPutConsoleAuthorizationConfigurationOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorPutConsoleAuthorizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsError", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentPutConsoleAuthorizationConfigurationOutput(v **PutConsoleAuthorizationConfigurationOutput, 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 *PutConsoleAuthorizationConfigurationOutput - if *v == nil { - sv = &PutConsoleAuthorizationConfigurationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "consoleAuthorizationEnabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.ConsoleAuthorizationEnabled = ptr.Bool(jtv) - } - - case "scope": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Scope = ptr.String(jtv) - } - - case "targetId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TargetId to be of type string, got %T instead", value) - } - sv.TargetId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpPutResourcePermissionStatement struct { -} - -func (*awsRestjson1_deserializeOpPutResourcePermissionStatement) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpPutResourcePermissionStatement) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutResourcePermissionStatement(response, &metadata) - } - output := &PutResourcePermissionStatementOutput{} - 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_deserializeOpDocumentPutResourcePermissionStatementOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorPutResourcePermissionStatement(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - - case strings.EqualFold("TooManyRequestsError", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentPutResourcePermissionStatementOutput(v **PutResourcePermissionStatementOutput, 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 *PutResourcePermissionStatementOutput - if *v == nil { - sv = &PutResourcePermissionStatementOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "statementId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected StatementId to be of type string, got %T instead", value) - } - sv.StatementId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpRevokeOAuth2TokenWithIAM struct { -} - -func (*awsRestjson1_deserializeOpRevokeOAuth2TokenWithIAM) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpRevokeOAuth2TokenWithIAM) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRevokeOAuth2TokenWithIAM(response, &metadata) - } - output := &RevokeOAuth2TokenWithIAMOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorRevokeOAuth2TokenWithIAM(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("TooManyRequestsError", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AccessDeniedException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentConflictException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalServerException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_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_deserializeErrorTooManyRequestsError(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyRequestsError{} - 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_deserializeDocumentTooManyRequestsError(&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 "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OAuth2ErrorCode to be of type string, got %T instead", value) - } - sv.Error_ = types.OAuth2ErrorCode(jtv) - } - - case "message", "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_deserializeDocumentAccessToken(v **types.AccessToken, 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.AccessToken - if *v == nil { - sv = &types.AccessToken{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessKeyId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AccessKeyId = ptr.String(jtv) - } - - case "secretAccessKey": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.SecretAccessKey = ptr.String(jtv) - } - - case "sessionToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.SessionToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentCondition(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 - mapVar := parsedVal - if err := awsRestjson1_deserializeDocumentConditionValues(&mapVar, value); err != nil { - return err - } - parsedVal = mapVar - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentConditionBlock(v *map[string]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]map[string][]string - if *v == nil { - mv = map[string]map[string][]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal map[string][]string - mapVar := parsedVal - if err := awsRestjson1_deserializeDocumentCondition(&mapVar, value); err != nil { - return err - } - parsedVal = mapVar - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentConditionValues(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_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 "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OAuth2ErrorCode to be of type string, got %T instead", value) - } - sv.Error_ = types.OAuth2ErrorCode(jtv) - } - - case "message", "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_deserializeDocumentCreateOAuth2TokenResponseBody(v **types.CreateOAuth2TokenResponseBody, 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.CreateOAuth2TokenResponseBody - if *v == nil { - sv = &types.CreateOAuth2TokenResponseBody{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessToken": - if err := awsRestjson1_deserializeDocumentAccessToken(&sv.AccessToken, value); err != nil { - return err - } - - case "expiresIn": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected ExpiresIn to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ExpiresIn = ptr.Int32(int32(i64)) - } - - case "idToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected IdToken to be of type string, got %T instead", value) - } - sv.IdToken = ptr.String(jtv) - } - - case "refreshToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RefreshToken to be of type string, got %T instead", value) - } - sv.RefreshToken = ptr.String(jtv) - } - - case "tokenType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TokenType to be of type string, got %T instead", value) - } - sv.TokenType = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InternalServerException - if *v == nil { - sv = &types.InternalServerException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OAuth2ErrorCode to be of type string, got %T instead", value) - } - sv.Error_ = types.OAuth2ErrorCode(jtv) - } - - case "message", "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_deserializeDocumentPermissionStatementSummaries(v *[]types.PermissionStatementSummary, 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.PermissionStatementSummary - if *v == nil { - cv = []types.PermissionStatementSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.PermissionStatementSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentPermissionStatementSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentPermissionStatementSummary(v **types.PermissionStatementSummary, 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.PermissionStatementSummary - if *v == nil { - sv = &types.PermissionStatementSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "condition": - if err := awsRestjson1_deserializeDocumentConditionBlock(&sv.Condition, value); err != nil { - return err - } - - case "sid": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected StatementId to be of type string, got %T instead", value) - } - sv.Sid = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentPolicyActions(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_deserializeDocumentPolicyStatement(v **types.PolicyStatement, 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.PolicyStatement - if *v == nil { - sv = &types.PolicyStatement{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Action": - if err := awsRestjson1_deserializeDocumentPolicyActions(&sv.Action, value); err != nil { - return err - } - - case "Condition": - if err := awsRestjson1_deserializeDocumentConditionBlock(&sv.Condition, value); err != nil { - return err - } - - case "Effect": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Effect = ptr.String(jtv) - } - - case "Principal": - if err := awsRestjson1_deserializeDocumentPrincipal(&sv.Principal, value); err != nil { - return err - } - - case "Resource": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Resource = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentPolicyStatements(v *[]types.PolicyStatement, 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.PolicyStatement - if *v == nil { - cv = []types.PolicyStatement{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.PolicyStatement - destAddr := &col - if err := awsRestjson1_deserializeDocumentPolicyStatement(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentPrincipal(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_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 "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OAuth2ErrorCode to be of type string, got %T instead", value) - } - sv.Error_ = types.OAuth2ErrorCode(jtv) - } - - case "message", "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 "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OAuth2ErrorCode to be of type string, got %T instead", value) - } - sv.Error_ = types.OAuth2ErrorCode(jtv) - } - - case "message", "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_deserializeDocumentSigninResourceBasedPolicy(v **types.SigninResourceBasedPolicy, 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.SigninResourceBasedPolicy - if *v == nil { - sv = &types.SigninResourceBasedPolicy{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Statement": - if err := awsRestjson1_deserializeDocumentPolicyStatements(&sv.Statement, value); err != nil { - return err - } - - 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 -} - -func awsRestjson1_deserializeDocumentTooManyRequestsError(v **types.TooManyRequestsError, 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.TooManyRequestsError - if *v == nil { - sv = &types.TooManyRequestsError{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OAuth2ErrorCode to be of type string, got %T instead", value) - } - sv.Error_ = types.OAuth2ErrorCode(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ValidationException - if *v == nil { - sv = &types.ValidationException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OAuth2ErrorCode to be of type string, got %T instead", value) - } - sv.Error_ = types.OAuth2ErrorCode(jtv) - } - - case "message", "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/vendor/github.com/aws/aws-sdk-go-v2/service/signin/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/doc.go index dc1a8b62f..a9739af0b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/doc.go @@ -3,7 +3,6 @@ // Package signin provides the API client, operations, and parameter types for AWS // Sign-In Service. // -// AWS Sign-In manages authentication for AWS services. This service provides -// secure authentication flows for accessing AWS resources from the console and -// developer tools. +// AWS Sign-In manages authentication for AWS services. It implements OAuth 2.0, +// providing secure token exchange and refresh capabilities. package signin diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/generated.json index 762cc709c..9afa3252d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/generated.json @@ -10,6 +10,7 @@ "api_client_test.go", "api_op_CreateOAuth2Token.go", "api_op_CreateOAuth2TokenWithIAM.go", + "api_op_CreateOAuth2TokenWithTokenExchange.go", "api_op_DeleteConsoleAuthorizationConfiguration.go", "api_op_DeleteResourcePermissionStatement.go", "api_op_GetConsoleAuthorizationConfiguration.go", @@ -20,7 +21,7 @@ "api_op_PutResourcePermissionStatement.go", "api_op_RevokeOAuth2TokenWithIAM.go", "auth.go", - "deserializers.go", + "common_serde.go", "doc.go", "endpoints.go", "endpoints_config_test.go", @@ -31,9 +32,12 @@ "options.go", "request_snapshot_test.go", "response_snapshot_test.go", - "serializers.go", + "response_snapshot_update_test.go", + "schemas/schemas.go", "snapshot_test.go", "sra_operation_order_test.go", + "type_registry.go", + "types/common_serde.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/go_module_metadata.go index 0a71eb409..64c05eafd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/go_module_metadata.go @@ -3,4 +3,4 @@ package signin // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.10.1" +const goModuleVersion = "1.12.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/options.go index 9b7248ff3..cec363f8b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/options.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/options.go @@ -123,6 +123,8 @@ type Options struct { // Currently does not support per operation call overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode + Protocol smithyhttp.ClientProtocol + // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/schemas/schemas.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/schemas/schemas.go new file mode 100644 index 000000000..ae6284fc7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/schemas/schemas.go @@ -0,0 +1,1009 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package schemas + +import ( + smithy "github.com/aws/smithy-go" + smithyprelude "github.com/aws/smithy-go/prelude" + smithytraits "github.com/aws/smithy-go/traits" +) + +var CreateOAuth2Token = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CreateOAuth2Token", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/v1/token", + Code: 200}) + +var CreateOAuth2TokenWithIAM = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CreateOAuth2TokenWithIAM", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/v1/token?x-amz-client-auth-method=iam", + Code: 200}) + +var CreateOAuth2TokenWithTokenExchange = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CreateOAuth2TokenWithTokenExchange", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/v1/token?x-amz-oauth-token-method=token-exchange", + Code: 200}) + +var DeleteConsoleAuthorizationConfiguration = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "DeleteConsoleAuthorizationConfiguration", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/delete-console-authorization-configuration", + Code: 200}) + +var DeleteResourcePermissionStatement = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "DeleteResourcePermissionStatement", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/delete-resource-permission-statement", + Code: 200}) + +var GetConsoleAuthorizationConfiguration = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "GetConsoleAuthorizationConfiguration", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/get-console-authorization-configuration", + Code: 200}) + +var GetResourcePolicy = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "GetResourcePolicy", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/get-resource-policy", + Code: 200}) + +var IntrospectOAuth2TokenWithIAM = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "IntrospectOAuth2TokenWithIAM", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/v1/introspect?x-amz-client-auth-method=iam", + Code: 200}) + +var ListResourcePermissionStatements = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ListResourcePermissionStatements", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/list-resource-permission-statements", + Code: 200}) + +var PutConsoleAuthorizationConfiguration = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "PutConsoleAuthorizationConfiguration", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/put-console-authorization-configuration", + Code: 200}) + +var PutResourcePermissionStatement = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "PutResourcePermissionStatement", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/put-resource-permission-statement", + Code: 200}) + +var RevokeOAuth2TokenWithIAM = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "RevokeOAuth2TokenWithIAM", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/v1/revoke?x-amz-client-auth-method=iam", + Code: 200}) + +var _Signin = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "Signin", +}, smithy.ShapeTypeService, 0) + +var Signin = smithy.NewServiceSchema(_Signin, "2023-01-01") + +var AccessDeniedException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "AccessDeniedException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}) +var AccessDeniedException_error *smithy.Schema + +var AccessDeniedException_message *smithy.Schema + +var AccessToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "AccessToken", +}, smithy.ShapeTypeStructure, 3, &smithytraits.Sensitive{}) +var AccessToken_accessKeyId *smithy.Schema + +var AccessToken_secretAccessKey *smithy.Schema + +var AccessToken_sessionToken *smithy.Schema + +var _AccountId = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "AccountId", +}, smithy.ShapeTypeString, 0) + +var _AuthorizationCode = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "AuthorizationCode", +}, smithy.ShapeTypeString, 0) + +var _BearerTokenType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "BearerTokenType", +}, smithy.ShapeTypeString, 0) + +var _ClientCredentialsGrantType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ClientCredentialsGrantType", +}, smithy.ShapeTypeString, 0) + +var _ClientId = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ClientId", +}, smithy.ShapeTypeString, 0) + +var _ClientToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ClientToken", +}, smithy.ShapeTypeString, 0) + +var _CodeVerifier = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CodeVerifier", +}, smithy.ShapeTypeString, 0) + +var _Condition = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "Condition", +}, smithy.ShapeTypeMap, 2) +var _Condition_key *smithy.Schema + +var _Condition_value *smithy.Schema + +var _ConditionBlock = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ConditionBlock", +}, smithy.ShapeTypeMap, 2) +var _ConditionBlock_key *smithy.Schema + +var _ConditionBlock_value *smithy.Schema + +var _ConditionType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ConditionType", +}, smithy.ShapeTypeString, 0) + +var _ConditionValues = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ConditionValues", +}, smithy.ShapeTypeList, 1) +var _ConditionValues_member *smithy.Schema + +var ConflictException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ConflictException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 409}) +var ConflictException_error *smithy.Schema + +var ConflictException_message *smithy.Schema + +var _ConsolePermissionMaxResults = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ConsolePermissionMaxResults", +}, smithy.ShapeTypeInteger, 0) + +var CreateOAuth2TokenRequestBody = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CreateOAuth2TokenRequestBody", +}, smithy.ShapeTypeStructure, 6) +var CreateOAuth2TokenRequestBody_clientId *smithy.Schema + +var CreateOAuth2TokenRequestBody_grantType *smithy.Schema + +var CreateOAuth2TokenRequestBody_code *smithy.Schema + +var CreateOAuth2TokenRequestBody_redirectUri *smithy.Schema + +var CreateOAuth2TokenRequestBody_codeVerifier *smithy.Schema + +var CreateOAuth2TokenRequestBody_refreshToken *smithy.Schema + +var CreateOAuth2TokenResponseBody = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CreateOAuth2TokenResponseBody", +}, smithy.ShapeTypeStructure, 5) +var CreateOAuth2TokenResponseBody_accessToken *smithy.Schema + +var CreateOAuth2TokenResponseBody_tokenType *smithy.Schema + +var CreateOAuth2TokenResponseBody_expiresIn *smithy.Schema + +var CreateOAuth2TokenResponseBody_refreshToken *smithy.Schema + +var CreateOAuth2TokenResponseBody_idToken *smithy.Schema + +var _ExcludedPrincipal = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ExcludedPrincipal", +}, smithy.ShapeTypeString, 0) + +var _ExpiresIn = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ExpiresIn", +}, smithy.ShapeTypeInteger, 0) + +var _GrantType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "GrantType", +}, smithy.ShapeTypeString, 0) + +var _IdToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "IdToken", +}, smithy.ShapeTypeString, 0) + +var InternalServerException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "InternalServerException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "server"}, + &smithytraits.HTTPError{Code: 500}) +var InternalServerException_error *smithy.Schema + +var InternalServerException_message *smithy.Schema + +var _IntrospectedTokenType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "IntrospectedTokenType", +}, smithy.ShapeTypeString, 0) + +var _IntrospectionToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "IntrospectionToken", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var InvalidGrantException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "InvalidGrantException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var InvalidGrantException_error *smithy.Schema + +var InvalidGrantException_message *smithy.Schema + +var InvalidScopeException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "InvalidScopeException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var InvalidScopeException_error *smithy.Schema + +var InvalidScopeException_message *smithy.Schema + +var _IssuedOAuthAccessTokenType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "IssuedOAuthAccessTokenType", +}, smithy.ShapeTypeString, 0) + +var _NextToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "NextToken", +}, smithy.ShapeTypeString, 0) + +var OAuth2ErrorCode = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "OAuth2ErrorCode", +}, smithy.ShapeTypeEnum, 16) +var OAuth2ErrorCode_TOKEN_EXPIRED *smithy.Schema + +var OAuth2ErrorCode_USER_CREDENTIALS_CHANGED *smithy.Schema + +var OAuth2ErrorCode_INSUFFICIENT_PERMISSIONS *smithy.Schema + +var OAuth2ErrorCode_AUTHCODE_EXPIRED *smithy.Schema + +var OAuth2ErrorCode_SERVER_ERROR *smithy.Schema + +var OAuth2ErrorCode_INVALID_REQUEST *smithy.Schema + +var OAuth2ErrorCode_RESOURCE_NOT_FOUND *smithy.Schema + +var OAuth2ErrorCode_CONFLICT *smithy.Schema + +var OAuth2ErrorCode_SERVICE_QUOTA_EXCEEDED *smithy.Schema + +var OAuth2ErrorCode_OAUTH_UNSUPPORTED_GRANT_TYPE *smithy.Schema + +var OAuth2ErrorCode_OAUTH_INVALID_REQUEST *smithy.Schema + +var OAuth2ErrorCode_OAUTH_INVALID_GRANT *smithy.Schema + +var OAuth2ErrorCode_OAUTH_INVALID_SCOPE *smithy.Schema + +var OAuth2ErrorCode_OAUTH_INVALID_TARGET *smithy.Schema + +var OAuth2ErrorCode_OAUTH_RATE_EXCEEDED *smithy.Schema + +var OAuth2ErrorCode_OAUTH_SERVICE_UNAVAILABLE *smithy.Schema + +var _OAuthAccessToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "OAuthAccessToken", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _PermissionStatementSummaries = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "PermissionStatementSummaries", +}, smithy.ShapeTypeList, 1) +var _PermissionStatementSummaries_member *smithy.Schema + +var PermissionStatementSummary = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "PermissionStatementSummary", +}, smithy.ShapeTypeStructure, 2) +var PermissionStatementSummary_sid *smithy.Schema + +var PermissionStatementSummary_condition *smithy.Schema + +var _PolicyActions = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "PolicyActions", +}, smithy.ShapeTypeList, 1) +var _PolicyActions_member *smithy.Schema + +var PolicyStatement = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "PolicyStatement", +}, smithy.ShapeTypeStructure, 5) +var PolicyStatement_effect *smithy.Schema + +var PolicyStatement_principal *smithy.Schema + +var PolicyStatement_action *smithy.Schema + +var PolicyStatement_resource *smithy.Schema + +var PolicyStatement_condition *smithy.Schema + +var _PolicyStatements = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "PolicyStatements", +}, smithy.ShapeTypeList, 1) +var _PolicyStatements_member *smithy.Schema + +var _Principal = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "Principal", +}, smithy.ShapeTypeMap, 2) +var _Principal_key *smithy.Schema + +var _Principal_value *smithy.Schema + +var _RedirectUri = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "RedirectUri", +}, smithy.ShapeTypeString, 0) + +var _RefreshToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "RefreshToken", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _RequestedRegion = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "RequestedRegion", +}, smithy.ShapeTypeString, 0) + +var _Resource = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "Resource", +}, smithy.ShapeTypeString, 0) + +var ResourceNotFoundException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ResourceNotFoundException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 404}) +var ResourceNotFoundException_error *smithy.Schema + +var ResourceNotFoundException_message *smithy.Schema + +var _RevocationToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "RevocationToken", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _Scope = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "Scope", +}, smithy.ShapeTypeString, 0) + +var ServiceQuotaExceededException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ServiceQuotaExceededException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 402}) +var ServiceQuotaExceededException_error *smithy.Schema + +var ServiceQuotaExceededException_message *smithy.Schema + +var ServiceUnavailableException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ServiceUnavailableException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "server"}, + &smithytraits.HTTPError{Code: 503}) +var ServiceUnavailableException_error *smithy.Schema + +var ServiceUnavailableException_message *smithy.Schema + +var SigninResourceBasedPolicy = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "SigninResourceBasedPolicy", +}, smithy.ShapeTypeStructure, 2) +var SigninResourceBasedPolicy_version *smithy.Schema + +var SigninResourceBasedPolicy_statement *smithy.Schema + +var _SourceIp = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "SourceIp", +}, smithy.ShapeTypeString, 0) + +var _SourceVpc = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "SourceVpc", +}, smithy.ShapeTypeString, 0) + +var _SourceVpce = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "SourceVpce", +}, smithy.ShapeTypeString, 0) + +var _StatementId = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "StatementId", +}, smithy.ShapeTypeString, 0) + +var _SubjectToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "SubjectToken", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _SubjectTokenType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "SubjectTokenType", +}, smithy.ShapeTypeString, 0) + +var _TargetId = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "TargetId", +}, smithy.ShapeTypeString, 0) + +var _TokenExchangeGrantType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "TokenExchangeGrantType", +}, smithy.ShapeTypeString, 0) + +var _TokenExpiresIn = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "TokenExpiresIn", +}, smithy.ShapeTypeInteger, 0) + +var _TokenType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "TokenType", +}, smithy.ShapeTypeString, 0) + +var _TokenTypeHint = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "TokenTypeHint", +}, smithy.ShapeTypeString, 0) + +var TooManyRequestsError = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "TooManyRequestsError", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 429}) +var TooManyRequestsError_error *smithy.Schema + +var TooManyRequestsError_message *smithy.Schema + +var ValidationException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ValidationException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var ValidationException_error *smithy.Schema + +var ValidationException_message *smithy.Schema + +var _VpcSourceIp = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "VpcSourceIp", +}, smithy.ShapeTypeString, 0) + +var CreateOAuth2TokenRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CreateOAuth2TokenRequest", +}, smithy.ShapeTypeStructure, 1) +var CreateOAuth2TokenRequest_tokenInput *smithy.Schema + +var CreateOAuth2TokenResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CreateOAuth2TokenResponse", +}, smithy.ShapeTypeStructure, 1) +var CreateOAuth2TokenResponse_tokenOutput *smithy.Schema + +var CreateOAuth2TokenWithIAMRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CreateOAuth2TokenWithIAMRequest", +}, smithy.ShapeTypeStructure, 2) +var CreateOAuth2TokenWithIAMRequest_grantType *smithy.Schema + +var CreateOAuth2TokenWithIAMRequest_resource *smithy.Schema + +var CreateOAuth2TokenWithIAMResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CreateOAuth2TokenWithIAMResponse", +}, smithy.ShapeTypeStructure, 3) +var CreateOAuth2TokenWithIAMResponse_accessToken *smithy.Schema + +var CreateOAuth2TokenWithIAMResponse_tokenType *smithy.Schema + +var CreateOAuth2TokenWithIAMResponse_expiresIn *smithy.Schema + +var CreateOAuth2TokenWithTokenExchangeRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CreateOAuth2TokenWithTokenExchangeRequest", +}, smithy.ShapeTypeStructure, 5) +var CreateOAuth2TokenWithTokenExchangeRequest_grantType *smithy.Schema + +var CreateOAuth2TokenWithTokenExchangeRequest_subjectToken *smithy.Schema + +var CreateOAuth2TokenWithTokenExchangeRequest_subjectTokenType *smithy.Schema + +var CreateOAuth2TokenWithTokenExchangeRequest_resource *smithy.Schema + +var CreateOAuth2TokenWithTokenExchangeRequest_scope *smithy.Schema + +var CreateOAuth2TokenWithTokenExchangeResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "CreateOAuth2TokenWithTokenExchangeResponse", +}, smithy.ShapeTypeStructure, 4) +var CreateOAuth2TokenWithTokenExchangeResponse_accessToken *smithy.Schema + +var CreateOAuth2TokenWithTokenExchangeResponse_issuedTokenType *smithy.Schema + +var CreateOAuth2TokenWithTokenExchangeResponse_tokenType *smithy.Schema + +var CreateOAuth2TokenWithTokenExchangeResponse_expiresIn *smithy.Schema + +var DeleteConsoleAuthorizationConfigurationInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "DeleteConsoleAuthorizationConfigurationInput", +}, smithy.ShapeTypeStructure, 1) +var DeleteConsoleAuthorizationConfigurationInput_targetId *smithy.Schema + +var DeleteConsoleAuthorizationConfigurationOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "DeleteConsoleAuthorizationConfigurationOutput", +}, smithy.ShapeTypeStructure, 3) +var DeleteConsoleAuthorizationConfigurationOutput_targetId *smithy.Schema + +var DeleteConsoleAuthorizationConfigurationOutput_scope *smithy.Schema + +var DeleteConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled *smithy.Schema + +var DeleteResourcePermissionStatementInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "DeleteResourcePermissionStatementInput", +}, smithy.ShapeTypeStructure, 2) +var DeleteResourcePermissionStatementInput_statementId *smithy.Schema + +var DeleteResourcePermissionStatementInput_clientToken *smithy.Schema + +var DeleteResourcePermissionStatementOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "DeleteResourcePermissionStatementOutput", +}, smithy.ShapeTypeStructure, 0) + +var GetConsoleAuthorizationConfigurationInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "GetConsoleAuthorizationConfigurationInput", +}, smithy.ShapeTypeStructure, 1) +var GetConsoleAuthorizationConfigurationInput_targetId *smithy.Schema + +var GetConsoleAuthorizationConfigurationOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "GetConsoleAuthorizationConfigurationOutput", +}, smithy.ShapeTypeStructure, 3) +var GetConsoleAuthorizationConfigurationOutput_targetId *smithy.Schema + +var GetConsoleAuthorizationConfigurationOutput_scope *smithy.Schema + +var GetConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled *smithy.Schema + +var GetResourcePolicyInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "GetResourcePolicyInput", +}, smithy.ShapeTypeStructure, 0) + +var GetResourcePolicyOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "GetResourcePolicyOutput", +}, smithy.ShapeTypeStructure, 1) +var GetResourcePolicyOutput_signinResourceBasedPolicy *smithy.Schema + +var IntrospectOAuth2TokenWithIAMRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "IntrospectOAuth2TokenWithIAMRequest", +}, smithy.ShapeTypeStructure, 2) +var IntrospectOAuth2TokenWithIAMRequest_token *smithy.Schema + +var IntrospectOAuth2TokenWithIAMRequest_tokenTypeHint *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "IntrospectOAuth2TokenWithIAMResponse", +}, smithy.ShapeTypeStructure, 14) +var IntrospectOAuth2TokenWithIAMResponse_active *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_clientId *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_userId *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_tokenType *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_exp *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_iat *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_nbf *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_sub *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_aud *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_iss *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_jti *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_accountId *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_signinSession *smithy.Schema + +var IntrospectOAuth2TokenWithIAMResponse_resource *smithy.Schema + +var ListResourcePermissionStatementsInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ListResourcePermissionStatementsInput", +}, smithy.ShapeTypeStructure, 2) +var ListResourcePermissionStatementsInput_maxResults *smithy.Schema + +var ListResourcePermissionStatementsInput_nextToken *smithy.Schema + +var ListResourcePermissionStatementsOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "ListResourcePermissionStatementsOutput", +}, smithy.ShapeTypeStructure, 2) +var ListResourcePermissionStatementsOutput_permissionStatements *smithy.Schema + +var ListResourcePermissionStatementsOutput_nextToken *smithy.Schema + +var PutConsoleAuthorizationConfigurationInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "PutConsoleAuthorizationConfigurationInput", +}, smithy.ShapeTypeStructure, 1) +var PutConsoleAuthorizationConfigurationInput_targetId *smithy.Schema + +var PutConsoleAuthorizationConfigurationOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "PutConsoleAuthorizationConfigurationOutput", +}, smithy.ShapeTypeStructure, 3) +var PutConsoleAuthorizationConfigurationOutput_targetId *smithy.Schema + +var PutConsoleAuthorizationConfigurationOutput_scope *smithy.Schema + +var PutConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled *smithy.Schema + +var PutResourcePermissionStatementInput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "PutResourcePermissionStatementInput", +}, smithy.ShapeTypeStructure, 8) +var PutResourcePermissionStatementInput_sourceVpc *smithy.Schema + +var PutResourcePermissionStatementInput_signinSourceVpce *smithy.Schema + +var PutResourcePermissionStatementInput_consoleSourceVpce *smithy.Schema + +var PutResourcePermissionStatementInput_vpcSourceIp *smithy.Schema + +var PutResourcePermissionStatementInput_sourceIp *smithy.Schema + +var PutResourcePermissionStatementInput_requestedRegion *smithy.Schema + +var PutResourcePermissionStatementInput_excludedPrincipal *smithy.Schema + +var PutResourcePermissionStatementInput_clientToken *smithy.Schema + +var PutResourcePermissionStatementOutput = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "PutResourcePermissionStatementOutput", +}, smithy.ShapeTypeStructure, 1) +var PutResourcePermissionStatementOutput_statementId *smithy.Schema + +var RevokeOAuth2TokenWithIAMRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "RevokeOAuth2TokenWithIAMRequest", +}, smithy.ShapeTypeStructure, 1) +var RevokeOAuth2TokenWithIAMRequest_token *smithy.Schema + +var RevokeOAuth2TokenWithIAMResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.signin", + Name: "RevokeOAuth2TokenWithIAMResponse", +}, smithy.ShapeTypeStructure, 0) + +// Initialize schema members after all schemas are declared to avoid +// initialization cycles +func init() { + OAuth2ErrorCode_TOKEN_EXPIRED = OAuth2ErrorCode.AddMember("TOKEN_EXPIRED", smithyprelude.Unit) + + OAuth2ErrorCode_USER_CREDENTIALS_CHANGED = OAuth2ErrorCode.AddMember("USER_CREDENTIALS_CHANGED", smithyprelude.Unit) + + OAuth2ErrorCode_INSUFFICIENT_PERMISSIONS = OAuth2ErrorCode.AddMember("INSUFFICIENT_PERMISSIONS", smithyprelude.Unit) + + OAuth2ErrorCode_AUTHCODE_EXPIRED = OAuth2ErrorCode.AddMember("AUTHCODE_EXPIRED", smithyprelude.Unit) + + OAuth2ErrorCode_SERVER_ERROR = OAuth2ErrorCode.AddMember("SERVER_ERROR", smithyprelude.Unit) + + OAuth2ErrorCode_INVALID_REQUEST = OAuth2ErrorCode.AddMember("INVALID_REQUEST", smithyprelude.Unit) + + OAuth2ErrorCode_RESOURCE_NOT_FOUND = OAuth2ErrorCode.AddMember("RESOURCE_NOT_FOUND", smithyprelude.Unit) + + OAuth2ErrorCode_CONFLICT = OAuth2ErrorCode.AddMember("CONFLICT", smithyprelude.Unit) + + OAuth2ErrorCode_SERVICE_QUOTA_EXCEEDED = OAuth2ErrorCode.AddMember("SERVICE_QUOTA_EXCEEDED", smithyprelude.Unit) + + OAuth2ErrorCode_OAUTH_UNSUPPORTED_GRANT_TYPE = OAuth2ErrorCode.AddMember("OAUTH_UNSUPPORTED_GRANT_TYPE", smithyprelude.Unit) + + OAuth2ErrorCode_OAUTH_INVALID_REQUEST = OAuth2ErrorCode.AddMember("OAUTH_INVALID_REQUEST", smithyprelude.Unit) + + OAuth2ErrorCode_OAUTH_INVALID_GRANT = OAuth2ErrorCode.AddMember("OAUTH_INVALID_GRANT", smithyprelude.Unit) + + OAuth2ErrorCode_OAUTH_INVALID_SCOPE = OAuth2ErrorCode.AddMember("OAUTH_INVALID_SCOPE", smithyprelude.Unit) + + OAuth2ErrorCode_OAUTH_INVALID_TARGET = OAuth2ErrorCode.AddMember("OAUTH_INVALID_TARGET", smithyprelude.Unit) + + OAuth2ErrorCode_OAUTH_RATE_EXCEEDED = OAuth2ErrorCode.AddMember("OAUTH_RATE_EXCEEDED", smithyprelude.Unit) + + OAuth2ErrorCode_OAUTH_SERVICE_UNAVAILABLE = OAuth2ErrorCode.AddMember("OAUTH_SERVICE_UNAVAILABLE", smithyprelude.Unit) + + AccessDeniedException_error = AccessDeniedException.AddMember("error", OAuth2ErrorCode) + + AccessDeniedException_message = AccessDeniedException.AddMember("message", smithyprelude.String) + + AccessToken_accessKeyId = AccessToken.AddMember("accessKeyId", smithyprelude.String, &smithytraits.JSONName{Name: "accessKeyId"}) + + AccessToken_secretAccessKey = AccessToken.AddMember("secretAccessKey", smithyprelude.String, &smithytraits.JSONName{Name: "secretAccessKey"}) + + AccessToken_sessionToken = AccessToken.AddMember("sessionToken", smithyprelude.String, &smithytraits.JSONName{Name: "sessionToken"}) + + _ConditionValues_member = _ConditionValues.AddMember("member", smithyprelude.String) + + _Condition_key = _Condition.AddMember("key", smithyprelude.String) + + _Condition_value = _Condition.AddMember("value", _ConditionValues) + + _ConditionBlock_key = _ConditionBlock.AddMember("key", _ConditionType) + + _ConditionBlock_value = _ConditionBlock.AddMember("value", _Condition) + + ConflictException_error = ConflictException.AddMember("error", OAuth2ErrorCode) + + ConflictException_message = ConflictException.AddMember("message", smithyprelude.String) + + CreateOAuth2TokenRequestBody_clientId = CreateOAuth2TokenRequestBody.AddMember("clientId", _ClientId, &smithytraits.JSONName{Name: "clientId"}) + + CreateOAuth2TokenRequestBody_grantType = CreateOAuth2TokenRequestBody.AddMember("grantType", _GrantType, &smithytraits.JSONName{Name: "grantType"}) + + CreateOAuth2TokenRequestBody_code = CreateOAuth2TokenRequestBody.AddMember("code", _AuthorizationCode) + + CreateOAuth2TokenRequestBody_redirectUri = CreateOAuth2TokenRequestBody.AddMember("redirectUri", _RedirectUri, &smithytraits.JSONName{Name: "redirectUri"}) + + CreateOAuth2TokenRequestBody_codeVerifier = CreateOAuth2TokenRequestBody.AddMember("codeVerifier", _CodeVerifier, &smithytraits.JSONName{Name: "codeVerifier"}) + + CreateOAuth2TokenRequestBody_refreshToken = CreateOAuth2TokenRequestBody.AddMember("refreshToken", _RefreshToken, &smithytraits.JSONName{Name: "refreshToken"}) + + CreateOAuth2TokenResponseBody_accessToken = CreateOAuth2TokenResponseBody.AddMember("accessToken", AccessToken, &smithytraits.JSONName{Name: "accessToken"}) + + CreateOAuth2TokenResponseBody_tokenType = CreateOAuth2TokenResponseBody.AddMember("tokenType", _TokenType, &smithytraits.JSONName{Name: "tokenType"}) + + CreateOAuth2TokenResponseBody_expiresIn = CreateOAuth2TokenResponseBody.AddMember("expiresIn", _ExpiresIn, &smithytraits.JSONName{Name: "expiresIn"}) + + CreateOAuth2TokenResponseBody_refreshToken = CreateOAuth2TokenResponseBody.AddMember("refreshToken", _RefreshToken, &smithytraits.JSONName{Name: "refreshToken"}) + + CreateOAuth2TokenResponseBody_idToken = CreateOAuth2TokenResponseBody.AddMember("idToken", _IdToken, &smithytraits.JSONName{Name: "idToken"}) + + InternalServerException_error = InternalServerException.AddMember("error", OAuth2ErrorCode) + + InternalServerException_message = InternalServerException.AddMember("message", smithyprelude.String) + + InvalidGrantException_error = InvalidGrantException.AddMember("error", OAuth2ErrorCode) + + InvalidGrantException_message = InvalidGrantException.AddMember("message", smithyprelude.String) + + InvalidScopeException_error = InvalidScopeException.AddMember("error", OAuth2ErrorCode) + + InvalidScopeException_message = InvalidScopeException.AddMember("message", smithyprelude.String) + + PermissionStatementSummary_sid = PermissionStatementSummary.AddMember("sid", _StatementId) + + PermissionStatementSummary_condition = PermissionStatementSummary.AddMember("condition", _ConditionBlock) + + _PermissionStatementSummaries_member = _PermissionStatementSummaries.AddMember("member", PermissionStatementSummary) + + _PolicyActions_member = _PolicyActions.AddMember("member", smithyprelude.String) + + _Principal_key = _Principal.AddMember("key", smithyprelude.String) + + _Principal_value = _Principal.AddMember("value", smithyprelude.String) + + PolicyStatement_effect = PolicyStatement.AddMember("effect", smithyprelude.String, &smithytraits.JSONName{Name: "Effect"}) + + PolicyStatement_principal = PolicyStatement.AddMember("principal", _Principal, &smithytraits.JSONName{Name: "Principal"}) + + PolicyStatement_action = PolicyStatement.AddMember("action", _PolicyActions, &smithytraits.JSONName{Name: "Action"}) + + PolicyStatement_resource = PolicyStatement.AddMember("resource", smithyprelude.String, &smithytraits.JSONName{Name: "Resource"}) + + PolicyStatement_condition = PolicyStatement.AddMember("condition", _ConditionBlock, &smithytraits.JSONName{Name: "Condition"}) + + _PolicyStatements_member = _PolicyStatements.AddMember("member", PolicyStatement) + + ResourceNotFoundException_error = ResourceNotFoundException.AddMember("error", OAuth2ErrorCode) + + ResourceNotFoundException_message = ResourceNotFoundException.AddMember("message", smithyprelude.String) + + ServiceQuotaExceededException_error = ServiceQuotaExceededException.AddMember("error", OAuth2ErrorCode) + + ServiceQuotaExceededException_message = ServiceQuotaExceededException.AddMember("message", smithyprelude.String) + + ServiceUnavailableException_error = ServiceUnavailableException.AddMember("error", OAuth2ErrorCode) + + ServiceUnavailableException_message = ServiceUnavailableException.AddMember("message", smithyprelude.String) + + SigninResourceBasedPolicy_version = SigninResourceBasedPolicy.AddMember("version", smithyprelude.String, &smithytraits.JSONName{Name: "Version"}) + + SigninResourceBasedPolicy_statement = SigninResourceBasedPolicy.AddMember("statement", _PolicyStatements, &smithytraits.JSONName{Name: "Statement"}) + + TooManyRequestsError_error = TooManyRequestsError.AddMember("error", OAuth2ErrorCode) + + TooManyRequestsError_message = TooManyRequestsError.AddMember("message", smithyprelude.String) + + ValidationException_error = ValidationException.AddMember("error", OAuth2ErrorCode) + + ValidationException_message = ValidationException.AddMember("message", smithyprelude.String) + + CreateOAuth2TokenRequest_tokenInput = CreateOAuth2TokenRequest.AddMember("tokenInput", CreateOAuth2TokenRequestBody, &smithytraits.HTTPPayload{}) + + CreateOAuth2TokenResponse_tokenOutput = CreateOAuth2TokenResponse.AddMember("tokenOutput", CreateOAuth2TokenResponseBody, &smithytraits.HTTPPayload{}) + + CreateOAuth2TokenWithIAMRequest_grantType = CreateOAuth2TokenWithIAMRequest.AddMember("grantType", _ClientCredentialsGrantType, &smithytraits.JSONName{Name: "grant_type"}) + + CreateOAuth2TokenWithIAMRequest_resource = CreateOAuth2TokenWithIAMRequest.AddMember("resource", _Resource) + + CreateOAuth2TokenWithIAMResponse_accessToken = CreateOAuth2TokenWithIAMResponse.AddMember("accessToken", _OAuthAccessToken, &smithytraits.JSONName{Name: "access_token"}) + + CreateOAuth2TokenWithIAMResponse_tokenType = CreateOAuth2TokenWithIAMResponse.AddMember("tokenType", _BearerTokenType, &smithytraits.JSONName{Name: "token_type"}) + + CreateOAuth2TokenWithIAMResponse_expiresIn = CreateOAuth2TokenWithIAMResponse.AddMember("expiresIn", _TokenExpiresIn, &smithytraits.JSONName{Name: "expires_in"}) + + CreateOAuth2TokenWithTokenExchangeRequest_grantType = CreateOAuth2TokenWithTokenExchangeRequest.AddMember("grantType", _TokenExchangeGrantType, &smithytraits.JSONName{Name: "grant_type"}) + + CreateOAuth2TokenWithTokenExchangeRequest_subjectToken = CreateOAuth2TokenWithTokenExchangeRequest.AddMember("subjectToken", _SubjectToken, &smithytraits.JSONName{Name: "subject_token"}) + + CreateOAuth2TokenWithTokenExchangeRequest_subjectTokenType = CreateOAuth2TokenWithTokenExchangeRequest.AddMember("subjectTokenType", _SubjectTokenType, &smithytraits.JSONName{Name: "subject_token_type"}) + + CreateOAuth2TokenWithTokenExchangeRequest_resource = CreateOAuth2TokenWithTokenExchangeRequest.AddMember("resource", _Resource) + + CreateOAuth2TokenWithTokenExchangeRequest_scope = CreateOAuth2TokenWithTokenExchangeRequest.AddMember("scope", _Scope) + + CreateOAuth2TokenWithTokenExchangeResponse_accessToken = CreateOAuth2TokenWithTokenExchangeResponse.AddMember("accessToken", _OAuthAccessToken, &smithytraits.JSONName{Name: "access_token"}) + + CreateOAuth2TokenWithTokenExchangeResponse_issuedTokenType = CreateOAuth2TokenWithTokenExchangeResponse.AddMember("issuedTokenType", _IssuedOAuthAccessTokenType, &smithytraits.JSONName{Name: "issued_token_type"}) + + CreateOAuth2TokenWithTokenExchangeResponse_tokenType = CreateOAuth2TokenWithTokenExchangeResponse.AddMember("tokenType", _BearerTokenType, &smithytraits.JSONName{Name: "token_type"}) + + CreateOAuth2TokenWithTokenExchangeResponse_expiresIn = CreateOAuth2TokenWithTokenExchangeResponse.AddMember("expiresIn", _TokenExpiresIn, &smithytraits.JSONName{Name: "expires_in"}) + + DeleteConsoleAuthorizationConfigurationInput_targetId = DeleteConsoleAuthorizationConfigurationInput.AddMember("targetId", _TargetId) + + DeleteConsoleAuthorizationConfigurationOutput_targetId = DeleteConsoleAuthorizationConfigurationOutput.AddMember("targetId", _TargetId) + + DeleteConsoleAuthorizationConfigurationOutput_scope = DeleteConsoleAuthorizationConfigurationOutput.AddMember("scope", smithyprelude.String) + + DeleteConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled = DeleteConsoleAuthorizationConfigurationOutput.AddMember("consoleAuthorizationEnabled", smithyprelude.Boolean) + + DeleteResourcePermissionStatementInput_statementId = DeleteResourcePermissionStatementInput.AddMember("statementId", _StatementId) + + DeleteResourcePermissionStatementInput_clientToken = DeleteResourcePermissionStatementInput.AddMember("clientToken", _ClientToken) + + GetConsoleAuthorizationConfigurationInput_targetId = GetConsoleAuthorizationConfigurationInput.AddMember("targetId", _TargetId) + + GetConsoleAuthorizationConfigurationOutput_targetId = GetConsoleAuthorizationConfigurationOutput.AddMember("targetId", _TargetId) + + GetConsoleAuthorizationConfigurationOutput_scope = GetConsoleAuthorizationConfigurationOutput.AddMember("scope", smithyprelude.String) + + GetConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled = GetConsoleAuthorizationConfigurationOutput.AddMember("consoleAuthorizationEnabled", smithyprelude.Boolean) + + GetResourcePolicyOutput_signinResourceBasedPolicy = GetResourcePolicyOutput.AddMember("signinResourceBasedPolicy", SigninResourceBasedPolicy) + + IntrospectOAuth2TokenWithIAMRequest_token = IntrospectOAuth2TokenWithIAMRequest.AddMember("token", _IntrospectionToken, &smithytraits.JSONName{Name: "token"}) + + IntrospectOAuth2TokenWithIAMRequest_tokenTypeHint = IntrospectOAuth2TokenWithIAMRequest.AddMember("tokenTypeHint", _TokenTypeHint, &smithytraits.JSONName{Name: "token_type_hint"}) + + IntrospectOAuth2TokenWithIAMResponse_active = IntrospectOAuth2TokenWithIAMResponse.AddMember("active", smithyprelude.Boolean) + + IntrospectOAuth2TokenWithIAMResponse_clientId = IntrospectOAuth2TokenWithIAMResponse.AddMember("clientId", smithyprelude.String, &smithytraits.JSONName{Name: "client_id"}) + + IntrospectOAuth2TokenWithIAMResponse_userId = IntrospectOAuth2TokenWithIAMResponse.AddMember("userId", smithyprelude.String, &smithytraits.JSONName{Name: "user_id"}) + + IntrospectOAuth2TokenWithIAMResponse_tokenType = IntrospectOAuth2TokenWithIAMResponse.AddMember("tokenType", _IntrospectedTokenType, &smithytraits.JSONName{Name: "token_type"}) + + IntrospectOAuth2TokenWithIAMResponse_exp = IntrospectOAuth2TokenWithIAMResponse.AddMember("exp", smithyprelude.Long, &smithytraits.JSONName{Name: "exp"}) + + IntrospectOAuth2TokenWithIAMResponse_iat = IntrospectOAuth2TokenWithIAMResponse.AddMember("iat", smithyprelude.Long, &smithytraits.JSONName{Name: "iat"}) + + IntrospectOAuth2TokenWithIAMResponse_nbf = IntrospectOAuth2TokenWithIAMResponse.AddMember("nbf", smithyprelude.Long, &smithytraits.JSONName{Name: "nbf"}) + + IntrospectOAuth2TokenWithIAMResponse_sub = IntrospectOAuth2TokenWithIAMResponse.AddMember("sub", smithyprelude.String, &smithytraits.JSONName{Name: "sub"}) + + IntrospectOAuth2TokenWithIAMResponse_aud = IntrospectOAuth2TokenWithIAMResponse.AddMember("aud", smithyprelude.String, &smithytraits.JSONName{Name: "aud"}) + + IntrospectOAuth2TokenWithIAMResponse_iss = IntrospectOAuth2TokenWithIAMResponse.AddMember("iss", smithyprelude.String, &smithytraits.JSONName{Name: "iss"}) + + IntrospectOAuth2TokenWithIAMResponse_jti = IntrospectOAuth2TokenWithIAMResponse.AddMember("jti", smithyprelude.String, &smithytraits.JSONName{Name: "jti"}) + + IntrospectOAuth2TokenWithIAMResponse_accountId = IntrospectOAuth2TokenWithIAMResponse.AddMember("accountId", _AccountId, &smithytraits.JSONName{Name: "account_id"}) + + IntrospectOAuth2TokenWithIAMResponse_signinSession = IntrospectOAuth2TokenWithIAMResponse.AddMember("signinSession", smithyprelude.String, &smithytraits.JSONName{Name: "signin_session"}) + + IntrospectOAuth2TokenWithIAMResponse_resource = IntrospectOAuth2TokenWithIAMResponse.AddMember("resource", _Resource, &smithytraits.JSONName{Name: "resource"}) + + ListResourcePermissionStatementsInput_maxResults = ListResourcePermissionStatementsInput.AddMember("maxResults", _ConsolePermissionMaxResults) + + ListResourcePermissionStatementsInput_nextToken = ListResourcePermissionStatementsInput.AddMember("nextToken", _NextToken) + + ListResourcePermissionStatementsOutput_permissionStatements = ListResourcePermissionStatementsOutput.AddMember("permissionStatements", _PermissionStatementSummaries) + + ListResourcePermissionStatementsOutput_nextToken = ListResourcePermissionStatementsOutput.AddMember("nextToken", _NextToken) + + PutConsoleAuthorizationConfigurationInput_targetId = PutConsoleAuthorizationConfigurationInput.AddMember("targetId", _TargetId) + + PutConsoleAuthorizationConfigurationOutput_targetId = PutConsoleAuthorizationConfigurationOutput.AddMember("targetId", _TargetId) + + PutConsoleAuthorizationConfigurationOutput_scope = PutConsoleAuthorizationConfigurationOutput.AddMember("scope", smithyprelude.String) + + PutConsoleAuthorizationConfigurationOutput_consoleAuthorizationEnabled = PutConsoleAuthorizationConfigurationOutput.AddMember("consoleAuthorizationEnabled", smithyprelude.Boolean) + + PutResourcePermissionStatementInput_sourceVpc = PutResourcePermissionStatementInput.AddMember("sourceVpc", _SourceVpc) + + PutResourcePermissionStatementInput_signinSourceVpce = PutResourcePermissionStatementInput.AddMember("signinSourceVpce", _SourceVpce) + + PutResourcePermissionStatementInput_consoleSourceVpce = PutResourcePermissionStatementInput.AddMember("consoleSourceVpce", _SourceVpce) + + PutResourcePermissionStatementInput_vpcSourceIp = PutResourcePermissionStatementInput.AddMember("vpcSourceIp", _VpcSourceIp) + + PutResourcePermissionStatementInput_sourceIp = PutResourcePermissionStatementInput.AddMember("sourceIp", _SourceIp) + + PutResourcePermissionStatementInput_requestedRegion = PutResourcePermissionStatementInput.AddMember("requestedRegion", _RequestedRegion) + + PutResourcePermissionStatementInput_excludedPrincipal = PutResourcePermissionStatementInput.AddMember("excludedPrincipal", _ExcludedPrincipal) + + PutResourcePermissionStatementInput_clientToken = PutResourcePermissionStatementInput.AddMember("clientToken", _ClientToken) + + PutResourcePermissionStatementOutput_statementId = PutResourcePermissionStatementOutput.AddMember("statementId", _StatementId) + + RevokeOAuth2TokenWithIAMRequest_token = RevokeOAuth2TokenWithIAMRequest.AddMember("token", _RevocationToken, &smithytraits.JSONName{Name: "token"}) + +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/serializers.go deleted file mode 100644 index d245732cc..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/serializers.go +++ /dev/null @@ -1,977 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package signin - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/signin/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" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -type awsRestjson1_serializeOpCreateOAuth2Token struct { -} - -func (*awsRestjson1_serializeOpCreateOAuth2Token) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateOAuth2Token) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*CreateOAuth2TokenInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/v1/token") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if !restEncoder.HasHeader("Content-Type") { - ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) - restEncoder.SetHeader("Content-Type").String("application/json") - } - - if input.TokenInput != nil { - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeDocumentCreateOAuth2TokenRequestBody(input.TokenInput, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - payload := bytes.NewReader(jsonEncoder.Bytes()) - if request, err = request.SetStream(payload); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - } else { - jsonEncoder := smithyjson.NewEncoder() - jsonEncoder.Value.Object().Close() - payload := bytes.NewReader(jsonEncoder.Bytes()) - if request, err = request.SetStream(payload); 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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateOAuth2TokenInput(v *CreateOAuth2TokenInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -type awsRestjson1_serializeOpCreateOAuth2TokenWithIAM struct { -} - -func (*awsRestjson1_serializeOpCreateOAuth2TokenWithIAM) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateOAuth2TokenWithIAM) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*CreateOAuth2TokenWithIAMInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/v1/token?x-amz-client-auth-method=iam") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateOAuth2TokenWithIAMInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateOAuth2TokenWithIAMInput(v *CreateOAuth2TokenWithIAMInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateOAuth2TokenWithIAMInput(v *CreateOAuth2TokenWithIAMInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.GrantType != nil { - ok := object.Key("grant_type") - ok.String(*v.GrantType) - } - - if v.Resource != nil { - ok := object.Key("resource") - ok.String(*v.Resource) - } - - return nil -} - -type awsRestjson1_serializeOpDeleteConsoleAuthorizationConfiguration struct { -} - -func (*awsRestjson1_serializeOpDeleteConsoleAuthorizationConfiguration) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteConsoleAuthorizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*DeleteConsoleAuthorizationConfigurationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/delete-console-authorization-configuration") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDeleteConsoleAuthorizationConfigurationInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteConsoleAuthorizationConfigurationInput(v *DeleteConsoleAuthorizationConfigurationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentDeleteConsoleAuthorizationConfigurationInput(v *DeleteConsoleAuthorizationConfigurationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.TargetId != nil { - ok := object.Key("targetId") - ok.String(*v.TargetId) - } - - return nil -} - -type awsRestjson1_serializeOpDeleteResourcePermissionStatement struct { -} - -func (*awsRestjson1_serializeOpDeleteResourcePermissionStatement) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteResourcePermissionStatement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*DeleteResourcePermissionStatementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/delete-resource-permission-statement") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDeleteResourcePermissionStatementInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteResourcePermissionStatementInput(v *DeleteResourcePermissionStatementInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentDeleteResourcePermissionStatementInput(v *DeleteResourcePermissionStatementInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientToken != nil { - ok := object.Key("clientToken") - ok.String(*v.ClientToken) - } - - if v.StatementId != nil { - ok := object.Key("statementId") - ok.String(*v.StatementId) - } - - return nil -} - -type awsRestjson1_serializeOpGetConsoleAuthorizationConfiguration struct { -} - -func (*awsRestjson1_serializeOpGetConsoleAuthorizationConfiguration) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpGetConsoleAuthorizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*GetConsoleAuthorizationConfigurationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/get-console-authorization-configuration") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentGetConsoleAuthorizationConfigurationInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsGetConsoleAuthorizationConfigurationInput(v *GetConsoleAuthorizationConfigurationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentGetConsoleAuthorizationConfigurationInput(v *GetConsoleAuthorizationConfigurationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.TargetId != nil { - ok := object.Key("targetId") - ok.String(*v.TargetId) - } - - return nil -} - -type awsRestjson1_serializeOpGetResourcePolicy struct { -} - -func (*awsRestjson1_serializeOpGetResourcePolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpGetResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*GetResourcePolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/get-resource-policy") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsGetResourcePolicyInput(v *GetResourcePolicyInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -type awsRestjson1_serializeOpIntrospectOAuth2TokenWithIAM struct { -} - -func (*awsRestjson1_serializeOpIntrospectOAuth2TokenWithIAM) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpIntrospectOAuth2TokenWithIAM) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*IntrospectOAuth2TokenWithIAMInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/v1/introspect?x-amz-client-auth-method=iam") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentIntrospectOAuth2TokenWithIAMInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsIntrospectOAuth2TokenWithIAMInput(v *IntrospectOAuth2TokenWithIAMInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentIntrospectOAuth2TokenWithIAMInput(v *IntrospectOAuth2TokenWithIAMInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Token != nil { - ok := object.Key("token") - ok.String(*v.Token) - } - - if v.TokenTypeHint != nil { - ok := object.Key("token_type_hint") - ok.String(*v.TokenTypeHint) - } - - return nil -} - -type awsRestjson1_serializeOpListResourcePermissionStatements struct { -} - -func (*awsRestjson1_serializeOpListResourcePermissionStatements) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListResourcePermissionStatements) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*ListResourcePermissionStatementsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/list-resource-permission-statements") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListResourcePermissionStatementsInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListResourcePermissionStatementsInput(v *ListResourcePermissionStatementsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentListResourcePermissionStatementsInput(v *ListResourcePermissionStatementsInput, 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_serializeOpPutConsoleAuthorizationConfiguration struct { -} - -func (*awsRestjson1_serializeOpPutConsoleAuthorizationConfiguration) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpPutConsoleAuthorizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*PutConsoleAuthorizationConfigurationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/put-console-authorization-configuration") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentPutConsoleAuthorizationConfigurationInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsPutConsoleAuthorizationConfigurationInput(v *PutConsoleAuthorizationConfigurationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentPutConsoleAuthorizationConfigurationInput(v *PutConsoleAuthorizationConfigurationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.TargetId != nil { - ok := object.Key("targetId") - ok.String(*v.TargetId) - } - - return nil -} - -type awsRestjson1_serializeOpPutResourcePermissionStatement struct { -} - -func (*awsRestjson1_serializeOpPutResourcePermissionStatement) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpPutResourcePermissionStatement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*PutResourcePermissionStatementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/put-resource-permission-statement") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentPutResourcePermissionStatementInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsPutResourcePermissionStatementInput(v *PutResourcePermissionStatementInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentPutResourcePermissionStatementInput(v *PutResourcePermissionStatementInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientToken != nil { - ok := object.Key("clientToken") - ok.String(*v.ClientToken) - } - - if v.ConsoleSourceVpce != nil { - ok := object.Key("consoleSourceVpce") - ok.String(*v.ConsoleSourceVpce) - } - - if v.ExcludedPrincipal != nil { - ok := object.Key("excludedPrincipal") - ok.String(*v.ExcludedPrincipal) - } - - if v.RequestedRegion != nil { - ok := object.Key("requestedRegion") - ok.String(*v.RequestedRegion) - } - - if v.SigninSourceVpce != nil { - ok := object.Key("signinSourceVpce") - ok.String(*v.SigninSourceVpce) - } - - if v.SourceIp != nil { - ok := object.Key("sourceIp") - ok.String(*v.SourceIp) - } - - if v.SourceVpc != nil { - ok := object.Key("sourceVpc") - ok.String(*v.SourceVpc) - } - - if v.VpcSourceIp != nil { - ok := object.Key("vpcSourceIp") - ok.String(*v.VpcSourceIp) - } - - return nil -} - -type awsRestjson1_serializeOpRevokeOAuth2TokenWithIAM struct { -} - -func (*awsRestjson1_serializeOpRevokeOAuth2TokenWithIAM) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpRevokeOAuth2TokenWithIAM) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*RevokeOAuth2TokenWithIAMInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/v1/revoke?x-amz-client-auth-method=iam") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentRevokeOAuth2TokenWithIAMInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsRevokeOAuth2TokenWithIAMInput(v *RevokeOAuth2TokenWithIAMInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentRevokeOAuth2TokenWithIAMInput(v *RevokeOAuth2TokenWithIAMInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Token != nil { - ok := object.Key("token") - ok.String(*v.Token) - } - - return nil -} - -func awsRestjson1_serializeDocumentCreateOAuth2TokenRequestBody(v *types.CreateOAuth2TokenRequestBody, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientId != nil { - ok := object.Key("clientId") - ok.String(*v.ClientId) - } - - if v.Code != nil { - ok := object.Key("code") - ok.String(*v.Code) - } - - if v.CodeVerifier != nil { - ok := object.Key("codeVerifier") - ok.String(*v.CodeVerifier) - } - - if v.GrantType != nil { - ok := object.Key("grantType") - ok.String(*v.GrantType) - } - - if v.RedirectUri != nil { - ok := object.Key("redirectUri") - ok.String(*v.RedirectUri) - } - - if v.RefreshToken != nil { - ok := object.Key("refreshToken") - ok.String(*v.RefreshToken) - } - - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/type_registry.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/type_registry.go new file mode 100644 index 000000000..eb77e8f9f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/type_registry.go @@ -0,0 +1,55 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signin + +import ( + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" + "github.com/aws/aws-sdk-go-v2/service/signin/types" + smithy "github.com/aws/smithy-go" +) + +// TypeRegistry is the type registry for this service. +var TypeRegistry = &smithy.TypeRegistry{ + Entries: map[string]*smithy.TypeRegistryEntry{ + "com.amazonaws.signin#AccessDeniedException": { + Schema: schemas.AccessDeniedException, + New: func() any { return &types.AccessDeniedException{} }, + }, + "com.amazonaws.signin#ConflictException": { + Schema: schemas.ConflictException, + New: func() any { return &types.ConflictException{} }, + }, + "com.amazonaws.signin#InternalServerException": { + Schema: schemas.InternalServerException, + New: func() any { return &types.InternalServerException{} }, + }, + "com.amazonaws.signin#InvalidGrantException": { + Schema: schemas.InvalidGrantException, + New: func() any { return &types.InvalidGrantException{} }, + }, + "com.amazonaws.signin#InvalidScopeException": { + Schema: schemas.InvalidScopeException, + New: func() any { return &types.InvalidScopeException{} }, + }, + "com.amazonaws.signin#ResourceNotFoundException": { + Schema: schemas.ResourceNotFoundException, + New: func() any { return &types.ResourceNotFoundException{} }, + }, + "com.amazonaws.signin#ServiceQuotaExceededException": { + Schema: schemas.ServiceQuotaExceededException, + New: func() any { return &types.ServiceQuotaExceededException{} }, + }, + "com.amazonaws.signin#ServiceUnavailableException": { + Schema: schemas.ServiceUnavailableException, + New: func() any { return &types.ServiceUnavailableException{} }, + }, + "com.amazonaws.signin#TooManyRequestsError": { + Schema: schemas.TooManyRequestsError, + New: func() any { return &types.TooManyRequestsError{} }, + }, + "com.amazonaws.signin#ValidationException": { + Schema: schemas.ValidationException, + New: func() any { return &types.ValidationException{} }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/common_serde.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/common_serde.go new file mode 100644 index 000000000..2a9045f41 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/common_serde.go @@ -0,0 +1,242 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithy "github.com/aws/smithy-go" +) + +func serializeConditionValues(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializePermissionStatementSummaries(s smithy.ShapeSerializer, schema *smithy.Schema, v []PermissionStatementSummary) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializePolicyActions(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializePolicyStatements(s smithy.ShapeSerializer, schema *smithy.Schema, v []PolicyStatement) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func deserializeConditionValues(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero string + *v = append(*v, zero) + return nil + } + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePermissionStatementSummaries(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]PermissionStatementSummary) error { + *v = make([]PermissionStatementSummary, 0) + var vv PermissionStatementSummary + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero PermissionStatementSummary + *v = append(*v, zero) + return nil + } + + vv = PermissionStatementSummary{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePolicyActions(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero string + *v = append(*v, zero) + return nil + } + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializePolicyStatements(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]PolicyStatement) error { + *v = make([]PolicyStatement, 0) + var vv PolicyStatement + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero PolicyStatement + *v = append(*v, zero) + return nil + } + + vv = PolicyStatement{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func serializeCondition(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string][]string) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeConditionValues(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializeConditionBlock(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]map[string][]string) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + serializeCondition(s, schema.MapValue(), vv) + } + s.CloseMap() +} + +func serializePrincipal(s smithy.ShapeSerializer, schema *smithy.Schema, v map[string]string) { + if v == nil { + return + } + s.WriteMap(schema) + for k, vv := range v { + s.WriteKey(schema.MapKey(), k) + s.WriteString(schema.MapValue(), string(vv)) + } + s.CloseMap() +} + +func deserializeCondition(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string][]string) error { + *v = make(map[string][]string) + var vv []string + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero []string + (*v)[k] = zero + return nil + } + + vv = nil + if err := deserializeConditionValues(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializeConditionBlock(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]map[string][]string) error { + *v = make(map[string]map[string][]string) + var vv map[string][]string + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero map[string][]string + (*v)[k] = zero + return nil + } + + vv = nil + if err := deserializeCondition(d, s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} + +func deserializePrincipal(d smithy.ShapeDeserializer, s *smithy.Schema, v *map[string]string) error { + *v = make(map[string]string) + var vv string + return smithy.ReadMap(d, s, func(k string) error { + if isNil, err := d.ReadNil(s.MapValue()); err != nil { + return err + } else if isNil { + var zero string + (*v)[k] = zero + return nil + } + + if err := d.ReadString(s.MapValue(), &vv); err != nil { + return err + } + + (*v)[k] = vv + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/enums.go index 2ab46c8f2..afac805d8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/enums.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/enums.go @@ -6,25 +6,32 @@ type OAuth2ErrorCode string // Enum values for OAuth2ErrorCode const ( - // Token has expired and needs to be refreshed + // Token has expired. OAuth2ErrorCodeTokenExpired OAuth2ErrorCode = "TOKEN_EXPIRED" - // User credentials have been changed + // User credentials have been changed. OAuth2ErrorCodeUserCredentialsChanged OAuth2ErrorCode = "USER_CREDENTIALS_CHANGED" - // Insufficient permissions to perform this operation + // Insufficient permissions to perform this operation. OAuth2ErrorCodeInsufficientPermissions OAuth2ErrorCode = "INSUFFICIENT_PERMISSIONS" - // Authorization code has expired + // Authorization code has expired. OAuth2ErrorCodeAuthcodeExpired OAuth2ErrorCode = "AUTHCODE_EXPIRED" - // Internal server error occurred + // Internal server error occurred. OAuth2ErrorCodeServerError OAuth2ErrorCode = "server_error" // The request is missing a required parameter, includes an invalid parameter - // value, or is otherwise malformed + // value, or is otherwise malformed. OAuth2ErrorCodeInvalidRequest OAuth2ErrorCode = "INVALID_REQUEST" - // Requested resource was not found + // Requested resource was not found. OAuth2ErrorCodeResourceNotFound OAuth2ErrorCode = "RESOURCE_NOT_FOUND" - // Request conflicts with current state of the resource + // Request conflicts with the current state of the resource. OAuth2ErrorCodeConflict OAuth2ErrorCode = "CONFLICT" - // Request would cause a service quota to be exceeded - OAuth2ErrorCodeServiceQuotaExceeded OAuth2ErrorCode = "SERVICE_QUOTA_EXCEEDED" + // Request would cause a service quota to be exceeded. + OAuth2ErrorCodeServiceQuotaExceeded OAuth2ErrorCode = "SERVICE_QUOTA_EXCEEDED" + OAuth2ErrorCodeOauthUnsupportedGrantType OAuth2ErrorCode = "unsupported_grant_type" + OAuth2ErrorCodeOauthInvalidRequest OAuth2ErrorCode = "invalid_request" + OAuth2ErrorCodeOauthInvalidGrant OAuth2ErrorCode = "invalid_grant" + OAuth2ErrorCodeOauthInvalidScope OAuth2ErrorCode = "invalid_scope" + OAuth2ErrorCodeOauthInvalidTarget OAuth2ErrorCode = "invalid_target" + OAuth2ErrorCodeOauthRateExceeded OAuth2ErrorCode = "rate_exceeded" + OAuth2ErrorCodeOauthServiceUnavailable OAuth2ErrorCode = "service_unavailable" ) // Values returns all known values for OAuth2ErrorCode. Note that this can be @@ -42,5 +49,12 @@ func (OAuth2ErrorCode) Values() []OAuth2ErrorCode { "RESOURCE_NOT_FOUND", "CONFLICT", "SERVICE_QUOTA_EXCEEDED", + "unsupported_grant_type", + "invalid_request", + "invalid_grant", + "invalid_scope", + "invalid_target", + "rate_exceeded", + "service_unavailable", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/errors.go index 56e1019b0..72eb6c9a4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/errors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/errors.go @@ -4,19 +4,11 @@ package types import ( "fmt" + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" smithy "github.com/aws/smithy-go" ) -// Error thrown for access denied scenarios with flexible HTTP status mapping -// -// Runtime HTTP Status Code Mapping: -// -// - HTTP 401 (Unauthorized): TOKEN_EXPIRED, AUTHCODE_EXPIRED -// - HTTP 403 (Forbidden): USER_CREDENTIALS_CHANGED, INSUFFICIENT_PERMISSIONS -// -// The specific HTTP status code is determined at runtime based on the error enum -// value. Consumers should use the error field to determine the specific access -// denial reason. +// You do not have sufficient access to perform this action. type AccessDeniedException struct { Message *string @@ -43,6 +35,37 @@ func (e *AccessDeniedException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *AccessDeniedException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AccessDeniedException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AccessDeniedException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != "" { + s.WriteString(schemas.AccessDeniedException_error, string(v.Error_)) + } + if v.Message != nil { + s.WriteString(schemas.AccessDeniedException_message, *v.Message) + } +} +func (v *AccessDeniedException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AccessDeniedException, func(s *smithy.Schema) error { + switch s { + case schemas.AccessDeniedException_error: + var ev string + if err := d.ReadString(schemas.AccessDeniedException_error, &ev); err != nil { + return err + } + v.Error_ = OAuth2ErrorCode(ev) + return nil + case schemas.AccessDeniedException_message: + v.Message = new(string) + return d.ReadString(schemas.AccessDeniedException_message, v.Message) + } + return nil + }) +} // Error thrown when request conflicts with current state // @@ -75,12 +98,39 @@ func (e *ConflictException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ConflictException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ConflictException) + v.SerializeMembers(s) + s.CloseStruct() +} -// Error thrown when an internal server error occurs -// -// HTTP Status Code: 500 Internal Server Error -// -// Used for unexpected server-side errors that prevent request processing. +func (v *ConflictException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != "" { + s.WriteString(schemas.ConflictException_error, string(v.Error_)) + } + if v.Message != nil { + s.WriteString(schemas.ConflictException_message, *v.Message) + } +} +func (v *ConflictException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ConflictException, func(s *smithy.Schema) error { + switch s { + case schemas.ConflictException_error: + var ev string + if err := d.ReadString(schemas.ConflictException_error, &ev); err != nil { + return err + } + v.Error_ = OAuth2ErrorCode(ev) + return nil + case schemas.ConflictException_message: + v.Message = new(string) + return d.ReadString(schemas.ConflictException_message, v.Message) + } + return nil + }) +} + +// The request failed because of an internal server error. type InternalServerException struct { Message *string @@ -107,6 +157,156 @@ func (e *InternalServerException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +func (v *InternalServerException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InternalServerException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InternalServerException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != "" { + s.WriteString(schemas.InternalServerException_error, string(v.Error_)) + } + if v.Message != nil { + s.WriteString(schemas.InternalServerException_message, *v.Message) + } +} +func (v *InternalServerException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InternalServerException, func(s *smithy.Schema) error { + switch s { + case schemas.InternalServerException_error: + var ev string + if err := d.ReadString(schemas.InternalServerException_error, &ev); err != nil { + return err + } + v.Error_ = OAuth2ErrorCode(ev) + return nil + case schemas.InternalServerException_message: + v.Message = new(string) + return d.ReadString(schemas.InternalServerException_message, v.Message) + } + return nil + }) +} + +// The request failed because the provided grant is invalid or expired. +type InvalidGrantException struct { + Message *string + + ErrorCodeOverride *string + + Error_ OAuth2ErrorCode + + noSmithyDocumentSerde +} + +func (e *InvalidGrantException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidGrantException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidGrantException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidGrantException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidGrantException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidGrantException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidGrantException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidGrantException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != "" { + s.WriteString(schemas.InvalidGrantException_error, string(v.Error_)) + } + if v.Message != nil { + s.WriteString(schemas.InvalidGrantException_message, *v.Message) + } +} +func (v *InvalidGrantException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidGrantException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidGrantException_error: + var ev string + if err := d.ReadString(schemas.InvalidGrantException_error, &ev); err != nil { + return err + } + v.Error_ = OAuth2ErrorCode(ev) + return nil + case schemas.InvalidGrantException_message: + v.Message = new(string) + return d.ReadString(schemas.InvalidGrantException_message, v.Message) + } + return nil + }) +} + +// The request failed because the requested scope is invalid or exceeds the scope +// that can be granted. +type InvalidScopeException struct { + Message *string + + ErrorCodeOverride *string + + Error_ OAuth2ErrorCode + + noSmithyDocumentSerde +} + +func (e *InvalidScopeException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidScopeException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidScopeException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidScopeException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidScopeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidScopeException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidScopeException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidScopeException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != "" { + s.WriteString(schemas.InvalidScopeException_error, string(v.Error_)) + } + if v.Message != nil { + s.WriteString(schemas.InvalidScopeException_message, *v.Message) + } +} +func (v *InvalidScopeException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidScopeException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidScopeException_error: + var ev string + if err := d.ReadString(schemas.InvalidScopeException_error, &ev); err != nil { + return err + } + v.Error_ = OAuth2ErrorCode(ev) + return nil + case schemas.InvalidScopeException_message: + v.Message = new(string) + return d.ReadString(schemas.InvalidScopeException_message, v.Message) + } + return nil + }) +} // Error thrown when requested resource is not found // @@ -139,6 +339,37 @@ func (e *ResourceNotFoundException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ResourceNotFoundException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ResourceNotFoundException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ResourceNotFoundException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != "" { + s.WriteString(schemas.ResourceNotFoundException_error, string(v.Error_)) + } + if v.Message != nil { + s.WriteString(schemas.ResourceNotFoundException_message, *v.Message) + } +} +func (v *ResourceNotFoundException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ResourceNotFoundException, func(s *smithy.Schema) error { + switch s { + case schemas.ResourceNotFoundException_error: + var ev string + if err := d.ReadString(schemas.ResourceNotFoundException_error, &ev); err != nil { + return err + } + v.Error_ = OAuth2ErrorCode(ev) + return nil + case schemas.ResourceNotFoundException_message: + v.Message = new(string) + return d.ReadString(schemas.ResourceNotFoundException_message, v.Message) + } + return nil + }) +} // Error thrown when service quota is exceeded // @@ -171,21 +402,100 @@ func (e *ServiceQuotaExceededException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ServiceQuotaExceededException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ServiceQuotaExceededException) + v.SerializeMembers(s) + s.CloseStruct() +} -// Error thrown when rate limit is exceeded -// -// HTTP Status Code: 429 Too Many Requests -// -// Possible OAuth2ErrorCode values: -// -// - INVALID_REQUEST: Rate limiting, too many requests, abuse prevention -// -// Possible causes: -// -// - Too many token requests from the same client -// - Rate limiting based on client_id or IP address -// - Abuse prevention mechanisms triggered -// - Service protection against excessive token generation +func (v *ServiceQuotaExceededException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != "" { + s.WriteString(schemas.ServiceQuotaExceededException_error, string(v.Error_)) + } + if v.Message != nil { + s.WriteString(schemas.ServiceQuotaExceededException_message, *v.Message) + } +} +func (v *ServiceQuotaExceededException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ServiceQuotaExceededException, func(s *smithy.Schema) error { + switch s { + case schemas.ServiceQuotaExceededException_error: + var ev string + if err := d.ReadString(schemas.ServiceQuotaExceededException_error, &ev); err != nil { + return err + } + v.Error_ = OAuth2ErrorCode(ev) + return nil + case schemas.ServiceQuotaExceededException_message: + v.Message = new(string) + return d.ReadString(schemas.ServiceQuotaExceededException_message, v.Message) + } + return nil + }) +} + +// The request failed because a dependency is temporarily unavailable. You can +// retry the request. +type ServiceUnavailableException struct { + Message *string + + ErrorCodeOverride *string + + Error_ OAuth2ErrorCode + + noSmithyDocumentSerde +} + +func (e *ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceUnavailableException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceUnavailableException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceUnavailableException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +func (v *ServiceUnavailableException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ServiceUnavailableException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ServiceUnavailableException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != "" { + s.WriteString(schemas.ServiceUnavailableException_error, string(v.Error_)) + } + if v.Message != nil { + s.WriteString(schemas.ServiceUnavailableException_message, *v.Message) + } +} +func (v *ServiceUnavailableException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ServiceUnavailableException, func(s *smithy.Schema) error { + switch s { + case schemas.ServiceUnavailableException_error: + var ev string + if err := d.ReadString(schemas.ServiceUnavailableException_error, &ev); err != nil { + return err + } + v.Error_ = OAuth2ErrorCode(ev) + return nil + case schemas.ServiceUnavailableException_message: + v.Message = new(string) + return d.ReadString(schemas.ServiceUnavailableException_message, v.Message) + } + return nil + }) +} + +// The request failed because you exceeded the request rate limit for this +// operation. type TooManyRequestsError struct { Message *string @@ -212,13 +522,40 @@ func (e *TooManyRequestsError) ErrorCode() string { return *e.ErrorCodeOverride } func (e *TooManyRequestsError) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *TooManyRequestsError) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TooManyRequestsError) + v.SerializeMembers(s) + s.CloseStruct() +} -// Error thrown when request validation fails -// -// HTTP Status Code: 400 Bad Request -// -// Used for request validation errors such as malformed parameters, missing -// required fields, or invalid parameter values. +func (v *TooManyRequestsError) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != "" { + s.WriteString(schemas.TooManyRequestsError_error, string(v.Error_)) + } + if v.Message != nil { + s.WriteString(schemas.TooManyRequestsError_message, *v.Message) + } +} +func (v *TooManyRequestsError) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TooManyRequestsError, func(s *smithy.Schema) error { + switch s { + case schemas.TooManyRequestsError_error: + var ev string + if err := d.ReadString(schemas.TooManyRequestsError_error, &ev); err != nil { + return err + } + v.Error_ = OAuth2ErrorCode(ev) + return nil + case schemas.TooManyRequestsError_message: + v.Message = new(string) + return d.ReadString(schemas.TooManyRequestsError_message, v.Message) + } + return nil + }) +} + +// The request failed because it contains a malformed, missing, or invalid +// parameter. type ValidationException struct { Message *string @@ -245,3 +582,34 @@ func (e *ValidationException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ValidationException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ValidationException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ValidationException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != "" { + s.WriteString(schemas.ValidationException_error, string(v.Error_)) + } + if v.Message != nil { + s.WriteString(schemas.ValidationException_message, *v.Message) + } +} +func (v *ValidationException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ValidationException, func(s *smithy.Schema) error { + switch s { + case schemas.ValidationException_error: + var ev string + if err := d.ReadString(schemas.ValidationException_error, &ev); err != nil { + return err + } + v.Error_ = OAuth2ErrorCode(ev) + return nil + case schemas.ValidationException_message: + v.Message = new(string) + return d.ReadString(schemas.ValidationException_message, v.Message) + } + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/types.go index 9e8bab757..2e9497972 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/types.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/types.go @@ -3,25 +3,26 @@ package types import ( + "github.com/aws/aws-sdk-go-v2/service/signin/schemas" + smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" ) -// AWS credentials structure containing temporary access credentials -// -// Scoped, temporary AWS credentials with a 15-minute duration. +// Contains the scoped, temporary AWS credentials used to sign requests with +// SigV4. Valid for 15 minutes. type AccessToken struct { - // AWS access key ID for temporary credentials + // The AWS access key ID for the temporary credentials. // // This member is required. AccessKeyId *string - // AWS secret access key for temporary credentials + // The AWS secret access key used to sign requests. // // This member is required. SecretAccessKey *string - // AWS session token for temporary credentials + // The session token that validates the temporary security credentials. // // This member is required. SessionToken *string @@ -29,87 +30,214 @@ type AccessToken struct { noSmithyDocumentSerde } -// Request body payload for CreateOAuth2Token operation -// -// The operation type is determined by the grant_type parameter: -// -// - grant_type=authorization_code: Requires code, redirect_uri, code_verifier -// - grant_type=refresh_token: Requires refresh_token +func (v *AccessToken) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AccessToken) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AccessToken) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccessKeyId != nil { + s.WriteString(schemas.AccessToken_accessKeyId, *v.AccessKeyId) + } + if v.SecretAccessKey != nil { + s.WriteString(schemas.AccessToken_secretAccessKey, *v.SecretAccessKey) + } + if v.SessionToken != nil { + s.WriteString(schemas.AccessToken_sessionToken, *v.SessionToken) + } +} +func (v *AccessToken) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AccessToken, func(s *smithy.Schema) error { + switch s { + case schemas.AccessToken_accessKeyId: + v.AccessKeyId = new(string) + return d.ReadString(schemas.AccessToken_accessKeyId, v.AccessKeyId) + case schemas.AccessToken_secretAccessKey: + v.SecretAccessKey = new(string) + return d.ReadString(schemas.AccessToken_secretAccessKey, v.SecretAccessKey) + case schemas.AccessToken_sessionToken: + v.SessionToken = new(string) + return d.ReadString(schemas.AccessToken_sessionToken, v.SessionToken) + } + return nil + }) +} + +// The request body for creating an OAuth 2.0 token. Supports both the +// authorization code and refresh token flows, selected by the "grant_type" +// parameter. type CreateOAuth2TokenRequestBody struct { - // The client identifier (ARN) used during Sign-In onboarding Required for both - // authorization code and refresh token flows + // The OAuth 2.0 client identifier. Expected values: + // "arn:aws:signin:::devtools/same-device" or + // "arn:aws:signin:::devtools/cross-device". // // This member is required. ClientId *string - // OAuth 2.0 grant type - determines which flow is used Must be - // "authorization_code" or "refresh_token" + // The OAuth 2.0 grant type. Supported values: + // + // - "authorization_code" - Exchange an authorization code for tokens. + // - "refresh_token" - Use a refresh token to obtain a new access token. // // This member is required. GrantType *string - // The authorization code received from /v1/authorize Required only when - // grant_type=authorization_code + // The authorization code received from the "/v1/authorize" endpoint. Required + // when "grant_type=authorization_code". Code *string - // PKCE code verifier to prove possession of the original code challenge Required - // only when grant_type=authorization_code + // The PKCE code verifier that proves possession of the original code challenge. + // Required when "grant_type=authorization_code". CodeVerifier *string - // The redirect URI that must match the original authorization request Required - // only when grant_type=authorization_code + // The redirect URI that was used in the original authorization request. Must + // match exactly. Required when "grant_type=authorization_code". RedirectUri *string - // The refresh token returned from auth_code redemption Required only when - // grant_type=refresh_token + // The refresh token issued by a previous token response. Required when + // "grant_type=refresh_token". RefreshToken *string noSmithyDocumentSerde } -// Response body payload for CreateOAuth2Token operation -// -// The response content depends on the grant_type from the request: -// -// - grant_type=authorization_code: Returns all fields including refresh_token -// and id_token -// - grant_type=refresh_token: Returns access_token, token_type, expires_in, -// refresh_token (no id_token) +func (v *CreateOAuth2TokenRequestBody) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateOAuth2TokenRequestBody) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateOAuth2TokenRequestBody) SerializeMembers(s smithy.ShapeSerializer) { + if v.ClientId != nil { + s.WriteString(schemas.CreateOAuth2TokenRequestBody_clientId, *v.ClientId) + } + if v.Code != nil { + s.WriteString(schemas.CreateOAuth2TokenRequestBody_code, *v.Code) + } + if v.CodeVerifier != nil { + s.WriteString(schemas.CreateOAuth2TokenRequestBody_codeVerifier, *v.CodeVerifier) + } + if v.GrantType != nil { + s.WriteString(schemas.CreateOAuth2TokenRequestBody_grantType, *v.GrantType) + } + if v.RedirectUri != nil { + s.WriteString(schemas.CreateOAuth2TokenRequestBody_redirectUri, *v.RedirectUri) + } + if v.RefreshToken != nil { + s.WriteString(schemas.CreateOAuth2TokenRequestBody_refreshToken, *v.RefreshToken) + } +} +func (v *CreateOAuth2TokenRequestBody) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateOAuth2TokenRequestBody, func(s *smithy.Schema) error { + switch s { + case schemas.CreateOAuth2TokenRequestBody_clientId: + v.ClientId = new(string) + return d.ReadString(schemas.CreateOAuth2TokenRequestBody_clientId, v.ClientId) + case schemas.CreateOAuth2TokenRequestBody_code: + v.Code = new(string) + return d.ReadString(schemas.CreateOAuth2TokenRequestBody_code, v.Code) + case schemas.CreateOAuth2TokenRequestBody_codeVerifier: + v.CodeVerifier = new(string) + return d.ReadString(schemas.CreateOAuth2TokenRequestBody_codeVerifier, v.CodeVerifier) + case schemas.CreateOAuth2TokenRequestBody_grantType: + v.GrantType = new(string) + return d.ReadString(schemas.CreateOAuth2TokenRequestBody_grantType, v.GrantType) + case schemas.CreateOAuth2TokenRequestBody_redirectUri: + v.RedirectUri = new(string) + return d.ReadString(schemas.CreateOAuth2TokenRequestBody_redirectUri, v.RedirectUri) + case schemas.CreateOAuth2TokenRequestBody_refreshToken: + v.RefreshToken = new(string) + return d.ReadString(schemas.CreateOAuth2TokenRequestBody_refreshToken, v.RefreshToken) + } + return nil + }) +} + +// The response body for an OAuth 2.0 token request. The fields returned depend on +// the "grant_type". The authorization code flow returns "refresh_token" and +// "id_token". The refresh token flow omits "id_token". type CreateOAuth2TokenResponseBody struct { - // Scoped-down AWS credentials (15 minute duration) Present for both authorization - // code redemption and token refresh + // The access token issued by the authorization server. The token contains + // temporary AWS security credentials that you use to sign requests with SigV4. // // This member is required. AccessToken *AccessToken - // Time to expiry in seconds (maximum 900) Present for both authorization code - // redemption and token refresh + // The number of seconds until the access token expires. Maximum value is 900 + // seconds (15 minutes). // // This member is required. ExpiresIn *int32 - // Encrypted refresh token with cnf.jkt (SHA-256 thumbprint of presented jwk) - // Always present in responses (required for both flows) + // A refresh token that can be used to obtain new access tokens without + // re-authenticating. // // This member is required. RefreshToken *string - // Token type indicating this is AWS SigV4 credentials Value is "aws_sigv4" for - // both flows + // The type of token issued. Value is "aws_sigv4". // // This member is required. TokenType *string - // ID token containing user identity information Present only in authorization - // code redemption response (grant_type=authorization_code) Not included in token - // refresh responses + // A JSON Web Token (JWT) containing user identity claims. Present only when + // "grant_type=authorization_code". Not included in refresh token responses. IdToken *string noSmithyDocumentSerde } +func (v *CreateOAuth2TokenResponseBody) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateOAuth2TokenResponseBody) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateOAuth2TokenResponseBody) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccessToken != nil { + s.WriteStruct(schemas.CreateOAuth2TokenResponseBody_accessToken) + v.AccessToken.SerializeMembers(s) + s.CloseStruct() + } + if v.ExpiresIn != nil { + s.WriteInt32(schemas.CreateOAuth2TokenResponseBody_expiresIn, *v.ExpiresIn) + } + if v.IdToken != nil { + s.WriteString(schemas.CreateOAuth2TokenResponseBody_idToken, *v.IdToken) + } + if v.RefreshToken != nil { + s.WriteString(schemas.CreateOAuth2TokenResponseBody_refreshToken, *v.RefreshToken) + } + if v.TokenType != nil { + s.WriteString(schemas.CreateOAuth2TokenResponseBody_tokenType, *v.TokenType) + } +} +func (v *CreateOAuth2TokenResponseBody) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateOAuth2TokenResponseBody, func(s *smithy.Schema) error { + switch s { + case schemas.CreateOAuth2TokenResponseBody_accessToken: + v.AccessToken = &AccessToken{} + return v.AccessToken.Deserialize(d) + case schemas.CreateOAuth2TokenResponseBody_expiresIn: + v.ExpiresIn = new(int32) + return d.ReadInt32(schemas.CreateOAuth2TokenResponseBody_expiresIn, v.ExpiresIn) + case schemas.CreateOAuth2TokenResponseBody_idToken: + v.IdToken = new(string) + return d.ReadString(schemas.CreateOAuth2TokenResponseBody_idToken, v.IdToken) + case schemas.CreateOAuth2TokenResponseBody_refreshToken: + v.RefreshToken = new(string) + return d.ReadString(schemas.CreateOAuth2TokenResponseBody_refreshToken, v.RefreshToken) + case schemas.CreateOAuth2TokenResponseBody_tokenType: + v.TokenType = new(string) + return d.ReadString(schemas.CreateOAuth2TokenResponseBody_tokenType, v.TokenType) + } + return nil + }) +} + // Summary of a permission statement type PermissionStatementSummary struct { @@ -124,6 +252,31 @@ type PermissionStatementSummary struct { noSmithyDocumentSerde } +func (v *PermissionStatementSummary) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PermissionStatementSummary) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PermissionStatementSummary) SerializeMembers(s smithy.ShapeSerializer) { + serializeConditionBlock(s, schemas.PermissionStatementSummary_condition, v.Condition) + if v.Sid != nil { + s.WriteString(schemas.PermissionStatementSummary_sid, *v.Sid) + } +} +func (v *PermissionStatementSummary) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.PermissionStatementSummary, func(s *smithy.Schema) error { + switch s { + case schemas.PermissionStatementSummary_condition: + return deserializeConditionBlock(d, schemas.PermissionStatementSummary_condition, &v.Condition) + case schemas.PermissionStatementSummary_sid: + v.Sid = new(string) + return d.ReadString(schemas.PermissionStatementSummary_sid, v.Sid) + } + return nil + }) +} + // Individual policy statement within a resource-based policy type PolicyStatement struct { @@ -145,6 +298,43 @@ type PolicyStatement struct { noSmithyDocumentSerde } +func (v *PolicyStatement) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.PolicyStatement) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *PolicyStatement) SerializeMembers(s smithy.ShapeSerializer) { + serializePolicyActions(s, schemas.PolicyStatement_action, v.Action) + serializeConditionBlock(s, schemas.PolicyStatement_condition, v.Condition) + if v.Effect != nil { + s.WriteString(schemas.PolicyStatement_effect, *v.Effect) + } + serializePrincipal(s, schemas.PolicyStatement_principal, v.Principal) + if v.Resource != nil { + s.WriteString(schemas.PolicyStatement_resource, *v.Resource) + } +} +func (v *PolicyStatement) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.PolicyStatement, func(s *smithy.Schema) error { + switch s { + case schemas.PolicyStatement_action: + return deserializePolicyActions(d, schemas.PolicyStatement_action, &v.Action) + case schemas.PolicyStatement_condition: + return deserializeConditionBlock(d, schemas.PolicyStatement_condition, &v.Condition) + case schemas.PolicyStatement_effect: + v.Effect = new(string) + return d.ReadString(schemas.PolicyStatement_effect, v.Effect) + case schemas.PolicyStatement_principal: + return deserializePrincipal(d, schemas.PolicyStatement_principal, &v.Principal) + case schemas.PolicyStatement_resource: + v.Resource = new(string) + return d.ReadString(schemas.PolicyStatement_resource, v.Resource) + } + return nil + }) +} + // SignIn resource-based policy document type SigninResourceBasedPolicy struct { @@ -157,4 +347,29 @@ type SigninResourceBasedPolicy struct { noSmithyDocumentSerde } +func (v *SigninResourceBasedPolicy) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.SigninResourceBasedPolicy) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *SigninResourceBasedPolicy) SerializeMembers(s smithy.ShapeSerializer) { + serializePolicyStatements(s, schemas.SigninResourceBasedPolicy_statement, v.Statement) + if v.Version != nil { + s.WriteString(schemas.SigninResourceBasedPolicy_version, *v.Version) + } +} +func (v *SigninResourceBasedPolicy) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.SigninResourceBasedPolicy, func(s *smithy.Schema) error { + switch s { + case schemas.SigninResourceBasedPolicy_statement: + return deserializePolicyStatements(d, schemas.SigninResourceBasedPolicy_statement, &v.Statement) + case schemas.SigninResourceBasedPolicy_version: + v.Version = new(string) + return d.ReadString(schemas.SigninResourceBasedPolicy_version, v.Version) + } + return nil + }) +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/validators.go index 8049ca285..169678f9a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/validators.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/validators.go @@ -50,6 +50,26 @@ func (m *validateOpCreateOAuth2TokenWithIAM) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpCreateOAuth2TokenWithTokenExchange struct { +} + +func (*validateOpCreateOAuth2TokenWithTokenExchange) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateOAuth2TokenWithTokenExchange) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateOAuth2TokenWithTokenExchangeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateOAuth2TokenWithTokenExchangeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteResourcePermissionStatement struct { } @@ -118,6 +138,10 @@ func addOpCreateOAuth2TokenWithIAMValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpCreateOAuth2TokenWithIAM{}, middleware.After) } +func addOpCreateOAuth2TokenWithTokenExchangeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateOAuth2TokenWithTokenExchange{}, middleware.After) +} + func addOpDeleteResourcePermissionStatementValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteResourcePermissionStatement{}, middleware.After) } @@ -185,6 +209,21 @@ func validateOpCreateOAuth2TokenWithIAMInput(v *CreateOAuth2TokenWithIAMInput) e } } +func validateOpCreateOAuth2TokenWithTokenExchangeInput(v *CreateOAuth2TokenWithTokenExchangeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateOAuth2TokenWithTokenExchangeInput"} + if v.GrantType == nil { + invalidParams.Add(smithy.NewErrParamRequired("GrantType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteResourcePermissionStatementInput(v *DeleteResourcePermissionStatementInput) error { if v == nil { return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md index 3343b37cd..05ded98c2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md @@ -1,3 +1,28 @@ +# v1.39.0 (2026-10-27) + +* **Feature**: Enable schema-based (de)serialization for this service. +* **Dependency Update**: Update to smithy-go v1.28.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.5 (2026-10-22) + +* **Bug Fix**: Update smithy-go to v1.28.6 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.4 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.3 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.2 (2026-10-06) + +* No change notes available for this release. + # v1.38.1 (2026-09-24) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go index 6fd750495..7dd509085 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go @@ -16,6 +16,7 @@ import ( internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" "github.com/aws/aws-sdk-go-v2/internal/timeouts" + "github.com/aws/aws-sdk-go-v2/service/sso/schemas" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" @@ -23,6 +24,7 @@ import ( "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/aws/smithy-go/transport/http/protocol/restjson1" "net" "net/http" "sync/atomic" @@ -210,6 +212,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveAuthSchemeResolver(&options) + options.Protocol = restjson1.New(schemas.SWBPortalService) + for _, fn := range optFns { fn(&options) } @@ -427,6 +431,102 @@ func resolveAuthSchemes(options *Options) { } } +type serializeRequestMiddleware struct { + options *Options + operationSchema *smithy.OperationSchema +} + +func (*serializeRequestMiddleware) ID() string { + return "OperationSerializer" +} + +func (m *serializeRequestMiddleware) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return middleware.SerializeOutput{}, middleware.Metadata{}, fmt.Errorf("unexpected transport type %T", in.Request) + } + + input, ok := in.Parameters.(smithy.Serializable) + if !ok { + return middleware.SerializeOutput{}, middleware.Metadata{}, fmt.Errorf("input %T is not Serializable", in.Request) + } + + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + + err := m.options.Protocol.SerializeRequest(ctx, m.operationSchema, input, req) + + endTimer() + span.End() + + if err != nil { + return middleware.SerializeOutput{}, middleware.Metadata{}, err + } + + return next.HandleSerialize(ctx, in) +} + +type deserializeResponseMiddleware struct { + options *Options + operationSchema *smithy.OperationSchema + output smithy.Deserializable +} + +func (*deserializeResponseMiddleware) ID() string { + return "OperationDeserializer" +} + +func (m *deserializeResponseMiddleware) HandleDeserialize( + ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, +) ( + middleware.DeserializeOutput, middleware.Metadata, error, +) { + out, md, err := next.HandleDeserialize(ctx, in) + + resp, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, md, err + } + return out, md, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + // Close the response body on return. CloseResponseBody keeps the body + // open only for a successful caller-owned stream (a streaming payload + // with a nil error); on any error -- including one surfaced by an + // interceptor that runs after OperationDeserializer (after transmit or + // before deserialization) -- it closes the received body. Registering + // this before the error check below is what covers those interceptor + // aborts. Event streams close their own body in the event stream + // deserializer. + if !m.operationSchema.IsInputEventStream() && !m.operationSchema.IsOutputEventStream() { + _, isStreamingPayload := m.output.(smithy.StreamingOutput) + defer func() { + smithyhttp.CloseResponseBody(ctx, resp, isStreamingPayload, err) + }() + } + + if err != nil { + return out, md, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + + err = m.options.Protocol.DeserializeResponse(ctx, m.operationSchema, TypeRegistry, resp, m.output) + out.Result = m.output + + endTimer() + span.End() + + return out, md, err +} + type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go index b26651c43..545f83311 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go @@ -4,7 +4,9 @@ package sso import ( "context" + "github.com/aws/aws-sdk-go-v2/service/sso/schemas" "github.com/aws/aws-sdk-go-v2/service/sso/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -48,6 +50,24 @@ type GetRoleCredentialsInput struct { noSmithyDocumentSerde } +func (v *GetRoleCredentialsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GetRoleCredentialsRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GetRoleCredentialsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccessToken != nil { + s.WriteString(schemas.GetRoleCredentialsRequest_accessToken, *v.AccessToken) + } + if v.AccountId != nil { + s.WriteString(schemas.GetRoleCredentialsRequest_accountId, *v.AccountId) + } + if v.RoleName != nil { + s.WriteString(schemas.GetRoleCredentialsRequest_roleName, *v.RoleName) + } +} + type GetRoleCredentialsOutput struct { // The credentials for the role that is assigned to the user. @@ -59,13 +79,34 @@ type GetRoleCredentialsOutput struct { noSmithyDocumentSerde } +func (v *GetRoleCredentialsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.GetRoleCredentialsResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *GetRoleCredentialsOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.RoleCredentials != nil { + s.WriteStruct(schemas.GetRoleCredentialsResponse_roleCredentials) + v.RoleCredentials.SerializeMembers(s) + s.CloseStruct() + } +} +func (v *GetRoleCredentialsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.GetRoleCredentialsResponse, func(s *smithy.Schema) error { + switch s { + case schemas.GetRoleCredentialsResponse_roleCredentials: + v.RoleCredentials = &types.RoleCredentials{} + return v.RoleCredentials.Deserialize(d) + } + return nil + }) +} func (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRoleCredentials{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.GetRoleCredentials, schemas.GetRoleCredentialsRequest, schemas.GetRoleCredentialsResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRoleCredentials{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.GetRoleCredentials, schemas.GetRoleCredentialsRequest, schemas.GetRoleCredentialsResponse), output: &GetRoleCredentialsOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go index 38fee5926..8a42ce519 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go @@ -5,7 +5,9 @@ package sso import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/sso/schemas" "github.com/aws/aws-sdk-go-v2/service/sso/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -50,6 +52,27 @@ type ListAccountRolesInput struct { noSmithyDocumentSerde } +func (v *ListAccountRolesInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListAccountRolesRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListAccountRolesInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccessToken != nil { + s.WriteString(schemas.ListAccountRolesRequest_accessToken, *v.AccessToken) + } + if v.AccountId != nil { + s.WriteString(schemas.ListAccountRolesRequest_accountId, *v.AccountId) + } + if v.MaxResults != nil { + s.WriteInt32(schemas.ListAccountRolesRequest_maxResults, *v.MaxResults) + } + if v.NextToken != nil { + s.WriteString(schemas.ListAccountRolesRequest_nextToken, *v.NextToken) + } +} + type ListAccountRolesOutput struct { // The page token client that is used to retrieve the list of accounts. @@ -65,13 +88,35 @@ type ListAccountRolesOutput struct { noSmithyDocumentSerde } +func (v *ListAccountRolesOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListAccountRolesResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListAccountRolesOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.NextToken != nil { + s.WriteString(schemas.ListAccountRolesResponse_nextToken, *v.NextToken) + } + serializeRoleListType(s, schemas.ListAccountRolesResponse_roleList, v.RoleList) +} +func (v *ListAccountRolesOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ListAccountRolesResponse, func(s *smithy.Schema) error { + switch s { + case schemas.ListAccountRolesResponse_nextToken: + v.NextToken = new(string) + return d.ReadString(schemas.ListAccountRolesResponse_nextToken, v.NextToken) + case schemas.ListAccountRolesResponse_roleList: + return deserializeRoleListType(d, schemas.ListAccountRolesResponse_roleList, &v.RoleList) + } + return nil + }) +} func (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccountRoles{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListAccountRoles, schemas.ListAccountRolesRequest, schemas.ListAccountRolesResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccountRoles{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListAccountRoles, schemas.ListAccountRolesRequest, schemas.ListAccountRolesResponse), output: &ListAccountRolesOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go index 342aa88e3..dc4c4c3dc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go @@ -5,7 +5,9 @@ package sso import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/sso/schemas" "github.com/aws/aws-sdk-go-v2/service/sso/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -49,6 +51,24 @@ type ListAccountsInput struct { noSmithyDocumentSerde } +func (v *ListAccountsInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListAccountsRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListAccountsInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccessToken != nil { + s.WriteString(schemas.ListAccountsRequest_accessToken, *v.AccessToken) + } + if v.MaxResults != nil { + s.WriteInt32(schemas.ListAccountsRequest_maxResults, *v.MaxResults) + } + if v.NextToken != nil { + s.WriteString(schemas.ListAccountsRequest_nextToken, *v.NextToken) + } +} + type ListAccountsOutput struct { // A paginated response with the list of account information and the next token if @@ -64,13 +84,35 @@ type ListAccountsOutput struct { noSmithyDocumentSerde } +func (v *ListAccountsOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ListAccountsResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ListAccountsOutput) SerializeMembers(s smithy.ShapeSerializer) { + serializeAccountListType(s, schemas.ListAccountsResponse_accountList, v.AccountList) + if v.NextToken != nil { + s.WriteString(schemas.ListAccountsResponse_nextToken, *v.NextToken) + } +} +func (v *ListAccountsOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ListAccountsResponse, func(s *smithy.Schema) error { + switch s { + case schemas.ListAccountsResponse_accountList: + return deserializeAccountListType(d, schemas.ListAccountsResponse_accountList, &v.AccountList) + case schemas.ListAccountsResponse_nextToken: + v.NextToken = new(string) + return d.ReadString(schemas.ListAccountsResponse_nextToken, v.NextToken) + } + return nil + }) +} func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccounts{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListAccounts, schemas.ListAccountsRequest, schemas.ListAccountsResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccounts{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.ListAccounts, schemas.ListAccountsRequest, schemas.ListAccountsResponse), output: &ListAccountsOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go index 44d1c57d5..805c2dbea 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go @@ -4,6 +4,8 @@ package sso import ( "context" + "github.com/aws/aws-sdk-go-v2/service/sso/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -51,6 +53,18 @@ type LogoutInput struct { noSmithyDocumentSerde } +func (v *LogoutInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.LogoutRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *LogoutInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccessToken != nil { + s.WriteString(schemas.LogoutRequest_accessToken, *v.AccessToken) + } +} + type LogoutOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -58,13 +72,26 @@ type LogoutOutput struct { noSmithyDocumentSerde } +func (v *LogoutOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(nil) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *LogoutOutput) SerializeMembers(s smithy.ShapeSerializer) { +} +func (v *LogoutOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, nil, func(s *smithy.Schema) error { + switch s { + } + return nil + }) +} func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpLogout{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.Logout, schemas.LogoutRequest, nil)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpLogout{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.Logout, schemas.LogoutRequest, nil), output: &LogoutOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/common_serde.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/common_serde.go new file mode 100644 index 000000000..c1b15aaae --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/common_serde.go @@ -0,0 +1,78 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "github.com/aws/aws-sdk-go-v2/service/sso/types" + smithy "github.com/aws/smithy-go" +) + +func serializeAccountListType(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.AccountInfo) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeRoleListType(s smithy.ShapeSerializer, schema *smithy.Schema, v []types.RoleInfo) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func deserializeAccountListType(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.AccountInfo) error { + *v = make([]types.AccountInfo, 0) + var vv types.AccountInfo + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero types.AccountInfo + *v = append(*v, zero) + return nil + } + + vv = types.AccountInfo{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeRoleListType(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]types.RoleInfo) error { + *v = make([]types.RoleInfo, 0) + var vv types.RoleInfo + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero types.RoleInfo + *v = append(*v, zero) + return nil + } + + vv = types.RoleInfo{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go deleted file mode 100644 index dbc691c49..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go +++ /dev/null @@ -1,1183 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sso - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" - "github.com/aws/aws-sdk-go-v2/service/sso/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" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "strings" -) - -type awsRestjson1_deserializeOpGetRoleCredentials struct { -} - -func (*awsRestjson1_deserializeOpGetRoleCredentials) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpGetRoleCredentials) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetRoleCredentials(response, &metadata) - } - output := &GetRoleCredentialsOutput{} - 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_deserializeOpDocumentGetRoleCredentialsOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorGetRoleCredentials(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentGetRoleCredentialsOutput(v **GetRoleCredentialsOutput, 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 *GetRoleCredentialsOutput - if *v == nil { - sv = &GetRoleCredentialsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "roleCredentials": - if err := awsRestjson1_deserializeDocumentRoleCredentials(&sv.RoleCredentials, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListAccountRoles struct { -} - -func (*awsRestjson1_deserializeOpListAccountRoles) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListAccountRoles) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAccountRoles(response, &metadata) - } - output := &ListAccountRolesOutput{} - 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_deserializeOpDocumentListAccountRolesOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListAccountRoles(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListAccountRolesOutput(v **ListAccountRolesOutput, 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 *ListAccountRolesOutput - if *v == nil { - sv = &ListAccountRolesOutput{} - } 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 NextTokenType to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "roleList": - if err := awsRestjson1_deserializeDocumentRoleListType(&sv.RoleList, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListAccounts struct { -} - -func (*awsRestjson1_deserializeOpListAccounts) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListAccounts) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAccounts(response, &metadata) - } - output := &ListAccountsOutput{} - 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_deserializeOpDocumentListAccountsOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListAccountsOutput(v **ListAccountsOutput, 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 *ListAccountsOutput - if *v == nil { - sv = &ListAccountsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accountList": - if err := awsRestjson1_deserializeDocumentAccountListType(&sv.AccountList, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextTokenType to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpLogout struct { -} - -func (*awsRestjson1_deserializeOpLogout) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpLogout) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorLogout(response, &metadata) - } - output := &LogoutOutput{} - out.Result = output - - if _, err = io.Copy(io.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorLogout(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRequestException{} - 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_deserializeDocumentInvalidRequestException(&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_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyRequestsException{} - 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_deserializeDocumentTooManyRequestsException(&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_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.UnauthorizedException{} - 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_deserializeDocumentUnauthorizedException(&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_deserializeDocumentAccountInfo(v **types.AccountInfo, 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.AccountInfo - if *v == nil { - sv = &types.AccountInfo{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountIdType to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "accountName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountNameType to be of type string, got %T instead", value) - } - sv.AccountName = ptr.String(jtv) - } - - case "emailAddress": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EmailAddressType to be of type string, got %T instead", value) - } - sv.EmailAddress = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAccountListType(v *[]types.AccountInfo, 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.AccountInfo - if *v == nil { - cv = []types.AccountInfo{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AccountInfo - destAddr := &col - if err := awsRestjson1_deserializeDocumentAccountInfo(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, 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.InvalidRequestException - if *v == nil { - sv = &types.InvalidRequestException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Message = 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", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentRoleCredentials(v **types.RoleCredentials, 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.RoleCredentials - if *v == nil { - sv = &types.RoleCredentials{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessKeyId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccessKeyType to be of type string, got %T instead", value) - } - sv.AccessKeyId = ptr.String(jtv) - } - - case "expiration": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected ExpirationTimestampType to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Expiration = i64 - } - - case "secretAccessKey": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SecretAccessKeyType to be of type string, got %T instead", value) - } - sv.SecretAccessKey = ptr.String(jtv) - } - - case "sessionToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SessionTokenType to be of type string, got %T instead", value) - } - sv.SessionToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentRoleInfo(v **types.RoleInfo, 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.RoleInfo - if *v == nil { - sv = &types.RoleInfo{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountIdType to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "roleName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RoleNameType to be of type string, got %T instead", value) - } - sv.RoleName = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentRoleListType(v *[]types.RoleInfo, 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.RoleInfo - if *v == nil { - cv = []types.RoleInfo{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RoleInfo - destAddr := &col - if err := awsRestjson1_deserializeDocumentRoleInfo(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, 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.TooManyRequestsException - if *v == nil { - sv = &types.TooManyRequestsException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentUnauthorizedException(v **types.UnauthorizedException, 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.UnauthorizedException - if *v == nil { - sv = &types.UnauthorizedException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json index 7aca52b60..01dd6f416 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json @@ -13,7 +13,7 @@ "api_op_ListAccounts.go", "api_op_Logout.go", "auth.go", - "deserializers.go", + "common_serde.go", "doc.go", "endpoints.go", "endpoints_config_test.go", @@ -24,9 +24,12 @@ "options.go", "request_snapshot_test.go", "response_snapshot_test.go", - "serializers.go", + "response_snapshot_update_test.go", + "schemas/schemas.go", "snapshot_test.go", "sra_operation_order_test.go", + "type_registry.go", + "types/common_serde.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go index 653969f93..07a4c8209 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go @@ -3,4 +3,4 @@ package sso // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.38.1" +const goModuleVersion = "1.39.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go index fbe3ff2a2..a4ea5a75f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go @@ -119,6 +119,8 @@ type Options struct { // Currently does not support per operation call overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode + Protocol smithyhttp.ClientProtocol + // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/schemas/schemas.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/schemas/schemas.go new file mode 100644 index 000000000..1775a52c3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/schemas/schemas.go @@ -0,0 +1,300 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package schemas + +import ( + smithy "github.com/aws/smithy-go" + smithytraits "github.com/aws/smithy-go/traits" +) + +var GetRoleCredentials = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "GetRoleCredentials", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "GET", + URI: "/federation/credentials", + Code: 200}) + +var ListAccountRoles = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "ListAccountRoles", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "GET", + URI: "/assignment/roles", + Code: 200}) + +var ListAccounts = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "ListAccounts", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "GET", + URI: "/assignment/accounts", + Code: 200}) + +var Logout = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "Logout", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/logout", + Code: 200}) + +var _SWBPortalService = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "SWBPortalService", +}, smithy.ShapeTypeService, 0) + +var SWBPortalService = smithy.NewServiceSchema(_SWBPortalService, "2019-06-10") + +var _AccessKeyType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "AccessKeyType", +}, smithy.ShapeTypeString, 0) + +var _AccessTokenType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "AccessTokenType", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _AccountIdType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "AccountIdType", +}, smithy.ShapeTypeString, 0) + +var AccountInfo = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "AccountInfo", +}, smithy.ShapeTypeStructure, 3) +var AccountInfo_accountId *smithy.Schema + +var AccountInfo_accountName *smithy.Schema + +var AccountInfo_emailAddress *smithy.Schema + +var _AccountListType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "AccountListType", +}, smithy.ShapeTypeList, 1) +var _AccountListType_member *smithy.Schema + +var _AccountNameType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "AccountNameType", +}, smithy.ShapeTypeString, 0) + +var _EmailAddressType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "EmailAddressType", +}, smithy.ShapeTypeString, 0) + +var _ErrorDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "ErrorDescription", +}, smithy.ShapeTypeString, 0) + +var _ExpirationTimestampType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "ExpirationTimestampType", +}, smithy.ShapeTypeLong, 0) + +var InvalidRequestException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "InvalidRequestException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var InvalidRequestException_message *smithy.Schema + +var _MaxResultType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "MaxResultType", +}, smithy.ShapeTypeInteger, 0) + +var _NextTokenType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "NextTokenType", +}, smithy.ShapeTypeString, 0) + +var ResourceNotFoundException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "ResourceNotFoundException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 404}) +var ResourceNotFoundException_message *smithy.Schema + +var RoleCredentials = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "RoleCredentials", +}, smithy.ShapeTypeStructure, 4) +var RoleCredentials_accessKeyId *smithy.Schema + +var RoleCredentials_secretAccessKey *smithy.Schema + +var RoleCredentials_sessionToken *smithy.Schema + +var RoleCredentials_expiration *smithy.Schema + +var RoleInfo = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "RoleInfo", +}, smithy.ShapeTypeStructure, 2) +var RoleInfo_roleName *smithy.Schema + +var RoleInfo_accountId *smithy.Schema + +var _RoleListType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "RoleListType", +}, smithy.ShapeTypeList, 1) +var _RoleListType_member *smithy.Schema + +var _RoleNameType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "RoleNameType", +}, smithy.ShapeTypeString, 0) + +var _SecretAccessKeyType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "SecretAccessKeyType", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _SessionTokenType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "SessionTokenType", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var TooManyRequestsException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "TooManyRequestsException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 429}) +var TooManyRequestsException_message *smithy.Schema + +var UnauthorizedException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "UnauthorizedException", +}, smithy.ShapeTypeStructure, 1, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 401}) +var UnauthorizedException_message *smithy.Schema + +var GetRoleCredentialsRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "GetRoleCredentialsRequest", +}, smithy.ShapeTypeStructure, 3) +var GetRoleCredentialsRequest_roleName *smithy.Schema + +var GetRoleCredentialsRequest_accountId *smithy.Schema + +var GetRoleCredentialsRequest_accessToken *smithy.Schema + +var GetRoleCredentialsResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "GetRoleCredentialsResponse", +}, smithy.ShapeTypeStructure, 1) +var GetRoleCredentialsResponse_roleCredentials *smithy.Schema + +var ListAccountRolesRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "ListAccountRolesRequest", +}, smithy.ShapeTypeStructure, 4) +var ListAccountRolesRequest_nextToken *smithy.Schema + +var ListAccountRolesRequest_maxResults *smithy.Schema + +var ListAccountRolesRequest_accessToken *smithy.Schema + +var ListAccountRolesRequest_accountId *smithy.Schema + +var ListAccountRolesResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "ListAccountRolesResponse", +}, smithy.ShapeTypeStructure, 2) +var ListAccountRolesResponse_nextToken *smithy.Schema + +var ListAccountRolesResponse_roleList *smithy.Schema + +var ListAccountsRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "ListAccountsRequest", +}, smithy.ShapeTypeStructure, 3) +var ListAccountsRequest_nextToken *smithy.Schema + +var ListAccountsRequest_maxResults *smithy.Schema + +var ListAccountsRequest_accessToken *smithy.Schema + +var ListAccountsResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "ListAccountsResponse", +}, smithy.ShapeTypeStructure, 2) +var ListAccountsResponse_nextToken *smithy.Schema + +var ListAccountsResponse_accountList *smithy.Schema + +var LogoutRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.sso", + Name: "LogoutRequest", +}, smithy.ShapeTypeStructure, 1) +var LogoutRequest_accessToken *smithy.Schema + +// Initialize schema members after all schemas are declared to avoid +// initialization cycles +func init() { + AccountInfo_accountId = AccountInfo.AddMember("accountId", _AccountIdType) + + AccountInfo_accountName = AccountInfo.AddMember("accountName", _AccountNameType) + + AccountInfo_emailAddress = AccountInfo.AddMember("emailAddress", _EmailAddressType) + + _AccountListType_member = _AccountListType.AddMember("member", AccountInfo) + + InvalidRequestException_message = InvalidRequestException.AddMember("message", _ErrorDescription) + + ResourceNotFoundException_message = ResourceNotFoundException.AddMember("message", _ErrorDescription) + + RoleCredentials_accessKeyId = RoleCredentials.AddMember("accessKeyId", _AccessKeyType) + + RoleCredentials_secretAccessKey = RoleCredentials.AddMember("secretAccessKey", _SecretAccessKeyType) + + RoleCredentials_sessionToken = RoleCredentials.AddMember("sessionToken", _SessionTokenType) + + RoleCredentials_expiration = RoleCredentials.AddMember("expiration", _ExpirationTimestampType) + + RoleInfo_roleName = RoleInfo.AddMember("roleName", _RoleNameType) + + RoleInfo_accountId = RoleInfo.AddMember("accountId", _AccountIdType) + + _RoleListType_member = _RoleListType.AddMember("member", RoleInfo) + + TooManyRequestsException_message = TooManyRequestsException.AddMember("message", _ErrorDescription) + + UnauthorizedException_message = UnauthorizedException.AddMember("message", _ErrorDescription) + + GetRoleCredentialsRequest_roleName = GetRoleCredentialsRequest.AddMember("roleName", _RoleNameType, &smithytraits.HTTPQuery{Name: "role_name"}) + + GetRoleCredentialsRequest_accountId = GetRoleCredentialsRequest.AddMember("accountId", _AccountIdType, &smithytraits.HTTPQuery{Name: "account_id"}) + + GetRoleCredentialsRequest_accessToken = GetRoleCredentialsRequest.AddMember("accessToken", _AccessTokenType, &smithytraits.HTTPHeader{Name: "x-amz-sso_bearer_token"}) + + GetRoleCredentialsResponse_roleCredentials = GetRoleCredentialsResponse.AddMember("roleCredentials", RoleCredentials) + + ListAccountRolesRequest_nextToken = ListAccountRolesRequest.AddMember("nextToken", _NextTokenType, &smithytraits.HTTPQuery{Name: "next_token"}) + + ListAccountRolesRequest_maxResults = ListAccountRolesRequest.AddMember("maxResults", _MaxResultType, &smithytraits.HTTPQuery{Name: "max_result"}) + + ListAccountRolesRequest_accessToken = ListAccountRolesRequest.AddMember("accessToken", _AccessTokenType, &smithytraits.HTTPHeader{Name: "x-amz-sso_bearer_token"}) + + ListAccountRolesRequest_accountId = ListAccountRolesRequest.AddMember("accountId", _AccountIdType, &smithytraits.HTTPQuery{Name: "account_id"}) + + ListAccountRolesResponse_nextToken = ListAccountRolesResponse.AddMember("nextToken", _NextTokenType) + + ListAccountRolesResponse_roleList = ListAccountRolesResponse.AddMember("roleList", _RoleListType) + + ListAccountsRequest_nextToken = ListAccountsRequest.AddMember("nextToken", _NextTokenType, &smithytraits.HTTPQuery{Name: "next_token"}) + + ListAccountsRequest_maxResults = ListAccountsRequest.AddMember("maxResults", _MaxResultType, &smithytraits.HTTPQuery{Name: "max_result"}) + + ListAccountsRequest_accessToken = ListAccountsRequest.AddMember("accessToken", _AccessTokenType, &smithytraits.HTTPHeader{Name: "x-amz-sso_bearer_token"}) + + ListAccountsResponse_nextToken = ListAccountsResponse.AddMember("nextToken", _NextTokenType) + + ListAccountsResponse_accountList = ListAccountsResponse.AddMember("accountList", _AccountListType) + + LogoutRequest_accessToken = LogoutRequest.AddMember("accessToken", _AccessTokenType, &smithytraits.HTTPHeader{Name: "x-amz-sso_bearer_token"}) + +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go deleted file mode 100644 index a7a5b57de..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package sso - -import ( - "context" - "fmt" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/encoding/httpbinding" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -type awsRestjson1_serializeOpGetRoleCredentials struct { -} - -func (*awsRestjson1_serializeOpGetRoleCredentials) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpGetRoleCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*GetRoleCredentialsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/federation/credentials") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsGetRoleCredentialsInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsGetRoleCredentialsInput(v *GetRoleCredentialsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AccessToken != nil { - locationName := "X-Amz-Sso_bearer_token" - encoder.SetHeader(locationName).String(*v.AccessToken) - } - - if v.AccountId != nil { - encoder.SetQuery("account_id").String(*v.AccountId) - } - - if v.RoleName != nil { - encoder.SetQuery("role_name").String(*v.RoleName) - } - - return nil -} - -type awsRestjson1_serializeOpListAccountRoles struct { -} - -func (*awsRestjson1_serializeOpListAccountRoles) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListAccountRoles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*ListAccountRolesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/assignment/roles") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListAccountRolesInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListAccountRolesInput(v *ListAccountRolesInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AccessToken != nil { - locationName := "X-Amz-Sso_bearer_token" - encoder.SetHeader(locationName).String(*v.AccessToken) - } - - if v.AccountId != nil { - encoder.SetQuery("account_id").String(*v.AccountId) - } - - if v.MaxResults != nil { - encoder.SetQuery("max_result").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("next_token").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListAccounts struct { -} - -func (*awsRestjson1_serializeOpListAccounts) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*ListAccountsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/assignment/accounts") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListAccountsInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListAccountsInput(v *ListAccountsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AccessToken != nil { - locationName := "X-Amz-Sso_bearer_token" - encoder.SetHeader(locationName).String(*v.AccessToken) - } - - if v.MaxResults != nil { - encoder.SetQuery("max_result").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("next_token").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpLogout struct { -} - -func (*awsRestjson1_serializeOpLogout) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpLogout) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*LogoutInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/logout") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsLogoutInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsLogoutInput(v *LogoutInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AccessToken != nil { - locationName := "X-Amz-Sso_bearer_token" - encoder.SetHeader(locationName).String(*v.AccessToken) - } - - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/type_registry.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/type_registry.go new file mode 100644 index 000000000..3426aa833 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/type_registry.go @@ -0,0 +1,31 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "github.com/aws/aws-sdk-go-v2/service/sso/schemas" + "github.com/aws/aws-sdk-go-v2/service/sso/types" + smithy "github.com/aws/smithy-go" +) + +// TypeRegistry is the type registry for this service. +var TypeRegistry = &smithy.TypeRegistry{ + Entries: map[string]*smithy.TypeRegistryEntry{ + "com.amazonaws.sso#InvalidRequestException": { + Schema: schemas.InvalidRequestException, + New: func() any { return &types.InvalidRequestException{} }, + }, + "com.amazonaws.sso#ResourceNotFoundException": { + Schema: schemas.ResourceNotFoundException, + New: func() any { return &types.ResourceNotFoundException{} }, + }, + "com.amazonaws.sso#TooManyRequestsException": { + Schema: schemas.TooManyRequestsException, + New: func() any { return &types.TooManyRequestsException{} }, + }, + "com.amazonaws.sso#UnauthorizedException": { + Schema: schemas.UnauthorizedException, + New: func() any { return &types.UnauthorizedException{} }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/common_serde.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/common_serde.go new file mode 100644 index 000000000..5cf03b793 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/common_serde.go @@ -0,0 +1,77 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithy "github.com/aws/smithy-go" +) + +func serializeAccountListType(s smithy.ShapeSerializer, schema *smithy.Schema, v []AccountInfo) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func serializeRoleListType(s smithy.ShapeSerializer, schema *smithy.Schema, v []RoleInfo) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteStruct(schema.ListMember()) + vv.SerializeMembers(s) + s.CloseStruct() + } + s.CloseList() +} + +func deserializeAccountListType(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]AccountInfo) error { + *v = make([]AccountInfo, 0) + var vv AccountInfo + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero AccountInfo + *v = append(*v, zero) + return nil + } + + vv = AccountInfo{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeRoleListType(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]RoleInfo) error { + *v = make([]RoleInfo, 0) + var vv RoleInfo + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero RoleInfo + *v = append(*v, zero) + return nil + } + + vv = RoleInfo{} + if err := vv.Deserialize(d); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go index e97a126e8..3b21cc526 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go @@ -4,6 +4,7 @@ package types import ( "fmt" + "github.com/aws/aws-sdk-go-v2/service/sso/schemas" smithy "github.com/aws/smithy-go" ) @@ -33,6 +34,27 @@ func (e *InvalidRequestException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidRequestException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidRequestException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidRequestException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.InvalidRequestException_message, *v.Message) + } +} +func (v *InvalidRequestException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidRequestException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidRequestException_message: + v.Message = new(string) + return d.ReadString(schemas.InvalidRequestException_message, v.Message) + } + return nil + }) +} // The specified resource doesn't exist. type ResourceNotFoundException struct { @@ -59,6 +81,27 @@ func (e *ResourceNotFoundException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ResourceNotFoundException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ResourceNotFoundException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ResourceNotFoundException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.ResourceNotFoundException_message, *v.Message) + } +} +func (v *ResourceNotFoundException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ResourceNotFoundException, func(s *smithy.Schema) error { + switch s { + case schemas.ResourceNotFoundException_message: + v.Message = new(string) + return d.ReadString(schemas.ResourceNotFoundException_message, v.Message) + } + return nil + }) +} // Indicates that the request is being made too frequently and is more than what // the server can handle. @@ -86,6 +129,27 @@ func (e *TooManyRequestsException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *TooManyRequestsException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.TooManyRequestsException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *TooManyRequestsException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.TooManyRequestsException_message, *v.Message) + } +} +func (v *TooManyRequestsException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.TooManyRequestsException, func(s *smithy.Schema) error { + switch s { + case schemas.TooManyRequestsException_message: + v.Message = new(string) + return d.ReadString(schemas.TooManyRequestsException_message, v.Message) + } + return nil + }) +} // Indicates that the request is not authorized. This can happen due to an invalid // access token in the request. @@ -113,3 +177,24 @@ func (e *UnauthorizedException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *UnauthorizedException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UnauthorizedException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UnauthorizedException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Message != nil { + s.WriteString(schemas.UnauthorizedException_message, *v.Message) + } +} +func (v *UnauthorizedException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UnauthorizedException, func(s *smithy.Schema) error { + switch s { + case schemas.UnauthorizedException_message: + v.Message = new(string) + return d.ReadString(schemas.UnauthorizedException_message, v.Message) + } + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go index 07ac468e3..b77b74318 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go @@ -3,6 +3,8 @@ package types import ( + "github.com/aws/aws-sdk-go-v2/service/sso/schemas" + smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" ) @@ -21,6 +23,40 @@ type AccountInfo struct { noSmithyDocumentSerde } +func (v *AccountInfo) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AccountInfo) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AccountInfo) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccountId != nil { + s.WriteString(schemas.AccountInfo_accountId, *v.AccountId) + } + if v.AccountName != nil { + s.WriteString(schemas.AccountInfo_accountName, *v.AccountName) + } + if v.EmailAddress != nil { + s.WriteString(schemas.AccountInfo_emailAddress, *v.EmailAddress) + } +} +func (v *AccountInfo) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AccountInfo, func(s *smithy.Schema) error { + switch s { + case schemas.AccountInfo_accountId: + v.AccountId = new(string) + return d.ReadString(schemas.AccountInfo_accountId, v.AccountId) + case schemas.AccountInfo_accountName: + v.AccountName = new(string) + return d.ReadString(schemas.AccountInfo_accountName, v.AccountName) + case schemas.AccountInfo_emailAddress: + v.EmailAddress = new(string) + return d.ReadString(schemas.AccountInfo_emailAddress, v.EmailAddress) + } + return nil + }) +} + // Provides information about the role credentials that are assigned to the user. type RoleCredentials struct { @@ -48,6 +84,45 @@ type RoleCredentials struct { noSmithyDocumentSerde } +func (v *RoleCredentials) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RoleCredentials) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RoleCredentials) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccessKeyId != nil { + s.WriteString(schemas.RoleCredentials_accessKeyId, *v.AccessKeyId) + } + if v.Expiration != 0 { + s.WriteInt64(schemas.RoleCredentials_expiration, v.Expiration) + } + if v.SecretAccessKey != nil { + s.WriteString(schemas.RoleCredentials_secretAccessKey, *v.SecretAccessKey) + } + if v.SessionToken != nil { + s.WriteString(schemas.RoleCredentials_sessionToken, *v.SessionToken) + } +} +func (v *RoleCredentials) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.RoleCredentials, func(s *smithy.Schema) error { + switch s { + case schemas.RoleCredentials_accessKeyId: + v.AccessKeyId = new(string) + return d.ReadString(schemas.RoleCredentials_accessKeyId, v.AccessKeyId) + case schemas.RoleCredentials_expiration: + return d.ReadInt64(schemas.RoleCredentials_expiration, &v.Expiration) + case schemas.RoleCredentials_secretAccessKey: + v.SecretAccessKey = new(string) + return d.ReadString(schemas.RoleCredentials_secretAccessKey, v.SecretAccessKey) + case schemas.RoleCredentials_sessionToken: + v.SessionToken = new(string) + return d.ReadString(schemas.RoleCredentials_sessionToken, v.SessionToken) + } + return nil + }) +} + // Provides information about the role that is assigned to the user. type RoleInfo struct { @@ -60,4 +135,32 @@ type RoleInfo struct { noSmithyDocumentSerde } +func (v *RoleInfo) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RoleInfo) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RoleInfo) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccountId != nil { + s.WriteString(schemas.RoleInfo_accountId, *v.AccountId) + } + if v.RoleName != nil { + s.WriteString(schemas.RoleInfo_roleName, *v.RoleName) + } +} +func (v *RoleInfo) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.RoleInfo, func(s *smithy.Schema) error { + switch s { + case schemas.RoleInfo_accountId: + v.AccountId = new(string) + return d.ReadString(schemas.RoleInfo_accountId, v.AccountId) + case schemas.RoleInfo_roleName: + v.RoleName = new(string) + return d.ReadString(schemas.RoleInfo_roleName, v.RoleName) + } + return nil + }) +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md index b99345083..efe260d3d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md @@ -1,3 +1,28 @@ +# v1.44.0 (2026-10-27) + +* **Feature**: Enable schema-based (de)serialization for this service. +* **Dependency Update**: Update to smithy-go v1.28.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.5 (2026-10-22) + +* **Bug Fix**: Update smithy-go to v1.28.6 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.4 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.3 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.2 (2026-10-06) + +* No change notes available for this release. + # v1.43.1 (2026-09-24) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go index 4992093a2..d658fcf48 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go @@ -16,6 +16,7 @@ import ( internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" "github.com/aws/aws-sdk-go-v2/internal/timeouts" + "github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" @@ -23,6 +24,7 @@ import ( "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/aws/smithy-go/transport/http/protocol/restjson1" "net" "net/http" "sync/atomic" @@ -210,6 +212,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveAuthSchemeResolver(&options) + options.Protocol = restjson1.New(schemas.AWSSSOOIDCService) + for _, fn := range optFns { fn(&options) } @@ -427,6 +431,102 @@ func resolveAuthSchemes(options *Options) { } } +type serializeRequestMiddleware struct { + options *Options + operationSchema *smithy.OperationSchema +} + +func (*serializeRequestMiddleware) ID() string { + return "OperationSerializer" +} + +func (m *serializeRequestMiddleware) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return middleware.SerializeOutput{}, middleware.Metadata{}, fmt.Errorf("unexpected transport type %T", in.Request) + } + + input, ok := in.Parameters.(smithy.Serializable) + if !ok { + return middleware.SerializeOutput{}, middleware.Metadata{}, fmt.Errorf("input %T is not Serializable", in.Request) + } + + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + + err := m.options.Protocol.SerializeRequest(ctx, m.operationSchema, input, req) + + endTimer() + span.End() + + if err != nil { + return middleware.SerializeOutput{}, middleware.Metadata{}, err + } + + return next.HandleSerialize(ctx, in) +} + +type deserializeResponseMiddleware struct { + options *Options + operationSchema *smithy.OperationSchema + output smithy.Deserializable +} + +func (*deserializeResponseMiddleware) ID() string { + return "OperationDeserializer" +} + +func (m *deserializeResponseMiddleware) HandleDeserialize( + ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, +) ( + middleware.DeserializeOutput, middleware.Metadata, error, +) { + out, md, err := next.HandleDeserialize(ctx, in) + + resp, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, md, err + } + return out, md, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + // Close the response body on return. CloseResponseBody keeps the body + // open only for a successful caller-owned stream (a streaming payload + // with a nil error); on any error -- including one surfaced by an + // interceptor that runs after OperationDeserializer (after transmit or + // before deserialization) -- it closes the received body. Registering + // this before the error check below is what covers those interceptor + // aborts. Event streams close their own body in the event stream + // deserializer. + if !m.operationSchema.IsInputEventStream() && !m.operationSchema.IsOutputEventStream() { + _, isStreamingPayload := m.output.(smithy.StreamingOutput) + defer func() { + smithyhttp.CloseResponseBody(ctx, resp, isStreamingPayload, err) + }() + } + + if err != nil { + return out, md, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + + err = m.options.Protocol.DeserializeResponse(ctx, m.operationSchema, TypeRegistry, resp, m.output) + out.Result = m.output + + endTimer() + span.End() + + return out, md, err +} + type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go index a770ccb54..7ce956c03 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go @@ -4,6 +4,8 @@ package ssooidc import ( "context" + "github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -90,6 +92,40 @@ type CreateTokenInput struct { noSmithyDocumentSerde } +func (v *CreateTokenInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateTokenRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateTokenInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ClientId != nil { + s.WriteString(schemas.CreateTokenRequest_clientId, *v.ClientId) + } + if v.ClientSecret != nil { + s.WriteString(schemas.CreateTokenRequest_clientSecret, *v.ClientSecret) + } + if v.Code != nil { + s.WriteString(schemas.CreateTokenRequest_code, *v.Code) + } + if v.CodeVerifier != nil { + s.WriteString(schemas.CreateTokenRequest_codeVerifier, *v.CodeVerifier) + } + if v.DeviceCode != nil { + s.WriteString(schemas.CreateTokenRequest_deviceCode, *v.DeviceCode) + } + if v.GrantType != nil { + s.WriteString(schemas.CreateTokenRequest_grantType, *v.GrantType) + } + if v.RedirectUri != nil { + s.WriteString(schemas.CreateTokenRequest_redirectUri, *v.RedirectUri) + } + if v.RefreshToken != nil { + s.WriteString(schemas.CreateTokenRequest_refreshToken, *v.RefreshToken) + } + serializeScopes(s, schemas.CreateTokenRequest_scope, v.Scope) +} + type CreateTokenOutput struct { // A bearer token to access Amazon Web Services accounts and applications assigned @@ -129,13 +165,55 @@ type CreateTokenOutput struct { noSmithyDocumentSerde } +func (v *CreateTokenOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateTokenResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateTokenOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccessToken != nil { + s.WriteString(schemas.CreateTokenResponse_accessToken, *v.AccessToken) + } + if v.ExpiresIn != 0 { + s.WriteInt32(schemas.CreateTokenResponse_expiresIn, v.ExpiresIn) + } + if v.IdToken != nil { + s.WriteString(schemas.CreateTokenResponse_idToken, *v.IdToken) + } + if v.RefreshToken != nil { + s.WriteString(schemas.CreateTokenResponse_refreshToken, *v.RefreshToken) + } + if v.TokenType != nil { + s.WriteString(schemas.CreateTokenResponse_tokenType, *v.TokenType) + } +} +func (v *CreateTokenOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateTokenResponse, func(s *smithy.Schema) error { + switch s { + case schemas.CreateTokenResponse_accessToken: + v.AccessToken = new(string) + return d.ReadString(schemas.CreateTokenResponse_accessToken, v.AccessToken) + case schemas.CreateTokenResponse_expiresIn: + return d.ReadInt32(schemas.CreateTokenResponse_expiresIn, &v.ExpiresIn) + case schemas.CreateTokenResponse_idToken: + v.IdToken = new(string) + return d.ReadString(schemas.CreateTokenResponse_idToken, v.IdToken) + case schemas.CreateTokenResponse_refreshToken: + v.RefreshToken = new(string) + return d.ReadString(schemas.CreateTokenResponse_refreshToken, v.RefreshToken) + case schemas.CreateTokenResponse_tokenType: + v.TokenType = new(string) + return d.ReadString(schemas.CreateTokenResponse_tokenType, v.TokenType) + } + return nil + }) +} func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateToken{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateToken, schemas.CreateTokenRequest, schemas.CreateTokenResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateToken{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateToken, schemas.CreateTokenRequest, schemas.CreateTokenResponse), output: &CreateTokenOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go index a7a7d7618..15a36156c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go @@ -4,7 +4,9 @@ package ssooidc import ( "context" + "github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas" "github.com/aws/aws-sdk-go-v2/service/ssooidc/types" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -124,6 +126,46 @@ type CreateTokenWithIAMInput struct { noSmithyDocumentSerde } +func (v *CreateTokenWithIAMInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateTokenWithIAMRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateTokenWithIAMInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.Assertion != nil { + s.WriteString(schemas.CreateTokenWithIAMRequest_assertion, *v.Assertion) + } + if v.ClientId != nil { + s.WriteString(schemas.CreateTokenWithIAMRequest_clientId, *v.ClientId) + } + if v.Code != nil { + s.WriteString(schemas.CreateTokenWithIAMRequest_code, *v.Code) + } + if v.CodeVerifier != nil { + s.WriteString(schemas.CreateTokenWithIAMRequest_codeVerifier, *v.CodeVerifier) + } + if v.GrantType != nil { + s.WriteString(schemas.CreateTokenWithIAMRequest_grantType, *v.GrantType) + } + if v.RedirectUri != nil { + s.WriteString(schemas.CreateTokenWithIAMRequest_redirectUri, *v.RedirectUri) + } + if v.RefreshToken != nil { + s.WriteString(schemas.CreateTokenWithIAMRequest_refreshToken, *v.RefreshToken) + } + if v.RequestedTokenType != nil { + s.WriteString(schemas.CreateTokenWithIAMRequest_requestedTokenType, *v.RequestedTokenType) + } + serializeScopes(s, schemas.CreateTokenWithIAMRequest_scope, v.Scope) + if v.SubjectToken != nil { + s.WriteString(schemas.CreateTokenWithIAMRequest_subjectToken, *v.SubjectToken) + } + if v.SubjectTokenType != nil { + s.WriteString(schemas.CreateTokenWithIAMRequest_subjectTokenType, *v.SubjectTokenType) + } +} + type CreateTokenWithIAMOutput struct { // A bearer token to access Amazon Web Services accounts and applications assigned @@ -173,13 +215,72 @@ type CreateTokenWithIAMOutput struct { noSmithyDocumentSerde } +func (v *CreateTokenWithIAMOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.CreateTokenWithIAMResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *CreateTokenWithIAMOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.AccessToken != nil { + s.WriteString(schemas.CreateTokenWithIAMResponse_accessToken, *v.AccessToken) + } + if v.AwsAdditionalDetails != nil { + s.WriteStruct(schemas.CreateTokenWithIAMResponse_awsAdditionalDetails) + v.AwsAdditionalDetails.SerializeMembers(s) + s.CloseStruct() + } + if v.ExpiresIn != 0 { + s.WriteInt32(schemas.CreateTokenWithIAMResponse_expiresIn, v.ExpiresIn) + } + if v.IdToken != nil { + s.WriteString(schemas.CreateTokenWithIAMResponse_idToken, *v.IdToken) + } + if v.IssuedTokenType != nil { + s.WriteString(schemas.CreateTokenWithIAMResponse_issuedTokenType, *v.IssuedTokenType) + } + if v.RefreshToken != nil { + s.WriteString(schemas.CreateTokenWithIAMResponse_refreshToken, *v.RefreshToken) + } + serializeScopes(s, schemas.CreateTokenWithIAMResponse_scope, v.Scope) + if v.TokenType != nil { + s.WriteString(schemas.CreateTokenWithIAMResponse_tokenType, *v.TokenType) + } +} +func (v *CreateTokenWithIAMOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.CreateTokenWithIAMResponse, func(s *smithy.Schema) error { + switch s { + case schemas.CreateTokenWithIAMResponse_accessToken: + v.AccessToken = new(string) + return d.ReadString(schemas.CreateTokenWithIAMResponse_accessToken, v.AccessToken) + case schemas.CreateTokenWithIAMResponse_awsAdditionalDetails: + v.AwsAdditionalDetails = &types.AwsAdditionalDetails{} + return v.AwsAdditionalDetails.Deserialize(d) + case schemas.CreateTokenWithIAMResponse_expiresIn: + return d.ReadInt32(schemas.CreateTokenWithIAMResponse_expiresIn, &v.ExpiresIn) + case schemas.CreateTokenWithIAMResponse_idToken: + v.IdToken = new(string) + return d.ReadString(schemas.CreateTokenWithIAMResponse_idToken, v.IdToken) + case schemas.CreateTokenWithIAMResponse_issuedTokenType: + v.IssuedTokenType = new(string) + return d.ReadString(schemas.CreateTokenWithIAMResponse_issuedTokenType, v.IssuedTokenType) + case schemas.CreateTokenWithIAMResponse_refreshToken: + v.RefreshToken = new(string) + return d.ReadString(schemas.CreateTokenWithIAMResponse_refreshToken, v.RefreshToken) + case schemas.CreateTokenWithIAMResponse_scope: + return deserializeScopes(d, schemas.CreateTokenWithIAMResponse_scope, &v.Scope) + case schemas.CreateTokenWithIAMResponse_tokenType: + v.TokenType = new(string) + return d.ReadString(schemas.CreateTokenWithIAMResponse_tokenType, v.TokenType) + } + return nil + }) +} func (c *Client) addOperationCreateTokenWithIAMMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTokenWithIAM{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateTokenWithIAM, schemas.CreateTokenWithIAMRequest, schemas.CreateTokenWithIAMResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTokenWithIAM{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.CreateTokenWithIAM, schemas.CreateTokenWithIAMRequest, schemas.CreateTokenWithIAMResponse), output: &CreateTokenWithIAMOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go index cdb1c3cfa..325e84180 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go @@ -4,6 +4,8 @@ package ssooidc import ( "context" + "github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -72,6 +74,30 @@ type RegisterClientInput struct { noSmithyDocumentSerde } +func (v *RegisterClientInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RegisterClientRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RegisterClientInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ClientName != nil { + s.WriteString(schemas.RegisterClientRequest_clientName, *v.ClientName) + } + if v.ClientType != nil { + s.WriteString(schemas.RegisterClientRequest_clientType, *v.ClientType) + } + if v.EntitledApplicationArn != nil { + s.WriteString(schemas.RegisterClientRequest_entitledApplicationArn, *v.EntitledApplicationArn) + } + serializeGrantTypes(s, schemas.RegisterClientRequest_grantTypes, v.GrantTypes) + if v.IssuerUrl != nil { + s.WriteString(schemas.RegisterClientRequest_issuerUrl, *v.IssuerUrl) + } + serializeRedirectUris(s, schemas.RegisterClientRequest_redirectUris, v.RedirectUris) + serializeScopes(s, schemas.RegisterClientRequest_scopes, v.Scopes) +} + type RegisterClientOutput struct { // An endpoint that the client can use to request authorization. @@ -100,13 +126,60 @@ type RegisterClientOutput struct { noSmithyDocumentSerde } +func (v *RegisterClientOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.RegisterClientResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *RegisterClientOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.AuthorizationEndpoint != nil { + s.WriteString(schemas.RegisterClientResponse_authorizationEndpoint, *v.AuthorizationEndpoint) + } + if v.ClientId != nil { + s.WriteString(schemas.RegisterClientResponse_clientId, *v.ClientId) + } + if v.ClientIdIssuedAt != 0 { + s.WriteInt64(schemas.RegisterClientResponse_clientIdIssuedAt, v.ClientIdIssuedAt) + } + if v.ClientSecret != nil { + s.WriteString(schemas.RegisterClientResponse_clientSecret, *v.ClientSecret) + } + if v.ClientSecretExpiresAt != 0 { + s.WriteInt64(schemas.RegisterClientResponse_clientSecretExpiresAt, v.ClientSecretExpiresAt) + } + if v.TokenEndpoint != nil { + s.WriteString(schemas.RegisterClientResponse_tokenEndpoint, *v.TokenEndpoint) + } +} +func (v *RegisterClientOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.RegisterClientResponse, func(s *smithy.Schema) error { + switch s { + case schemas.RegisterClientResponse_authorizationEndpoint: + v.AuthorizationEndpoint = new(string) + return d.ReadString(schemas.RegisterClientResponse_authorizationEndpoint, v.AuthorizationEndpoint) + case schemas.RegisterClientResponse_clientId: + v.ClientId = new(string) + return d.ReadString(schemas.RegisterClientResponse_clientId, v.ClientId) + case schemas.RegisterClientResponse_clientIdIssuedAt: + return d.ReadInt64(schemas.RegisterClientResponse_clientIdIssuedAt, &v.ClientIdIssuedAt) + case schemas.RegisterClientResponse_clientSecret: + v.ClientSecret = new(string) + return d.ReadString(schemas.RegisterClientResponse_clientSecret, v.ClientSecret) + case schemas.RegisterClientResponse_clientSecretExpiresAt: + return d.ReadInt64(schemas.RegisterClientResponse_clientSecretExpiresAt, &v.ClientSecretExpiresAt) + case schemas.RegisterClientResponse_tokenEndpoint: + v.TokenEndpoint = new(string) + return d.ReadString(schemas.RegisterClientResponse_tokenEndpoint, v.TokenEndpoint) + } + return nil + }) +} func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterClient{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.RegisterClient, schemas.RegisterClientRequest, schemas.RegisterClientResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterClient{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.RegisterClient, schemas.RegisterClientRequest, schemas.RegisterClientResponse), output: &RegisterClientOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go index 3cec46e23..e3507fa4f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go @@ -4,6 +4,8 @@ package ssooidc import ( "context" + "github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas" + smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -50,6 +52,24 @@ type StartDeviceAuthorizationInput struct { noSmithyDocumentSerde } +func (v *StartDeviceAuthorizationInput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.StartDeviceAuthorizationRequest) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *StartDeviceAuthorizationInput) SerializeMembers(s smithy.ShapeSerializer) { + if v.ClientId != nil { + s.WriteString(schemas.StartDeviceAuthorizationRequest_clientId, *v.ClientId) + } + if v.ClientSecret != nil { + s.WriteString(schemas.StartDeviceAuthorizationRequest_clientSecret, *v.ClientSecret) + } + if v.StartUrl != nil { + s.WriteString(schemas.StartDeviceAuthorizationRequest_startUrl, *v.StartUrl) + } +} + type StartDeviceAuthorizationOutput struct { // The short-lived code that is used by the device when polling for a session @@ -82,13 +102,60 @@ type StartDeviceAuthorizationOutput struct { noSmithyDocumentSerde } +func (v *StartDeviceAuthorizationOutput) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.StartDeviceAuthorizationResponse) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *StartDeviceAuthorizationOutput) SerializeMembers(s smithy.ShapeSerializer) { + if v.DeviceCode != nil { + s.WriteString(schemas.StartDeviceAuthorizationResponse_deviceCode, *v.DeviceCode) + } + if v.ExpiresIn != 0 { + s.WriteInt32(schemas.StartDeviceAuthorizationResponse_expiresIn, v.ExpiresIn) + } + if v.Interval != 0 { + s.WriteInt32(schemas.StartDeviceAuthorizationResponse_interval, v.Interval) + } + if v.UserCode != nil { + s.WriteString(schemas.StartDeviceAuthorizationResponse_userCode, *v.UserCode) + } + if v.VerificationUri != nil { + s.WriteString(schemas.StartDeviceAuthorizationResponse_verificationUri, *v.VerificationUri) + } + if v.VerificationUriComplete != nil { + s.WriteString(schemas.StartDeviceAuthorizationResponse_verificationUriComplete, *v.VerificationUriComplete) + } +} +func (v *StartDeviceAuthorizationOutput) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.StartDeviceAuthorizationResponse, func(s *smithy.Schema) error { + switch s { + case schemas.StartDeviceAuthorizationResponse_deviceCode: + v.DeviceCode = new(string) + return d.ReadString(schemas.StartDeviceAuthorizationResponse_deviceCode, v.DeviceCode) + case schemas.StartDeviceAuthorizationResponse_expiresIn: + return d.ReadInt32(schemas.StartDeviceAuthorizationResponse_expiresIn, &v.ExpiresIn) + case schemas.StartDeviceAuthorizationResponse_interval: + return d.ReadInt32(schemas.StartDeviceAuthorizationResponse_interval, &v.Interval) + case schemas.StartDeviceAuthorizationResponse_userCode: + v.UserCode = new(string) + return d.ReadString(schemas.StartDeviceAuthorizationResponse_userCode, v.UserCode) + case schemas.StartDeviceAuthorizationResponse_verificationUri: + v.VerificationUri = new(string) + return d.ReadString(schemas.StartDeviceAuthorizationResponse_verificationUri, v.VerificationUri) + case schemas.StartDeviceAuthorizationResponse_verificationUriComplete: + v.VerificationUriComplete = new(string) + return d.ReadString(schemas.StartDeviceAuthorizationResponse_verificationUriComplete, v.VerificationUriComplete) + } + return nil + }) +} func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsRestjson1_serializeOpStartDeviceAuthorization{}, middleware.After) - if err != nil { + if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.StartDeviceAuthorization, schemas.StartDeviceAuthorizationRequest, schemas.StartDeviceAuthorizationResponse)}, middleware.After); err != nil { return err } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartDeviceAuthorization{}, middleware.After) - if err != nil { + if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.StartDeviceAuthorization, schemas.StartDeviceAuthorizationRequest, schemas.StartDeviceAuthorizationResponse), output: &StartDeviceAuthorizationOutput{}}, middleware.After); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/common_serde.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/common_serde.go new file mode 100644 index 000000000..ec35c3097 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/common_serde.go @@ -0,0 +1,103 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + smithy "github.com/aws/smithy-go" +) + +func serializeGrantTypes(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeRedirectUris(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeScopes(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func deserializeGrantTypes(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero string + *v = append(*v, zero) + return nil + } + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeRedirectUris(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero string + *v = append(*v, zero) + return nil + } + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeScopes(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero string + *v = append(*v, zero) + return nil + } + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go deleted file mode 100644 index da4a9e2f5..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go +++ /dev/null @@ -1,2256 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ssooidc - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" - "github.com/aws/aws-sdk-go-v2/service/ssooidc/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" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "strings" -) - -type awsRestjson1_deserializeOpCreateToken struct { -} - -func (*awsRestjson1_deserializeOpCreateToken) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateToken) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateToken(response, &metadata) - } - output := &CreateTokenOutput{} - 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_deserializeOpDocumentCreateTokenOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateToken(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AuthorizationPendingException", errorCode): - return awsRestjson1_deserializeErrorAuthorizationPendingException(response, errorBody) - - case strings.EqualFold("ExpiredTokenException", errorCode): - return awsRestjson1_deserializeErrorExpiredTokenException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("InvalidClientException", errorCode): - return awsRestjson1_deserializeErrorInvalidClientException(response, errorBody) - - case strings.EqualFold("InvalidGrantException", errorCode): - return awsRestjson1_deserializeErrorInvalidGrantException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("InvalidScopeException", errorCode): - return awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody) - - case strings.EqualFold("SlowDownException", errorCode): - return awsRestjson1_deserializeErrorSlowDownException(response, errorBody) - - case strings.EqualFold("UnauthorizedClientException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) - - case strings.EqualFold("UnsupportedGrantTypeException", errorCode): - return awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateTokenOutput(v **CreateTokenOutput, 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 *CreateTokenOutput - if *v == nil { - sv = &CreateTokenOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccessToken to be of type string, got %T instead", value) - } - sv.AccessToken = ptr.String(jtv) - } - - case "expiresIn": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected ExpirationInSeconds to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ExpiresIn = int32(i64) - } - - case "idToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected IdToken to be of type string, got %T instead", value) - } - sv.IdToken = ptr.String(jtv) - } - - case "refreshToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RefreshToken to be of type string, got %T instead", value) - } - sv.RefreshToken = ptr.String(jtv) - } - - case "tokenType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TokenType to be of type string, got %T instead", value) - } - sv.TokenType = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateTokenWithIAM struct { -} - -func (*awsRestjson1_deserializeOpCreateTokenWithIAM) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateTokenWithIAM) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateTokenWithIAM(response, &metadata) - } - output := &CreateTokenWithIAMOutput{} - 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_deserializeOpDocumentCreateTokenWithIAMOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateTokenWithIAM(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AuthorizationPendingException", errorCode): - return awsRestjson1_deserializeErrorAuthorizationPendingException(response, errorBody) - - case strings.EqualFold("ExpiredTokenException", errorCode): - return awsRestjson1_deserializeErrorExpiredTokenException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("InvalidClientException", errorCode): - return awsRestjson1_deserializeErrorInvalidClientException(response, errorBody) - - case strings.EqualFold("InvalidGrantException", errorCode): - return awsRestjson1_deserializeErrorInvalidGrantException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("InvalidRequestRegionException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestRegionException(response, errorBody) - - case strings.EqualFold("InvalidScopeException", errorCode): - return awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody) - - case strings.EqualFold("SlowDownException", errorCode): - return awsRestjson1_deserializeErrorSlowDownException(response, errorBody) - - case strings.EqualFold("UnauthorizedClientException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) - - case strings.EqualFold("UnsupportedGrantTypeException", errorCode): - return awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateTokenWithIAMOutput(v **CreateTokenWithIAMOutput, 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 *CreateTokenWithIAMOutput - if *v == nil { - sv = &CreateTokenWithIAMOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccessToken to be of type string, got %T instead", value) - } - sv.AccessToken = ptr.String(jtv) - } - - case "awsAdditionalDetails": - if err := awsRestjson1_deserializeDocumentAwsAdditionalDetails(&sv.AwsAdditionalDetails, value); err != nil { - return err - } - - case "expiresIn": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected ExpirationInSeconds to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ExpiresIn = int32(i64) - } - - case "idToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected IdToken to be of type string, got %T instead", value) - } - sv.IdToken = ptr.String(jtv) - } - - case "issuedTokenType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TokenTypeURI to be of type string, got %T instead", value) - } - sv.IssuedTokenType = ptr.String(jtv) - } - - case "refreshToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RefreshToken to be of type string, got %T instead", value) - } - sv.RefreshToken = ptr.String(jtv) - } - - case "scope": - if err := awsRestjson1_deserializeDocumentScopes(&sv.Scope, value); err != nil { - return err - } - - case "tokenType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TokenType to be of type string, got %T instead", value) - } - sv.TokenType = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpRegisterClient struct { -} - -func (*awsRestjson1_deserializeOpRegisterClient) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpRegisterClient) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRegisterClient(response, &metadata) - } - output := &RegisterClientOutput{} - 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_deserializeOpDocumentRegisterClientOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorRegisterClient(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("InvalidClientMetadataException", errorCode): - return awsRestjson1_deserializeErrorInvalidClientMetadataException(response, errorBody) - - case strings.EqualFold("InvalidRedirectUriException", errorCode): - return awsRestjson1_deserializeErrorInvalidRedirectUriException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("InvalidScopeException", errorCode): - return awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody) - - case strings.EqualFold("SlowDownException", errorCode): - return awsRestjson1_deserializeErrorSlowDownException(response, errorBody) - - case strings.EqualFold("UnsupportedGrantTypeException", errorCode): - return awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentRegisterClientOutput(v **RegisterClientOutput, 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 *RegisterClientOutput - if *v == nil { - sv = &RegisterClientOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "authorizationEndpoint": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected URI to be of type string, got %T instead", value) - } - sv.AuthorizationEndpoint = ptr.String(jtv) - } - - case "clientId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClientId to be of type string, got %T instead", value) - } - sv.ClientId = ptr.String(jtv) - } - - case "clientIdIssuedAt": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected LongTimeStampType to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ClientIdIssuedAt = i64 - } - - case "clientSecret": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClientSecret to be of type string, got %T instead", value) - } - sv.ClientSecret = ptr.String(jtv) - } - - case "clientSecretExpiresAt": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected LongTimeStampType to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ClientSecretExpiresAt = i64 - } - - case "tokenEndpoint": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected URI to be of type string, got %T instead", value) - } - sv.TokenEndpoint = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpStartDeviceAuthorization struct { -} - -func (*awsRestjson1_deserializeOpStartDeviceAuthorization) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpStartDeviceAuthorization) 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)} - } - - defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartDeviceAuthorization(response, &metadata) - } - output := &StartDeviceAuthorizationOutput{} - 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_deserializeOpDocumentStartDeviceAuthorizationOutput(&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(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorStartDeviceAuthorization(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("InvalidClientException", errorCode): - return awsRestjson1_deserializeErrorInvalidClientException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("SlowDownException", errorCode): - return awsRestjson1_deserializeErrorSlowDownException(response, errorBody) - - case strings.EqualFold("UnauthorizedClientException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentStartDeviceAuthorizationOutput(v **StartDeviceAuthorizationOutput, 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 *StartDeviceAuthorizationOutput - if *v == nil { - sv = &StartDeviceAuthorizationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "deviceCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DeviceCode to be of type string, got %T instead", value) - } - sv.DeviceCode = ptr.String(jtv) - } - - case "expiresIn": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected ExpirationInSeconds to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ExpiresIn = int32(i64) - } - - case "interval": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected IntervalInSeconds to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Interval = int32(i64) - } - - case "userCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UserCode to be of type string, got %T instead", value) - } - sv.UserCode = ptr.String(jtv) - } - - case "verificationUri": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected URI to be of type string, got %T instead", value) - } - sv.VerificationUri = ptr.String(jtv) - } - - case "verificationUriComplete": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected URI to be of type string, got %T instead", value) - } - sv.VerificationUriComplete = 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_deserializeErrorAuthorizationPendingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AuthorizationPendingException{} - 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_deserializeDocumentAuthorizationPendingException(&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_deserializeErrorExpiredTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ExpiredTokenException{} - 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_deserializeDocumentExpiredTokenException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalServerException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorInvalidClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidClientException{} - 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_deserializeDocumentInvalidClientException(&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_deserializeErrorInvalidClientMetadataException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidClientMetadataException{} - 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_deserializeDocumentInvalidClientMetadataException(&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_deserializeErrorInvalidGrantException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidGrantException{} - 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_deserializeDocumentInvalidGrantException(&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_deserializeErrorInvalidRedirectUriException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRedirectUriException{} - 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_deserializeDocumentInvalidRedirectUriException(&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_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRequestException{} - 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_deserializeDocumentInvalidRequestException(&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_deserializeErrorInvalidRequestRegionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRequestRegionException{} - 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_deserializeDocumentInvalidRequestRegionException(&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_deserializeErrorInvalidScopeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidScopeException{} - 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_deserializeDocumentInvalidScopeException(&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_deserializeErrorSlowDownException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.SlowDownException{} - 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_deserializeDocumentSlowDownException(&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_deserializeErrorUnauthorizedClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.UnauthorizedClientException{} - 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_deserializeDocumentUnauthorizedClientException(&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_deserializeErrorUnsupportedGrantTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.UnsupportedGrantTypeException{} - 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_deserializeDocumentUnsupportedGrantTypeException(&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 "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - case "reason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccessDeniedExceptionReason to be of type string, got %T instead", value) - } - sv.Reason = types.AccessDeniedExceptionReason(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAuthorizationPendingException(v **types.AuthorizationPendingException, 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.AuthorizationPendingException - if *v == nil { - sv = &types.AuthorizationPendingException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAwsAdditionalDetails(v **types.AwsAdditionalDetails, 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.AwsAdditionalDetails - if *v == nil { - sv = &types.AwsAdditionalDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "identityContext": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected IdentityContext to be of type string, got %T instead", value) - } - sv.IdentityContext = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, 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.ExpiredTokenException - if *v == nil { - sv = &types.ExpiredTokenException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InternalServerException - if *v == nil { - sv = &types.InternalServerException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidClientException(v **types.InvalidClientException, 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.InvalidClientException - if *v == nil { - sv = &types.InvalidClientException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidClientMetadataException(v **types.InvalidClientMetadataException, 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.InvalidClientMetadataException - if *v == nil { - sv = &types.InvalidClientMetadataException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidGrantException(v **types.InvalidGrantException, 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.InvalidGrantException - if *v == nil { - sv = &types.InvalidGrantException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidRedirectUriException(v **types.InvalidRedirectUriException, 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.InvalidRedirectUriException - if *v == nil { - sv = &types.InvalidRedirectUriException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, 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.InvalidRequestException - if *v == nil { - sv = &types.InvalidRequestException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - case "reason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InvalidRequestExceptionReason to be of type string, got %T instead", value) - } - sv.Reason = types.InvalidRequestExceptionReason(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidRequestRegionException(v **types.InvalidRequestRegionException, 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.InvalidRequestRegionException - if *v == nil { - sv = &types.InvalidRequestRegionException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "endpoint": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Location to be of type string, got %T instead", value) - } - sv.Endpoint = ptr.String(jtv) - } - - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - case "region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Region to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidScopeException(v **types.InvalidScopeException, 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.InvalidScopeException - if *v == nil { - sv = &types.InvalidScopeException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentScopes(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 Scope to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentSlowDownException(v **types.SlowDownException, 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.SlowDownException - if *v == nil { - sv = &types.SlowDownException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentUnauthorizedClientException(v **types.UnauthorizedClientException, 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.UnauthorizedClientException - if *v == nil { - sv = &types.UnauthorizedClientException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentUnsupportedGrantTypeException(v **types.UnsupportedGrantTypeException, 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.UnsupportedGrantTypeException - if *v == nil { - sv = &types.UnsupportedGrantTypeException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "error": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Error to be of type string, got %T instead", value) - } - sv.Error_ = ptr.String(jtv) - } - - case "error_description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) - } - sv.Error_description = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json index 8f46b38d3..7da504c03 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json @@ -13,7 +13,7 @@ "api_op_RegisterClient.go", "api_op_StartDeviceAuthorization.go", "auth.go", - "deserializers.go", + "common_serde.go", "doc.go", "endpoints.go", "endpoints_config_test.go", @@ -24,9 +24,12 @@ "options.go", "request_snapshot_test.go", "response_snapshot_test.go", - "serializers.go", + "response_snapshot_update_test.go", + "schemas/schemas.go", "snapshot_test.go", "sra_operation_order_test.go", + "type_registry.go", + "types/common_serde.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go index ae3957055..f76bb830c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go @@ -3,4 +3,4 @@ package ssooidc // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.43.1" +const goModuleVersion = "1.44.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go index 73a47ccfb..3901c834d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go @@ -119,6 +119,8 @@ type Options struct { // Currently does not support per operation call overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode + Protocol smithyhttp.ClientProtocol + // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas/schemas.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas/schemas.go new file mode 100644 index 000000000..151492cd0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas/schemas.go @@ -0,0 +1,694 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package schemas + +import ( + smithy "github.com/aws/smithy-go" + smithyprelude "github.com/aws/smithy-go/prelude" + smithytraits "github.com/aws/smithy-go/traits" +) + +var CreateToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "CreateToken", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/token", + Code: 200}) + +var CreateTokenWithIAM = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "CreateTokenWithIAM", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/token?aws_iam=t", + Code: 200}) + +var RegisterClient = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "RegisterClient", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/client/register", + Code: 200}) + +var StartDeviceAuthorization = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "StartDeviceAuthorization", +}, smithy.ShapeTypeOperation, 0, &smithytraits.HTTP{Method: "POST", + URI: "/device_authorization", + Code: 200}) + +var _AWSSSOOIDCService = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "AWSSSOOIDCService", +}, smithy.ShapeTypeService, 0) + +var AWSSSOOIDCService = smithy.NewServiceSchema(_AWSSSOOIDCService, "2019-06-10") + +var AccessDeniedException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "AccessDeniedException", +}, smithy.ShapeTypeStructure, 3, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var AccessDeniedException_error *smithy.Schema + +var AccessDeniedException_reason *smithy.Schema + +var AccessDeniedException_error_description *smithy.Schema + +var AccessDeniedExceptionReason = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "AccessDeniedExceptionReason", +}, smithy.ShapeTypeEnum, 1) +var AccessDeniedExceptionReason_KMS_ACCESS_DENIED *smithy.Schema + +var _AccessToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "AccessToken", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _ArnType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "ArnType", +}, smithy.ShapeTypeString, 0) + +var _Assertion = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "Assertion", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _AuthCode = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "AuthCode", +}, smithy.ShapeTypeString, 0) + +var AuthorizationPendingException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "AuthorizationPendingException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var AuthorizationPendingException_error *smithy.Schema + +var AuthorizationPendingException_error_description *smithy.Schema + +var AwsAdditionalDetails = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "AwsAdditionalDetails", +}, smithy.ShapeTypeStructure, 1) +var AwsAdditionalDetails_identityContext *smithy.Schema + +var _ClientId = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "ClientId", +}, smithy.ShapeTypeString, 0) + +var _ClientName = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "ClientName", +}, smithy.ShapeTypeString, 0) + +var _ClientSecret = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "ClientSecret", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _ClientType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "ClientType", +}, smithy.ShapeTypeString, 0) + +var _CodeVerifier = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "CodeVerifier", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _DeviceCode = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "DeviceCode", +}, smithy.ShapeTypeString, 0) + +var _Error = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "Error", +}, smithy.ShapeTypeString, 0) + +var _ErrorDescription = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "ErrorDescription", +}, smithy.ShapeTypeString, 0) + +var _ExpirationInSeconds = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "ExpirationInSeconds", +}, smithy.ShapeTypeInteger, 0) + +var ExpiredTokenException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "ExpiredTokenException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var ExpiredTokenException_error *smithy.Schema + +var ExpiredTokenException_error_description *smithy.Schema + +var _GrantType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "GrantType", +}, smithy.ShapeTypeString, 0) + +var _GrantTypes = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "GrantTypes", +}, smithy.ShapeTypeList, 1) +var _GrantTypes_member *smithy.Schema + +var _IdentityContext = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "IdentityContext", +}, smithy.ShapeTypeString, 0) + +var _IdToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "IdToken", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var InternalServerException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "InternalServerException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "server"}, + &smithytraits.HTTPError{Code: 500}) +var InternalServerException_error *smithy.Schema + +var InternalServerException_error_description *smithy.Schema + +var _IntervalInSeconds = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "IntervalInSeconds", +}, smithy.ShapeTypeInteger, 0) + +var InvalidClientException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "InvalidClientException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 401}) +var InvalidClientException_error *smithy.Schema + +var InvalidClientException_error_description *smithy.Schema + +var InvalidClientMetadataException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "InvalidClientMetadataException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var InvalidClientMetadataException_error *smithy.Schema + +var InvalidClientMetadataException_error_description *smithy.Schema + +var InvalidGrantException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "InvalidGrantException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var InvalidGrantException_error *smithy.Schema + +var InvalidGrantException_error_description *smithy.Schema + +var InvalidRedirectUriException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "InvalidRedirectUriException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var InvalidRedirectUriException_error *smithy.Schema + +var InvalidRedirectUriException_error_description *smithy.Schema + +var InvalidRequestException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "InvalidRequestException", +}, smithy.ShapeTypeStructure, 3, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var InvalidRequestException_error *smithy.Schema + +var InvalidRequestException_reason *smithy.Schema + +var InvalidRequestException_error_description *smithy.Schema + +var InvalidRequestExceptionReason = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "InvalidRequestExceptionReason", +}, smithy.ShapeTypeEnum, 4) +var InvalidRequestExceptionReason_KMS_KEY_NOT_FOUND *smithy.Schema + +var InvalidRequestExceptionReason_KMS_INVALID_KEY_USAGE *smithy.Schema + +var InvalidRequestExceptionReason_KMS_INVALID_STATE *smithy.Schema + +var InvalidRequestExceptionReason_KMS_DISABLED_KEY *smithy.Schema + +var InvalidRequestRegionException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "InvalidRequestRegionException", +}, smithy.ShapeTypeStructure, 4, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var InvalidRequestRegionException_error *smithy.Schema + +var InvalidRequestRegionException_error_description *smithy.Schema + +var InvalidRequestRegionException_endpoint *smithy.Schema + +var InvalidRequestRegionException_region *smithy.Schema + +var InvalidScopeException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "InvalidScopeException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var InvalidScopeException_error *smithy.Schema + +var InvalidScopeException_error_description *smithy.Schema + +var _Location = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "Location", +}, smithy.ShapeTypeString, 0) + +var _LongTimeStampType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "LongTimeStampType", +}, smithy.ShapeTypeLong, 0) + +var _RedirectUris = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "RedirectUris", +}, smithy.ShapeTypeList, 1) +var _RedirectUris_member *smithy.Schema + +var _RefreshToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "RefreshToken", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _Region = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "Region", +}, smithy.ShapeTypeString, 0) + +var _Scope = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "Scope", +}, smithy.ShapeTypeString, 0) + +var _Scopes = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "Scopes", +}, smithy.ShapeTypeList, 1) +var _Scopes_member *smithy.Schema + +var SlowDownException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "SlowDownException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var SlowDownException_error *smithy.Schema + +var SlowDownException_error_description *smithy.Schema + +var _SubjectToken = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "SubjectToken", +}, smithy.ShapeTypeString, 0, &smithytraits.Sensitive{}) + +var _TokenType = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "TokenType", +}, smithy.ShapeTypeString, 0) + +var _TokenTypeURI = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "TokenTypeURI", +}, smithy.ShapeTypeString, 0) + +var UnauthorizedClientException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "UnauthorizedClientException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var UnauthorizedClientException_error *smithy.Schema + +var UnauthorizedClientException_error_description *smithy.Schema + +var UnsupportedGrantTypeException = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "UnsupportedGrantTypeException", +}, smithy.ShapeTypeStructure, 2, &smithytraits.Error{Type: "client"}, + &smithytraits.HTTPError{Code: 400}) +var UnsupportedGrantTypeException_error *smithy.Schema + +var UnsupportedGrantTypeException_error_description *smithy.Schema + +var _URI = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "URI", +}, smithy.ShapeTypeString, 0) + +var _UserCode = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "UserCode", +}, smithy.ShapeTypeString, 0) + +var CreateTokenRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "CreateTokenRequest", +}, smithy.ShapeTypeStructure, 9) +var CreateTokenRequest_clientId *smithy.Schema + +var CreateTokenRequest_clientSecret *smithy.Schema + +var CreateTokenRequest_grantType *smithy.Schema + +var CreateTokenRequest_deviceCode *smithy.Schema + +var CreateTokenRequest_code *smithy.Schema + +var CreateTokenRequest_refreshToken *smithy.Schema + +var CreateTokenRequest_scope *smithy.Schema + +var CreateTokenRequest_redirectUri *smithy.Schema + +var CreateTokenRequest_codeVerifier *smithy.Schema + +var CreateTokenResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "CreateTokenResponse", +}, smithy.ShapeTypeStructure, 5) +var CreateTokenResponse_accessToken *smithy.Schema + +var CreateTokenResponse_tokenType *smithy.Schema + +var CreateTokenResponse_expiresIn *smithy.Schema + +var CreateTokenResponse_refreshToken *smithy.Schema + +var CreateTokenResponse_idToken *smithy.Schema + +var CreateTokenWithIAMRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "CreateTokenWithIAMRequest", +}, smithy.ShapeTypeStructure, 11) +var CreateTokenWithIAMRequest_clientId *smithy.Schema + +var CreateTokenWithIAMRequest_grantType *smithy.Schema + +var CreateTokenWithIAMRequest_code *smithy.Schema + +var CreateTokenWithIAMRequest_refreshToken *smithy.Schema + +var CreateTokenWithIAMRequest_assertion *smithy.Schema + +var CreateTokenWithIAMRequest_scope *smithy.Schema + +var CreateTokenWithIAMRequest_redirectUri *smithy.Schema + +var CreateTokenWithIAMRequest_subjectToken *smithy.Schema + +var CreateTokenWithIAMRequest_subjectTokenType *smithy.Schema + +var CreateTokenWithIAMRequest_requestedTokenType *smithy.Schema + +var CreateTokenWithIAMRequest_codeVerifier *smithy.Schema + +var CreateTokenWithIAMResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "CreateTokenWithIAMResponse", +}, smithy.ShapeTypeStructure, 8) +var CreateTokenWithIAMResponse_accessToken *smithy.Schema + +var CreateTokenWithIAMResponse_tokenType *smithy.Schema + +var CreateTokenWithIAMResponse_expiresIn *smithy.Schema + +var CreateTokenWithIAMResponse_refreshToken *smithy.Schema + +var CreateTokenWithIAMResponse_idToken *smithy.Schema + +var CreateTokenWithIAMResponse_issuedTokenType *smithy.Schema + +var CreateTokenWithIAMResponse_scope *smithy.Schema + +var CreateTokenWithIAMResponse_awsAdditionalDetails *smithy.Schema + +var RegisterClientRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "RegisterClientRequest", +}, smithy.ShapeTypeStructure, 7) +var RegisterClientRequest_clientName *smithy.Schema + +var RegisterClientRequest_clientType *smithy.Schema + +var RegisterClientRequest_scopes *smithy.Schema + +var RegisterClientRequest_redirectUris *smithy.Schema + +var RegisterClientRequest_grantTypes *smithy.Schema + +var RegisterClientRequest_issuerUrl *smithy.Schema + +var RegisterClientRequest_entitledApplicationArn *smithy.Schema + +var RegisterClientResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "RegisterClientResponse", +}, smithy.ShapeTypeStructure, 6) +var RegisterClientResponse_clientId *smithy.Schema + +var RegisterClientResponse_clientSecret *smithy.Schema + +var RegisterClientResponse_clientIdIssuedAt *smithy.Schema + +var RegisterClientResponse_clientSecretExpiresAt *smithy.Schema + +var RegisterClientResponse_authorizationEndpoint *smithy.Schema + +var RegisterClientResponse_tokenEndpoint *smithy.Schema + +var StartDeviceAuthorizationRequest = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "StartDeviceAuthorizationRequest", +}, smithy.ShapeTypeStructure, 3) +var StartDeviceAuthorizationRequest_clientId *smithy.Schema + +var StartDeviceAuthorizationRequest_clientSecret *smithy.Schema + +var StartDeviceAuthorizationRequest_startUrl *smithy.Schema + +var StartDeviceAuthorizationResponse = smithy.NewSchema(smithy.ShapeID{ + Namespace: "com.amazonaws.ssooidc", + Name: "StartDeviceAuthorizationResponse", +}, smithy.ShapeTypeStructure, 6) +var StartDeviceAuthorizationResponse_deviceCode *smithy.Schema + +var StartDeviceAuthorizationResponse_userCode *smithy.Schema + +var StartDeviceAuthorizationResponse_verificationUri *smithy.Schema + +var StartDeviceAuthorizationResponse_verificationUriComplete *smithy.Schema + +var StartDeviceAuthorizationResponse_expiresIn *smithy.Schema + +var StartDeviceAuthorizationResponse_interval *smithy.Schema + +// Initialize schema members after all schemas are declared to avoid +// initialization cycles +func init() { + AccessDeniedExceptionReason_KMS_ACCESS_DENIED = AccessDeniedExceptionReason.AddMember("KMS_ACCESS_DENIED", smithyprelude.Unit) + + AccessDeniedException_error = AccessDeniedException.AddMember("error", _Error) + + AccessDeniedException_reason = AccessDeniedException.AddMember("reason", AccessDeniedExceptionReason) + + AccessDeniedException_error_description = AccessDeniedException.AddMember("error_description", _ErrorDescription) + + AuthorizationPendingException_error = AuthorizationPendingException.AddMember("error", _Error) + + AuthorizationPendingException_error_description = AuthorizationPendingException.AddMember("error_description", _ErrorDescription) + + AwsAdditionalDetails_identityContext = AwsAdditionalDetails.AddMember("identityContext", _IdentityContext) + + ExpiredTokenException_error = ExpiredTokenException.AddMember("error", _Error) + + ExpiredTokenException_error_description = ExpiredTokenException.AddMember("error_description", _ErrorDescription) + + _GrantTypes_member = _GrantTypes.AddMember("member", _GrantType) + + InternalServerException_error = InternalServerException.AddMember("error", _Error) + + InternalServerException_error_description = InternalServerException.AddMember("error_description", _ErrorDescription) + + InvalidClientException_error = InvalidClientException.AddMember("error", _Error) + + InvalidClientException_error_description = InvalidClientException.AddMember("error_description", _ErrorDescription) + + InvalidClientMetadataException_error = InvalidClientMetadataException.AddMember("error", _Error) + + InvalidClientMetadataException_error_description = InvalidClientMetadataException.AddMember("error_description", _ErrorDescription) + + InvalidGrantException_error = InvalidGrantException.AddMember("error", _Error) + + InvalidGrantException_error_description = InvalidGrantException.AddMember("error_description", _ErrorDescription) + + InvalidRedirectUriException_error = InvalidRedirectUriException.AddMember("error", _Error) + + InvalidRedirectUriException_error_description = InvalidRedirectUriException.AddMember("error_description", _ErrorDescription) + + InvalidRequestExceptionReason_KMS_KEY_NOT_FOUND = InvalidRequestExceptionReason.AddMember("KMS_KEY_NOT_FOUND", smithyprelude.Unit) + + InvalidRequestExceptionReason_KMS_INVALID_KEY_USAGE = InvalidRequestExceptionReason.AddMember("KMS_INVALID_KEY_USAGE", smithyprelude.Unit) + + InvalidRequestExceptionReason_KMS_INVALID_STATE = InvalidRequestExceptionReason.AddMember("KMS_INVALID_STATE", smithyprelude.Unit) + + InvalidRequestExceptionReason_KMS_DISABLED_KEY = InvalidRequestExceptionReason.AddMember("KMS_DISABLED_KEY", smithyprelude.Unit) + + InvalidRequestException_error = InvalidRequestException.AddMember("error", _Error) + + InvalidRequestException_reason = InvalidRequestException.AddMember("reason", InvalidRequestExceptionReason) + + InvalidRequestException_error_description = InvalidRequestException.AddMember("error_description", _ErrorDescription) + + InvalidRequestRegionException_error = InvalidRequestRegionException.AddMember("error", _Error) + + InvalidRequestRegionException_error_description = InvalidRequestRegionException.AddMember("error_description", _ErrorDescription) + + InvalidRequestRegionException_endpoint = InvalidRequestRegionException.AddMember("endpoint", _Location) + + InvalidRequestRegionException_region = InvalidRequestRegionException.AddMember("region", _Region) + + InvalidScopeException_error = InvalidScopeException.AddMember("error", _Error) + + InvalidScopeException_error_description = InvalidScopeException.AddMember("error_description", _ErrorDescription) + + _RedirectUris_member = _RedirectUris.AddMember("member", _URI) + + _Scopes_member = _Scopes.AddMember("member", _Scope) + + SlowDownException_error = SlowDownException.AddMember("error", _Error) + + SlowDownException_error_description = SlowDownException.AddMember("error_description", _ErrorDescription) + + UnauthorizedClientException_error = UnauthorizedClientException.AddMember("error", _Error) + + UnauthorizedClientException_error_description = UnauthorizedClientException.AddMember("error_description", _ErrorDescription) + + UnsupportedGrantTypeException_error = UnsupportedGrantTypeException.AddMember("error", _Error) + + UnsupportedGrantTypeException_error_description = UnsupportedGrantTypeException.AddMember("error_description", _ErrorDescription) + + CreateTokenRequest_clientId = CreateTokenRequest.AddMember("clientId", _ClientId) + + CreateTokenRequest_clientSecret = CreateTokenRequest.AddMember("clientSecret", _ClientSecret) + + CreateTokenRequest_grantType = CreateTokenRequest.AddMember("grantType", _GrantType) + + CreateTokenRequest_deviceCode = CreateTokenRequest.AddMember("deviceCode", _DeviceCode) + + CreateTokenRequest_code = CreateTokenRequest.AddMember("code", _AuthCode) + + CreateTokenRequest_refreshToken = CreateTokenRequest.AddMember("refreshToken", _RefreshToken) + + CreateTokenRequest_scope = CreateTokenRequest.AddMember("scope", _Scopes) + + CreateTokenRequest_redirectUri = CreateTokenRequest.AddMember("redirectUri", _URI) + + CreateTokenRequest_codeVerifier = CreateTokenRequest.AddMember("codeVerifier", _CodeVerifier) + + CreateTokenResponse_accessToken = CreateTokenResponse.AddMember("accessToken", _AccessToken) + + CreateTokenResponse_tokenType = CreateTokenResponse.AddMember("tokenType", _TokenType) + + CreateTokenResponse_expiresIn = CreateTokenResponse.AddMember("expiresIn", _ExpirationInSeconds) + + CreateTokenResponse_refreshToken = CreateTokenResponse.AddMember("refreshToken", _RefreshToken) + + CreateTokenResponse_idToken = CreateTokenResponse.AddMember("idToken", _IdToken) + + CreateTokenWithIAMRequest_clientId = CreateTokenWithIAMRequest.AddMember("clientId", _ClientId) + + CreateTokenWithIAMRequest_grantType = CreateTokenWithIAMRequest.AddMember("grantType", _GrantType) + + CreateTokenWithIAMRequest_code = CreateTokenWithIAMRequest.AddMember("code", _AuthCode) + + CreateTokenWithIAMRequest_refreshToken = CreateTokenWithIAMRequest.AddMember("refreshToken", _RefreshToken) + + CreateTokenWithIAMRequest_assertion = CreateTokenWithIAMRequest.AddMember("assertion", _Assertion) + + CreateTokenWithIAMRequest_scope = CreateTokenWithIAMRequest.AddMember("scope", _Scopes) + + CreateTokenWithIAMRequest_redirectUri = CreateTokenWithIAMRequest.AddMember("redirectUri", _URI) + + CreateTokenWithIAMRequest_subjectToken = CreateTokenWithIAMRequest.AddMember("subjectToken", _SubjectToken) + + CreateTokenWithIAMRequest_subjectTokenType = CreateTokenWithIAMRequest.AddMember("subjectTokenType", _TokenTypeURI) + + CreateTokenWithIAMRequest_requestedTokenType = CreateTokenWithIAMRequest.AddMember("requestedTokenType", _TokenTypeURI) + + CreateTokenWithIAMRequest_codeVerifier = CreateTokenWithIAMRequest.AddMember("codeVerifier", _CodeVerifier) + + CreateTokenWithIAMResponse_accessToken = CreateTokenWithIAMResponse.AddMember("accessToken", _AccessToken) + + CreateTokenWithIAMResponse_tokenType = CreateTokenWithIAMResponse.AddMember("tokenType", _TokenType) + + CreateTokenWithIAMResponse_expiresIn = CreateTokenWithIAMResponse.AddMember("expiresIn", _ExpirationInSeconds) + + CreateTokenWithIAMResponse_refreshToken = CreateTokenWithIAMResponse.AddMember("refreshToken", _RefreshToken) + + CreateTokenWithIAMResponse_idToken = CreateTokenWithIAMResponse.AddMember("idToken", _IdToken) + + CreateTokenWithIAMResponse_issuedTokenType = CreateTokenWithIAMResponse.AddMember("issuedTokenType", _TokenTypeURI) + + CreateTokenWithIAMResponse_scope = CreateTokenWithIAMResponse.AddMember("scope", _Scopes) + + CreateTokenWithIAMResponse_awsAdditionalDetails = CreateTokenWithIAMResponse.AddMember("awsAdditionalDetails", AwsAdditionalDetails) + + RegisterClientRequest_clientName = RegisterClientRequest.AddMember("clientName", _ClientName) + + RegisterClientRequest_clientType = RegisterClientRequest.AddMember("clientType", _ClientType) + + RegisterClientRequest_scopes = RegisterClientRequest.AddMember("scopes", _Scopes) + + RegisterClientRequest_redirectUris = RegisterClientRequest.AddMember("redirectUris", _RedirectUris) + + RegisterClientRequest_grantTypes = RegisterClientRequest.AddMember("grantTypes", _GrantTypes) + + RegisterClientRequest_issuerUrl = RegisterClientRequest.AddMember("issuerUrl", _URI) + + RegisterClientRequest_entitledApplicationArn = RegisterClientRequest.AddMember("entitledApplicationArn", _ArnType) + + RegisterClientResponse_clientId = RegisterClientResponse.AddMember("clientId", _ClientId) + + RegisterClientResponse_clientSecret = RegisterClientResponse.AddMember("clientSecret", _ClientSecret) + + RegisterClientResponse_clientIdIssuedAt = RegisterClientResponse.AddMember("clientIdIssuedAt", _LongTimeStampType) + + RegisterClientResponse_clientSecretExpiresAt = RegisterClientResponse.AddMember("clientSecretExpiresAt", _LongTimeStampType) + + RegisterClientResponse_authorizationEndpoint = RegisterClientResponse.AddMember("authorizationEndpoint", _URI) + + RegisterClientResponse_tokenEndpoint = RegisterClientResponse.AddMember("tokenEndpoint", _URI) + + StartDeviceAuthorizationRequest_clientId = StartDeviceAuthorizationRequest.AddMember("clientId", _ClientId) + + StartDeviceAuthorizationRequest_clientSecret = StartDeviceAuthorizationRequest.AddMember("clientSecret", _ClientSecret) + + StartDeviceAuthorizationRequest_startUrl = StartDeviceAuthorizationRequest.AddMember("startUrl", _URI) + + StartDeviceAuthorizationResponse_deviceCode = StartDeviceAuthorizationResponse.AddMember("deviceCode", _DeviceCode) + + StartDeviceAuthorizationResponse_userCode = StartDeviceAuthorizationResponse.AddMember("userCode", _UserCode) + + StartDeviceAuthorizationResponse_verificationUri = StartDeviceAuthorizationResponse.AddMember("verificationUri", _URI) + + StartDeviceAuthorizationResponse_verificationUriComplete = StartDeviceAuthorizationResponse.AddMember("verificationUriComplete", _URI) + + StartDeviceAuthorizationResponse_expiresIn = StartDeviceAuthorizationResponse.AddMember("expiresIn", _ExpirationInSeconds) + + StartDeviceAuthorizationResponse_interval = StartDeviceAuthorizationResponse.AddMember("interval", _IntervalInSeconds) + +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go deleted file mode 100644 index 1ad103d1e..000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go +++ /dev/null @@ -1,512 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package ssooidc - -import ( - "bytes" - "context" - "fmt" - 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" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -type awsRestjson1_serializeOpCreateToken struct { -} - -func (*awsRestjson1_serializeOpCreateToken) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*CreateTokenInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/token") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateTokenInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateTokenInput(v *CreateTokenInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateTokenInput(v *CreateTokenInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientId != nil { - ok := object.Key("clientId") - ok.String(*v.ClientId) - } - - if v.ClientSecret != nil { - ok := object.Key("clientSecret") - ok.String(*v.ClientSecret) - } - - if v.Code != nil { - ok := object.Key("code") - ok.String(*v.Code) - } - - if v.CodeVerifier != nil { - ok := object.Key("codeVerifier") - ok.String(*v.CodeVerifier) - } - - if v.DeviceCode != nil { - ok := object.Key("deviceCode") - ok.String(*v.DeviceCode) - } - - if v.GrantType != nil { - ok := object.Key("grantType") - ok.String(*v.GrantType) - } - - if v.RedirectUri != nil { - ok := object.Key("redirectUri") - ok.String(*v.RedirectUri) - } - - if v.RefreshToken != nil { - ok := object.Key("refreshToken") - ok.String(*v.RefreshToken) - } - - if v.Scope != nil { - ok := object.Key("scope") - if err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpCreateTokenWithIAM struct { -} - -func (*awsRestjson1_serializeOpCreateTokenWithIAM) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateTokenWithIAM) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*CreateTokenWithIAMInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/token?aws_iam=t") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Assertion != nil { - ok := object.Key("assertion") - ok.String(*v.Assertion) - } - - if v.ClientId != nil { - ok := object.Key("clientId") - ok.String(*v.ClientId) - } - - if v.Code != nil { - ok := object.Key("code") - ok.String(*v.Code) - } - - if v.CodeVerifier != nil { - ok := object.Key("codeVerifier") - ok.String(*v.CodeVerifier) - } - - if v.GrantType != nil { - ok := object.Key("grantType") - ok.String(*v.GrantType) - } - - if v.RedirectUri != nil { - ok := object.Key("redirectUri") - ok.String(*v.RedirectUri) - } - - if v.RefreshToken != nil { - ok := object.Key("refreshToken") - ok.String(*v.RefreshToken) - } - - if v.RequestedTokenType != nil { - ok := object.Key("requestedTokenType") - ok.String(*v.RequestedTokenType) - } - - if v.Scope != nil { - ok := object.Key("scope") - if err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil { - return err - } - } - - if v.SubjectToken != nil { - ok := object.Key("subjectToken") - ok.String(*v.SubjectToken) - } - - if v.SubjectTokenType != nil { - ok := object.Key("subjectTokenType") - ok.String(*v.SubjectTokenType) - } - - return nil -} - -type awsRestjson1_serializeOpRegisterClient struct { -} - -func (*awsRestjson1_serializeOpRegisterClient) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpRegisterClient) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*RegisterClientInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/client/register") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentRegisterClientInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsRegisterClientInput(v *RegisterClientInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentRegisterClientInput(v *RegisterClientInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientName != nil { - ok := object.Key("clientName") - ok.String(*v.ClientName) - } - - if v.ClientType != nil { - ok := object.Key("clientType") - ok.String(*v.ClientType) - } - - if v.EntitledApplicationArn != nil { - ok := object.Key("entitledApplicationArn") - ok.String(*v.EntitledApplicationArn) - } - - if v.GrantTypes != nil { - ok := object.Key("grantTypes") - if err := awsRestjson1_serializeDocumentGrantTypes(v.GrantTypes, ok); err != nil { - return err - } - } - - if v.IssuerUrl != nil { - ok := object.Key("issuerUrl") - ok.String(*v.IssuerUrl) - } - - if v.RedirectUris != nil { - ok := object.Key("redirectUris") - if err := awsRestjson1_serializeDocumentRedirectUris(v.RedirectUris, ok); err != nil { - return err - } - } - - if v.Scopes != nil { - ok := object.Key("scopes") - if err := awsRestjson1_serializeDocumentScopes(v.Scopes, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpStartDeviceAuthorization struct { -} - -func (*awsRestjson1_serializeOpStartDeviceAuthorization) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpStartDeviceAuthorization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - 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.(*StartDeviceAuthorizationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/device_authorization") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(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 - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientId != nil { - ok := object.Key("clientId") - ok.String(*v.ClientId) - } - - if v.ClientSecret != nil { - ok := object.Key("clientSecret") - ok.String(*v.ClientSecret) - } - - if v.StartUrl != nil { - ok := object.Key("startUrl") - ok.String(*v.StartUrl) - } - - return nil -} - -func awsRestjson1_serializeDocumentGrantTypes(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_serializeDocumentRedirectUris(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_serializeDocumentScopes(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/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/type_registry.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/type_registry.go new file mode 100644 index 000000000..988a195da --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/type_registry.go @@ -0,0 +1,71 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas" + "github.com/aws/aws-sdk-go-v2/service/ssooidc/types" + smithy "github.com/aws/smithy-go" +) + +// TypeRegistry is the type registry for this service. +var TypeRegistry = &smithy.TypeRegistry{ + Entries: map[string]*smithy.TypeRegistryEntry{ + "com.amazonaws.ssooidc#AccessDeniedException": { + Schema: schemas.AccessDeniedException, + New: func() any { return &types.AccessDeniedException{} }, + }, + "com.amazonaws.ssooidc#AuthorizationPendingException": { + Schema: schemas.AuthorizationPendingException, + New: func() any { return &types.AuthorizationPendingException{} }, + }, + "com.amazonaws.ssooidc#ExpiredTokenException": { + Schema: schemas.ExpiredTokenException, + New: func() any { return &types.ExpiredTokenException{} }, + }, + "com.amazonaws.ssooidc#InternalServerException": { + Schema: schemas.InternalServerException, + New: func() any { return &types.InternalServerException{} }, + }, + "com.amazonaws.ssooidc#InvalidClientException": { + Schema: schemas.InvalidClientException, + New: func() any { return &types.InvalidClientException{} }, + }, + "com.amazonaws.ssooidc#InvalidClientMetadataException": { + Schema: schemas.InvalidClientMetadataException, + New: func() any { return &types.InvalidClientMetadataException{} }, + }, + "com.amazonaws.ssooidc#InvalidGrantException": { + Schema: schemas.InvalidGrantException, + New: func() any { return &types.InvalidGrantException{} }, + }, + "com.amazonaws.ssooidc#InvalidRedirectUriException": { + Schema: schemas.InvalidRedirectUriException, + New: func() any { return &types.InvalidRedirectUriException{} }, + }, + "com.amazonaws.ssooidc#InvalidRequestException": { + Schema: schemas.InvalidRequestException, + New: func() any { return &types.InvalidRequestException{} }, + }, + "com.amazonaws.ssooidc#InvalidRequestRegionException": { + Schema: schemas.InvalidRequestRegionException, + New: func() any { return &types.InvalidRequestRegionException{} }, + }, + "com.amazonaws.ssooidc#InvalidScopeException": { + Schema: schemas.InvalidScopeException, + New: func() any { return &types.InvalidScopeException{} }, + }, + "com.amazonaws.ssooidc#SlowDownException": { + Schema: schemas.SlowDownException, + New: func() any { return &types.SlowDownException{} }, + }, + "com.amazonaws.ssooidc#UnauthorizedClientException": { + Schema: schemas.UnauthorizedClientException, + New: func() any { return &types.UnauthorizedClientException{} }, + }, + "com.amazonaws.ssooidc#UnsupportedGrantTypeException": { + Schema: schemas.UnsupportedGrantTypeException, + New: func() any { return &types.UnsupportedGrantTypeException{} }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/common_serde.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/common_serde.go new file mode 100644 index 000000000..913a7c6b0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/common_serde.go @@ -0,0 +1,103 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithy "github.com/aws/smithy-go" +) + +func serializeGrantTypes(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeRedirectUris(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func serializeScopes(s smithy.ShapeSerializer, schema *smithy.Schema, v []string) { + if v == nil { + return + } + s.WriteList(schema) + for _, vv := range v { + s.WriteString(schema.ListMember(), string(vv)) + } + s.CloseList() +} + +func deserializeGrantTypes(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero string + *v = append(*v, zero) + return nil + } + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeRedirectUris(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero string + *v = append(*v, zero) + return nil + } + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} + +func deserializeScopes(d smithy.ShapeDeserializer, s *smithy.Schema, v *[]string) error { + *v = make([]string, 0) + var vv string + return smithy.ReadList(d, s, func() error { + if isNil, err := d.ReadNil(s.ListMember()); err != nil { + return err + } else if isNil { + var zero string + *v = append(*v, zero) + return nil + } + + if err := d.ReadString(s.ListMember(), &vv); err != nil { + return err + } + + *v = append(*v, vv) + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go index a1a3c7ef0..f9eef534d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go @@ -4,6 +4,7 @@ package types import ( "fmt" + "github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas" smithy "github.com/aws/smithy-go" ) @@ -36,6 +37,43 @@ func (e *AccessDeniedException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *AccessDeniedException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AccessDeniedException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AccessDeniedException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.AccessDeniedException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.AccessDeniedException_error_description, *v.Error_description) + } + if v.Reason != "" { + s.WriteString(schemas.AccessDeniedException_reason, string(v.Reason)) + } +} +func (v *AccessDeniedException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AccessDeniedException, func(s *smithy.Schema) error { + switch s { + case schemas.AccessDeniedException_error: + v.Error_ = new(string) + return d.ReadString(schemas.AccessDeniedException_error, v.Error_) + case schemas.AccessDeniedException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.AccessDeniedException_error_description, v.Error_description) + case schemas.AccessDeniedException_reason: + var ev string + if err := d.ReadString(schemas.AccessDeniedException_reason, &ev); err != nil { + return err + } + v.Reason = AccessDeniedExceptionReason(ev) + return nil + } + return nil + }) +} // Indicates that a request to authorize a client with an access user session // token is pending. @@ -66,6 +104,33 @@ func (e *AuthorizationPendingException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *AuthorizationPendingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *AuthorizationPendingException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AuthorizationPendingException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AuthorizationPendingException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.AuthorizationPendingException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.AuthorizationPendingException_error_description, *v.Error_description) + } +} +func (v *AuthorizationPendingException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AuthorizationPendingException, func(s *smithy.Schema) error { + switch s { + case schemas.AuthorizationPendingException_error: + v.Error_ = new(string) + return d.ReadString(schemas.AuthorizationPendingException_error, v.Error_) + case schemas.AuthorizationPendingException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.AuthorizationPendingException_error_description, v.Error_description) + } + return nil + }) +} // Indicates that the token issued by the service is expired and is no longer // valid. @@ -96,6 +161,33 @@ func (e *ExpiredTokenException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *ExpiredTokenException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.ExpiredTokenException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *ExpiredTokenException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.ExpiredTokenException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.ExpiredTokenException_error_description, *v.Error_description) + } +} +func (v *ExpiredTokenException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.ExpiredTokenException, func(s *smithy.Schema) error { + switch s { + case schemas.ExpiredTokenException_error: + v.Error_ = new(string) + return d.ReadString(schemas.ExpiredTokenException_error, v.Error_) + case schemas.ExpiredTokenException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.ExpiredTokenException_error_description, v.Error_description) + } + return nil + }) +} // Indicates that an error from the service occurred while trying to process a // request. @@ -126,6 +218,33 @@ func (e *InternalServerException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +func (v *InternalServerException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InternalServerException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InternalServerException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.InternalServerException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.InternalServerException_error_description, *v.Error_description) + } +} +func (v *InternalServerException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InternalServerException, func(s *smithy.Schema) error { + switch s { + case schemas.InternalServerException_error: + v.Error_ = new(string) + return d.ReadString(schemas.InternalServerException_error, v.Error_) + case schemas.InternalServerException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.InternalServerException_error_description, v.Error_description) + } + return nil + }) +} // Indicates that the clientId or clientSecret in the request is invalid. For // example, this can occur when a client sends an incorrect clientId or an expired @@ -157,6 +276,33 @@ func (e *InvalidClientException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InvalidClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidClientException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidClientException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidClientException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.InvalidClientException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.InvalidClientException_error_description, *v.Error_description) + } +} +func (v *InvalidClientException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidClientException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidClientException_error: + v.Error_ = new(string) + return d.ReadString(schemas.InvalidClientException_error, v.Error_) + case schemas.InvalidClientException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.InvalidClientException_error_description, v.Error_description) + } + return nil + }) +} // Indicates that the client information sent in the request during registration // is invalid. @@ -187,6 +333,33 @@ func (e *InvalidClientMetadataException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InvalidClientMetadataException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidClientMetadataException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidClientMetadataException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidClientMetadataException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.InvalidClientMetadataException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.InvalidClientMetadataException_error_description, *v.Error_description) + } +} +func (v *InvalidClientMetadataException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidClientMetadataException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidClientMetadataException_error: + v.Error_ = new(string) + return d.ReadString(schemas.InvalidClientMetadataException_error, v.Error_) + case schemas.InvalidClientMetadataException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.InvalidClientMetadataException_error_description, v.Error_description) + } + return nil + }) +} // Indicates that a request contains an invalid grant. This can occur if a client // makes a CreateTokenrequest with an invalid grant type. @@ -217,6 +390,33 @@ func (e *InvalidGrantException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InvalidGrantException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidGrantException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidGrantException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidGrantException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.InvalidGrantException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.InvalidGrantException_error_description, *v.Error_description) + } +} +func (v *InvalidGrantException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidGrantException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidGrantException_error: + v.Error_ = new(string) + return d.ReadString(schemas.InvalidGrantException_error, v.Error_) + case schemas.InvalidGrantException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.InvalidGrantException_error_description, v.Error_description) + } + return nil + }) +} // Indicates that one or more redirect URI in the request is not supported for // this operation. @@ -247,6 +447,33 @@ func (e *InvalidRedirectUriException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InvalidRedirectUriException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidRedirectUriException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidRedirectUriException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidRedirectUriException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.InvalidRedirectUriException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.InvalidRedirectUriException_error_description, *v.Error_description) + } +} +func (v *InvalidRedirectUriException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidRedirectUriException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidRedirectUriException_error: + v.Error_ = new(string) + return d.ReadString(schemas.InvalidRedirectUriException_error, v.Error_) + case schemas.InvalidRedirectUriException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.InvalidRedirectUriException_error_description, v.Error_description) + } + return nil + }) +} // Indicates that something is wrong with the input to the request. For example, a // required parameter might be missing or out of range. @@ -278,6 +505,43 @@ func (e *InvalidRequestException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidRequestException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidRequestException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidRequestException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.InvalidRequestException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.InvalidRequestException_error_description, *v.Error_description) + } + if v.Reason != "" { + s.WriteString(schemas.InvalidRequestException_reason, string(v.Reason)) + } +} +func (v *InvalidRequestException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidRequestException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidRequestException_error: + v.Error_ = new(string) + return d.ReadString(schemas.InvalidRequestException_error, v.Error_) + case schemas.InvalidRequestException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.InvalidRequestException_error_description, v.Error_description) + case schemas.InvalidRequestException_reason: + var ev string + if err := d.ReadString(schemas.InvalidRequestException_reason, &ev); err != nil { + return err + } + v.Reason = InvalidRequestExceptionReason(ev) + return nil + } + return nil + }) +} // Indicates that a token provided as input to the request was issued by and is // only usable by calling IAM Identity Center endpoints in another region. @@ -310,6 +574,45 @@ func (e *InvalidRequestRegionException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InvalidRequestRegionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidRequestRegionException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidRequestRegionException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidRequestRegionException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Endpoint != nil { + s.WriteString(schemas.InvalidRequestRegionException_endpoint, *v.Endpoint) + } + if v.Error_ != nil { + s.WriteString(schemas.InvalidRequestRegionException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.InvalidRequestRegionException_error_description, *v.Error_description) + } + if v.Region != nil { + s.WriteString(schemas.InvalidRequestRegionException_region, *v.Region) + } +} +func (v *InvalidRequestRegionException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidRequestRegionException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidRequestRegionException_endpoint: + v.Endpoint = new(string) + return d.ReadString(schemas.InvalidRequestRegionException_endpoint, v.Endpoint) + case schemas.InvalidRequestRegionException_error: + v.Error_ = new(string) + return d.ReadString(schemas.InvalidRequestRegionException_error, v.Error_) + case schemas.InvalidRequestRegionException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.InvalidRequestRegionException_error_description, v.Error_description) + case schemas.InvalidRequestRegionException_region: + v.Region = new(string) + return d.ReadString(schemas.InvalidRequestRegionException_region, v.Region) + } + return nil + }) +} // Indicates that the scope provided in the request is invalid. type InvalidScopeException struct { @@ -339,6 +642,33 @@ func (e *InvalidScopeException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *InvalidScopeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *InvalidScopeException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.InvalidScopeException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *InvalidScopeException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.InvalidScopeException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.InvalidScopeException_error_description, *v.Error_description) + } +} +func (v *InvalidScopeException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.InvalidScopeException, func(s *smithy.Schema) error { + switch s { + case schemas.InvalidScopeException_error: + v.Error_ = new(string) + return d.ReadString(schemas.InvalidScopeException_error, v.Error_) + case schemas.InvalidScopeException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.InvalidScopeException_error_description, v.Error_description) + } + return nil + }) +} // Indicates that the client is making the request too frequently and is more than // the service can handle. @@ -369,6 +699,33 @@ func (e *SlowDownException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *SlowDownException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *SlowDownException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.SlowDownException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *SlowDownException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.SlowDownException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.SlowDownException_error_description, *v.Error_description) + } +} +func (v *SlowDownException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.SlowDownException, func(s *smithy.Schema) error { + switch s { + case schemas.SlowDownException_error: + v.Error_ = new(string) + return d.ReadString(schemas.SlowDownException_error, v.Error_) + case schemas.SlowDownException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.SlowDownException_error_description, v.Error_description) + } + return nil + }) +} // Indicates that the client is not currently authorized to make the request. This // can happen when a clientId is not issued for a public client. @@ -399,6 +756,33 @@ func (e *UnauthorizedClientException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *UnauthorizedClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *UnauthorizedClientException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UnauthorizedClientException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UnauthorizedClientException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.UnauthorizedClientException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.UnauthorizedClientException_error_description, *v.Error_description) + } +} +func (v *UnauthorizedClientException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UnauthorizedClientException, func(s *smithy.Schema) error { + switch s { + case schemas.UnauthorizedClientException_error: + v.Error_ = new(string) + return d.ReadString(schemas.UnauthorizedClientException_error, v.Error_) + case schemas.UnauthorizedClientException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.UnauthorizedClientException_error_description, v.Error_description) + } + return nil + }) +} // Indicates that the grant type in the request is not supported by the service. type UnsupportedGrantTypeException struct { @@ -428,3 +812,30 @@ func (e *UnsupportedGrantTypeException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *UnsupportedGrantTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +func (v *UnsupportedGrantTypeException) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.UnsupportedGrantTypeException) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *UnsupportedGrantTypeException) SerializeMembers(s smithy.ShapeSerializer) { + if v.Error_ != nil { + s.WriteString(schemas.UnsupportedGrantTypeException_error, *v.Error_) + } + if v.Error_description != nil { + s.WriteString(schemas.UnsupportedGrantTypeException_error_description, *v.Error_description) + } +} +func (v *UnsupportedGrantTypeException) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.UnsupportedGrantTypeException, func(s *smithy.Schema) error { + switch s { + case schemas.UnsupportedGrantTypeException_error: + v.Error_ = new(string) + return d.ReadString(schemas.UnsupportedGrantTypeException_error, v.Error_) + case schemas.UnsupportedGrantTypeException_error_description: + v.Error_description = new(string) + return d.ReadString(schemas.UnsupportedGrantTypeException_error_description, v.Error_description) + } + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go index de15e8f05..673abe916 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go @@ -3,6 +3,8 @@ package types import ( + "github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas" + smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" ) @@ -22,4 +24,26 @@ type AwsAdditionalDetails struct { noSmithyDocumentSerde } +func (v *AwsAdditionalDetails) Serialize(s smithy.ShapeSerializer) { + s.WriteStruct(schemas.AwsAdditionalDetails) + v.SerializeMembers(s) + s.CloseStruct() +} + +func (v *AwsAdditionalDetails) SerializeMembers(s smithy.ShapeSerializer) { + if v.IdentityContext != nil { + s.WriteString(schemas.AwsAdditionalDetails_identityContext, *v.IdentityContext) + } +} +func (v *AwsAdditionalDetails) Deserialize(d smithy.ShapeDeserializer) error { + return smithy.ReadStruct(d, schemas.AwsAdditionalDetails, func(s *smithy.Schema) error { + switch s { + case schemas.AwsAdditionalDetails_identityContext: + v.IdentityContext = new(string) + return d.ReadString(schemas.AwsAdditionalDetails_identityContext, v.IdentityContext) + } + return nil + }) +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md index 410a4aea7..996f0cdb2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md @@ -1,3 +1,27 @@ +# v1.51.6 (2026-10-27) + +* **Dependency Update**: Update to smithy-go v1.28.7. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.5 (2026-10-22) + +* **Bug Fix**: Update smithy-go to v1.28.6 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.4 (2026-10-09.2) + +* **Dependency Update**: Update to smithy-go v1.28.5. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.3 (2026-10-08) + +* **Dependency Update**: Update to smithy-go v1.28.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.2 (2026-10-06) + +* No change notes available for this release. + # v1.51.1 (2026-09-24) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go index 2c8267d38..be49fc7ab 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go @@ -34,17 +34,22 @@ func (m *awsAwsquery_deserializeOpAssumeRole) HandleDeserialize(ctx context.Cont 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 { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { + return out, metadata, err + } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") defer endTimer() @@ -158,17 +163,22 @@ func (m *awsAwsquery_deserializeOpAssumeRoleWithSAML) HandleDeserialize(ctx cont 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 { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { + return out, metadata, err + } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") defer endTimer() @@ -288,17 +298,22 @@ func (m *awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) HandleDeserialize(c 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 { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { + return out, metadata, err + } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") defer endTimer() @@ -421,17 +436,22 @@ func (m *awsAwsquery_deserializeOpAssumeRoot) HandleDeserialize(ctx context.Cont 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 { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { + return out, metadata, err + } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") defer endTimer() @@ -539,17 +559,22 @@ func (m *awsAwsquery_deserializeOpDecodeAuthorizationMessage) HandleDeserialize( 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 { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { + return out, metadata, err + } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") defer endTimer() @@ -654,17 +679,22 @@ func (m *awsAwsquery_deserializeOpGetAccessKeyInfo) HandleDeserialize(ctx contex 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 { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { + return out, metadata, err + } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") defer endTimer() @@ -766,17 +796,22 @@ func (m *awsAwsquery_deserializeOpGetCallerIdentity) HandleDeserialize(ctx conte 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 { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { + return out, metadata, err + } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") defer endTimer() @@ -878,17 +913,22 @@ func (m *awsAwsquery_deserializeOpGetDelegatedAccessToken) HandleDeserialize(ctx 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 { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { + return out, metadata, err + } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") defer endTimer() @@ -999,17 +1039,22 @@ func (m *awsAwsquery_deserializeOpGetFederationToken) HandleDeserialize(ctx cont 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 { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { + return out, metadata, err + } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") defer endTimer() @@ -1120,17 +1165,22 @@ func (m *awsAwsquery_deserializeOpGetSessionToken) HandleDeserialize(ctx context 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 { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { + return out, metadata, err + } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") defer endTimer() @@ -1235,17 +1285,22 @@ func (m *awsAwsquery_deserializeOpGetWebIdentityToken) HandleDeserialize(ctx con 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 { + if err != nil { + // Transport-level failure with no HTTP response to close. + return out, metadata, err + } return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } defer func() { smithyhttp.CloseResponseBody(ctx, response, false, err) }() + if err != nil { + return out, metadata, err + } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") defer endTimer() diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go index d9d89fd0c..e50239da2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go @@ -3,4 +3,4 @@ package sts // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.51.1" +const goModuleVersion = "1.51.6" diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md index 8b94da751..158e05a48 100644 --- a/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,3 +1,13 @@ +# Release (2026-10-27) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.28.7 + * **Bug Fix**: Fix a panic or `EOF` error when deserializing a JSON union that contains a member not modeled by the client and whose value is not `null`. + * **Bug Fix**: Log the underlying error when dumping an HTTP request or response for logging fails + # Release (2026-10-21) ## General Highlights diff --git a/vendor/github.com/aws/smithy-go/go_module_metadata.go b/vendor/github.com/aws/smithy-go/go_module_metadata.go index 0fbd1dec3..184e469ea 100644 --- a/vendor/github.com/aws/smithy-go/go_module_metadata.go +++ b/vendor/github.com/aws/smithy-go/go_module_metadata.go @@ -3,4 +3,4 @@ package smithy // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.28.6" +const goModuleVersion = "1.28.7" diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.go index d5909b0a2..c49dde057 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.go +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.go @@ -41,6 +41,7 @@ func (r *RequestResponseLogger) HandleDeserialize( rc := smithyRequest.Build(ctx) reqBytes, err := httputil.DumpRequestOut(rc, r.LogRequestWithBody) if err != nil { + logger.Logf(logging.Warn, "failed to dump request for logging: %v", err) return out, metadata, err } @@ -65,6 +66,7 @@ func (r *RequestResponseLogger) HandleDeserialize( respBytes, err := httputil.DumpResponse(smithyResponse.Response, r.LogResponseWithBody) if err != nil { + logger.Logf(logging.Warn, "failed to dump response for logging: %v", err) return out, metadata, fmt.Errorf("failed to dump response %w", err) } diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/deserializer.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/deserializer.go new file mode 100644 index 000000000..53cc245e6 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/deserializer.go @@ -0,0 +1,518 @@ +package httpbinding + +import ( + "encoding/base64" + "fmt" + "math/big" + "net/http" + "strconv" + "strings" + "time" + + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/traits" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// ShapeDeserializer reads HTTP-bound output struct members from the response, +// delegates body members to the wrapped body deserializer. +type ShapeDeserializer struct { + response *http.Response + body smithy.ShapeDeserializer + payload []byte + + // ALL http binding traits are applied on the top-level output struct, for + // anything nested we are just delegating to the payload deserializer + depth int + topLevel *smithy.Schema + + // unlike an RPC-style protocol, members of the top-level output could be + // HTTP-bound, so we track that when ReadStruct is first called and "yield" + // them back to the caller through ReadStructMember + currentBinding *smithy.Schema + bindings []*smithy.Schema + bindingIndex int + + inBody bool + hasPayload bool + + inHeaderList bool + headerListValues []string + headerListIdx int + + inPrefixMap bool + prefixValue string + prefixKeys []string + prefixKeyIdx int +} + +var _ smithy.ShapeDeserializer = (*ShapeDeserializer)(nil) + +// ShapeDeserializerOptions configures ShapeDeserializer. +type ShapeDeserializerOptions struct{} + +// NewShapeDeserializer creates a ShapeDeserializer for the given HTTP +// response. +// +// The payload should be nil in streaming-blob response operations. +func NewShapeDeserializer(resp *http.Response, body smithy.ShapeDeserializer, payload []byte, opts ...func(*ShapeDeserializerOptions)) *ShapeDeserializer { + return &ShapeDeserializer{ + response: resp, + body: body, + payload: payload, + } +} + +// ReadStruct implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadStruct(s *smithy.Schema) error { + d.depth++ + if d.depth > 1 { + return d.body.ReadStruct(s) + } + + d.topLevel = s + for _, member := range s.Members() { + if _, ok := smithy.SchemaTrait[*traits.HTTPPayload](member); ok { + d.hasPayload = true + } + if d.isBindingSet(member) { + d.bindings = append(d.bindings, member) + } + } + + return nil +} + +// ReadStructMember implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadStructMember() (*smithy.Schema, error) { + if d.depth > 1 { + ms, err := d.body.ReadStructMember() + if ms == nil { + d.depth-- + } + return ms, err + } + + if d.bindingIndex < len(d.bindings) { + member := d.bindings[d.bindingIndex] + d.bindingIndex++ + d.currentBinding = member + return member, nil + } + d.currentBinding = nil + + if d.hasPayload { // i.e. no unbound members + d.depth-- + return nil, nil + } + + if !d.inBody { + d.inBody = true + if err := d.body.ReadStruct(d.topLevel); err != nil { + return nil, err + } + } + + ms, err := d.body.ReadStructMember() + if ms == nil { + d.depth-- + } + return ms, err +} + +// ReadString implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadString(s *smithy.Schema, v *string) error { + if d.inHeaderList { + *v = d.headerListValues[d.headerListIdx] + d.headerListIdx++ + return nil + } + if d.isCurrentBinding(s) { + if _, ok := isHTTPHeader(s); ok { + hv, err := d.readHeaderString(s) + if err != nil { + return err + } + *v = hv + return nil + } + if _, ok := smithy.SchemaTrait[*traits.HTTPPayload](s); ok { + *v = string(d.payload) + return nil + } + } + if d.inPrefixMap { + key := d.prefixKeys[d.prefixKeyIdx-1] + *v = d.response.Header.Get(d.prefixValue + key) + return nil + } + return d.body.ReadString(s, v) +} + +// ReadBool implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadBool(s *smithy.Schema, v *bool) error { + if !d.inHeaderList && !d.isCurrentBinding(s) { + return d.body.ReadBool(s, v) + } + + name, _ := isHTTPHeader(s) + + var hv string + if d.inHeaderList { + hv = d.nextHeaderValue() + } else { + hv = d.response.Header.Get(name) + } + + n, err := strconv.ParseBool(hv) + if err != nil { + return err + } + + *v = n + return nil +} + +// ReadInt8 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadInt8(s *smithy.Schema, v *int8) error { + if !d.inHeaderList && !d.isCurrentBinding(s) { + return d.body.ReadInt8(s, v) + } + return readHeaderInt[int8](d, s, v) +} + +// ReadInt16 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadInt16(s *smithy.Schema, v *int16) error { + if !d.inHeaderList && !d.isCurrentBinding(s) { + return d.body.ReadInt16(s, v) + } + return readHeaderInt[int16](d, s, v) +} + +// ReadInt32 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadInt32(s *smithy.Schema, v *int32) error { + if !d.inHeaderList && !d.isCurrentBinding(s) { + return d.body.ReadInt32(s, v) + } + + // https://smithy.io/2.0/spec/http-bindings.html#httpresponsecode-trait + // + // The httpResponseCode trait can be applied to structure members that + // target an integer within any structure that has no input trait applied. + if _, ok := smithy.SchemaTrait[*traits.HTTPResponseCode](s); ok { + *v = int32(d.response.StatusCode) + return nil + } + + return readHeaderInt[int32](d, s, v) +} + +// ReadInt64 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadInt64(s *smithy.Schema, v *int64) error { + if !d.inHeaderList && !d.isCurrentBinding(s) { + return d.body.ReadInt64(s, v) + } + return readHeaderInt[int64](d, s, v) +} + +// ReadFloat32 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadFloat32(s *smithy.Schema, v *float32) error { + if !d.inHeaderList && !d.isCurrentBinding(s) { + return d.body.ReadFloat32(s, v) + } + return readHeaderFloat[float32](d, s, v) +} + +// ReadFloat64 implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadFloat64(s *smithy.Schema, v *float64) error { + if !d.inHeaderList && !d.isCurrentBinding(s) { + return d.body.ReadFloat64(s, v) + } + return readHeaderFloat[float64](d, s, v) +} + +// ReadTime implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadTime(s *smithy.Schema, v *time.Time) error { + if d.inHeaderList { + return d.readHeaderListTime(func(t time.Time) { *v = t }) + } + if d.isCurrentBinding(s) { + t, err := d.readHeaderTime(s) + if err != nil { + return err + } + *v = t + return nil + } + return d.body.ReadTime(s, v) +} + +func (d *ShapeDeserializer) readHeaderTime(s *smithy.Schema) (time.Time, error) { + name, _ := isHTTPHeader(s) + hv := d.response.Header.Get(name) + t, err := parseTimestamp(s, "http-date", hv) + if err != nil { + return time.Time{}, err + } + return t, nil +} + +func (d *ShapeDeserializer) readHeaderListTime(assign func(time.Time)) error { + hv := d.headerListValues[d.headerListIdx] + d.headerListIdx++ + t, err := parseTimestamp(nil, "http-date", hv) + if err != nil { + return err + } + assign(t) + return nil +} + +// ReadBlob implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadBlob(s *smithy.Schema, v *[]byte) error { + if !d.isCurrentBinding(s) { + return d.body.ReadBlob(s, v) + } + + if _, ok := smithy.SchemaTrait[*traits.HTTPPayload](s); ok { + *v = d.payload + return nil + } + + name, ok := isHTTPHeader(s) + if !ok { + return fmt.Errorf("ReadBlob: unhandled http binding") + } + + hv := d.response.Header.Get(name) + b, err := base64.StdEncoding.DecodeString(hv) + if err != nil { + return err + } + *v = b + return nil +} + +// ReadList implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadList(s *smithy.Schema) error { + if !d.isCurrentBinding(s) { + return d.body.ReadList(s) + } + + name, ok := isHTTPHeader(s) + if !ok { + return fmt.Errorf("ReadList called outside of payload / http binding") + } + + d.inHeaderList = true + d.headerListIdx = 0 + if s.ListMember() != nil && s.ListMember().Type() == smithy.ShapeTypeTimestamp && timestampFormat(s.ListMember(), "http-date") == "http-date" { + vs, err := smithyhttp.SplitHTTPDateTimestampHeaderListValues(d.response.Header.Values(name)) + if err != nil { + return err + } + + d.headerListValues = vs + } else { + vs, err := smithyhttp.SplitHeaderListValues(d.response.Header.Values(name)) + if err != nil { + return err + } + + d.headerListValues = vs + } + return nil +} + +// ReadListItem implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadListItem(s *smithy.Schema) (bool, error) { + if !d.inHeaderList { + return d.body.ReadListItem(s) + } + + if d.headerListIdx >= len(d.headerListValues) { + d.inHeaderList = false + return false, nil + } + return true, nil +} + +// ReadMap implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadMap(s *smithy.Schema) error { + if !d.isCurrentBinding(s) { + return d.body.ReadMap(s) + } + + ph, ok := smithy.SchemaTrait[*traits.HTTPPrefixHeaders](s) + if !ok { + return fmt.Errorf("ReadMap called outside of payload / http binding") + } + + d.inPrefixMap = true + d.prefixValue = ph.Prefix + d.prefixKeyIdx = 0 + + canon := http.CanonicalHeaderKey(ph.Prefix) + for name := range d.response.Header { + if len(name) > len(canon) && strings.EqualFold(name[:len(canon)], canon) { + d.prefixKeys = append(d.prefixKeys, strings.ToLower(name[len(canon):])) + } + } + + return nil +} + +// ReadMapKey implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadMapKey(s *smithy.Schema) (string, bool, error) { + if !d.inPrefixMap { + return d.body.ReadMapKey(s) + } + + if d.prefixKeyIdx >= len(d.prefixKeys) { + d.inPrefixMap = false + return "", false, nil + } + key := d.prefixKeys[d.prefixKeyIdx] + d.prefixKeyIdx++ + return key, true, nil +} + +// ReadNil implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadNil(s *smithy.Schema) (bool, error) { + if d.inPrefixMap || d.inHeaderList { + return false, nil + } + return d.body.ReadNil(s) +} + +// ReadDocument implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadDocument(s *smithy.Schema, v *document.Value) error { + return d.body.ReadDocument(s, v) +} + +// ReadUnion implements [smithy.ShapeDeserializer]. +func (d *ShapeDeserializer) ReadUnion(s *smithy.Schema) (*smithy.Schema, error) { + return d.body.ReadUnion(s) +} + +// whether the schema we're operating right now is the current HTTP binding +// that we gave back to the caller +func (d *ShapeDeserializer) isCurrentBinding(schema *smithy.Schema) bool { + return schema != nil && schema == d.currentBinding +} + +func (d *ShapeDeserializer) isBindingSet(schema *smithy.Schema) bool { + if name, ok := isHTTPHeader(schema); ok { + return len(d.response.Header.Values(name)) > 0 + } + + if trait, ok := isHTTPPrefixHeaders(schema); ok { + canon := http.CanonicalHeaderKey(trait.Prefix) + for name := range d.response.Header { + if len(name) > len(canon) && strings.EqualFold(name[:len(canon)], canon) { + return true + } + } + return false + } + + if _, ok := smithy.SchemaTrait[*traits.HTTPResponseCode](schema); ok { + return true + } + + if _, ok := smithy.SchemaTrait[*traits.HTTPPayload](schema); ok { + return len(d.payload) > 0 + } + + return false +} + +func (d *ShapeDeserializer) readHeaderString(s *smithy.Schema) (string, error) { + name, _ := isHTTPHeader(s) + + hv := d.response.Header.Get(name) + if _, ok := smithy.SchemaTrait[*traits.MediaType](s); ok { + b, err := base64.StdEncoding.DecodeString(hv) + if err != nil { + return "", err + } + hv = string(b) + } + return hv, nil +} + +func (d *ShapeDeserializer) nextHeaderValue() string { + v := d.headerListValues[d.headerListIdx] + d.headerListIdx++ + return v +} + +type intn interface { + int8 | int16 | int32 | int64 +} + +func readHeaderInt[T intn](d *ShapeDeserializer, s *smithy.Schema, v *T) error { + name, _ := isHTTPHeader(s) + + var hv string + if d.inHeaderList { + hv = d.nextHeaderValue() + } else { + hv = d.response.Header.Get(name) + } + + n, err := strconv.ParseInt(hv, 10, 64) + if err != nil { + return err + } + + *v = T(n) + return nil +} + +type floatn interface { + float32 | float64 +} + +func readHeaderFloat[T floatn](d *ShapeDeserializer, s *smithy.Schema, v *T) error { + name, _ := isHTTPHeader(s) + + var hv string + if d.inHeaderList { + hv = d.nextHeaderValue() + } else { + hv = d.response.Header.Get(name) + } + + n, err := strconv.ParseFloat(hv, 64) + if err != nil { + return err + } + + *v = T(n) + return nil +} + +// ReadBigInt is unimplemented and will return an error. +func (d *ShapeDeserializer) ReadBigInt(_ *smithy.Schema, _ *big.Int) error { + return fmt.Errorf("unimplemented") +} + +// ReadBigFloat is unimplemented and will return an error. +func (d *ShapeDeserializer) ReadBigFloat(_ *smithy.Schema, _ *big.Float) error { + return fmt.Errorf("unimplemented") +} + +// HasBlobPayload reports whether the given output shape binds a blob member as +// @httpPayload. Such a payload is handed to the caller by reference, so the +// buffer holding it cannot be reused. +// +// The answer is cached per schema: this is called on every response, and walking +// members with a trait lookup each is not free at that rate. +func HasBlobPayload(output *smithy.Schema) bool { + if output == nil { + return false + } + return getExt(output).hasBlobPayload +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/ext.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/ext.go new file mode 100644 index 000000000..f0589d0b6 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/ext.go @@ -0,0 +1,34 @@ +package httpbinding + +import ( + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/traits" +) + +// bindingExt caches per-schema facts about a shape's HTTP bindings that would +// otherwise be recomputed by walking its members on every request. +type bindingExt struct { + hasBlobPayload bool +} + +func getExt(s *smithy.Schema) *bindingExt { + return smithy.SchemaExtension(s, smithy.ExtHTTPBinding, buildExt) +} + +func buildExt(s *smithy.Schema) *bindingExt { + return &bindingExt{ + hasBlobPayload: hasBlobPayload(s), + } +} + +func hasBlobPayload(output *smithy.Schema) bool { + for _, member := range output.Members() { + if _, ok := smithy.SchemaTrait[*traits.HTTPPayload](member); !ok { + continue + } + if member.Type() == smithy.ShapeTypeBlob { + return true + } + } + return false +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/serializer.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/serializer.go new file mode 100644 index 000000000..33eee224c --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/serializer.go @@ -0,0 +1,641 @@ +package httpbinding + +import ( + "bytes" + "encoding/base64" + "fmt" + "io" + "math/big" + "net/http" + "strconv" + "strings" + "time" + + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/document" + httpbinding "github.com/aws/smithy-go/encoding/httpbinding" + "github.com/aws/smithy-go/traits" + smithyhttp "github.com/aws/smithy-go/transport/http" + awsjson "github.com/aws/smithy-go/transport/http/protocol/internal/json" +) + +// ShapeSerializer routes top-level input struct members to their HTTP binding +// locations. Members without HTTP binding traits delegate to an inner +// serializer for whatever protocol is being used. +// +// ShapeSerializer adds some API surface on top of the normal +// smithy.ShapeSerializer. Specifically it adds [ShapeSerializer.Build] for +// handing REST-protocol payloads, since the actual source of the payload is +// going to vary on a per-operation basis and isn't known until the input's +// Serialize is called. The caller (so, the protocol implementation) should +// set the HTTP request body by calling Build after Serialize. +type ShapeSerializer struct { + request *smithyhttp.Request + encoder *httpbinding.Encoder + input smithy.ShapeSerializer + options ShapeSerializerOptions + + // set when an input member is bound via @httpPayload + httpPayload []byte + httpPayloadContentType string + + // set when an input blob is bound via @httpPayload + @streaming + streamingContentType string + + mapMode mapBindingMode + mapPrefix string + currentKey string + + listMode listBindingMode + listName string + listHasItems bool + + noBody bool + hasStructPayload bool + + depth int +} + +// ShapeSerializerOptions configures a ShapeSerializer. +type ShapeSerializerOptions struct{} + +// NewShapeSerializer creates a ShapeSerializer for the given operation schema +// and request. It handles the initial setup from use of an +// httpbinding.Encoder. +func NewShapeSerializer(op *smithy.Schema, req *smithyhttp.Request, in smithy.ShapeSerializer, opts ...func(*ShapeSerializerOptions)) (*ShapeSerializer, error) { + httpTrait, ok := smithy.SchemaTrait[*traits.HTTP](op) + if !ok { + return nil, fmt.Errorf("no @http trait on op schema") + } + + req.Method = httpTrait.Method + path, query := httpbinding.SplitURI(httpTrait.URI) + enc, err := httpbinding.NewEncoder(path, query, req.Header) + if err != nil { + return nil, fmt.Errorf("new encoder: %w", err) + } + + return &ShapeSerializer{ + request: req, + encoder: enc, + input: in, + }, nil +} + +// Build encodes HTTP binding values into the request and sets the request +// body. The defaultContentType is used for the protocol body (e.g. +// "application/json") when no explicit payload is present. +// +// The body is resolved in the following priority: +// 1. Streaming payload (input implements StreamingInput with non-nil stream) +// 2. Raw payload bytes (blob/string member with @httpPayload) +// 3. Serialized protocol body (e.g. JSON) +// 4. Empty struct payload (struct member with @httpPayload, sends "{}") +func (s *ShapeSerializer) Build(in smithy.Serializable, defaultContentType string) error { + req := s.request + + built, err := s.encoder.Encode(req.Request) + if err != nil { + return fmt.Errorf("encode httpbinding: %w", err) + } + req.Request = built + + // (1) streaming payload + if si, ok := in.(smithy.StreamingInput); ok && si.GetPayloadStream() != nil { + contentType := s.streamingContentType + if contentType == "" { + contentType = "application/octet-stream" + } + return s.setBody(si.GetPayloadStream(), contentType) + } + + var payload []byte + var contentType string + + // (2) explicit @httpPayload (blob/string) + if s.httpPayload != nil { + payload = s.httpPayload + contentType = s.httpPayloadContentType + } else { // (3) protocol body + payload = s.input.Bytes() + contentType = defaultContentType + } + + // (4) empty struct @httpPayload + if len(payload) == 0 && s.hasStructPayload { + payload = []byte("{}") + contentType = defaultContentType + } + + if len(payload) == 0 { + return nil + } + return s.setBody(bytes.NewReader(payload), contentType) +} + +func (s *ShapeSerializer) setBody(body io.Reader, contentType string) error { + if s.request.Header.Get("Content-Type") == "" { + s.request.Header.Set("Content-Type", contentType) + } + sreq, err := s.request.SetStream(body) + if err != nil { + return fmt.Errorf("set stream: %w", err) + } + *s.request = *sreq + return nil +} + +type mapBindingMode int + +const ( + mapModeNone mapBindingMode = iota + mapModePrefixHeaders + mapModeQueryParams +) + +type listBindingMode int + +const ( + listModeNone listBindingMode = iota + listModeHeader + listModeQuery +) + +type bind int + +const ( + bindBody bind = iota + bindHeader + bindHeaderList + bindQuery + bindQueryList + bindLabel +) + +func (s *ShapeSerializer) resolveBinding(schema *smithy.Schema) (bind, string) { + if s.listMode == listModeHeader { + return bindHeaderList, s.listName + } + if s.listMode == listModeQuery { + return bindQueryList, s.listName + } + if name, ok := isHTTPHeader(schema); ok { + return bindHeader, name + } + if isHTTPLabel(schema) { + return bindLabel, schema.MemberName() + } + if q, ok := isHTTPQuery(schema); ok { + return bindQuery, q.Name + } + return bindBody, "" +} + +var _ smithy.ShapeSerializer = (*ShapeSerializer)(nil) + +// Bytes returns the serialized body bytes. +func (s *ShapeSerializer) Bytes() []byte { + return s.input.Bytes() +} + +func isHTTPHeader(schema *smithy.Schema) (string, bool) { + h, ok := smithy.SchemaTrait[*traits.HTTPHeader](schema) + if !ok { + return "", false + } + return http.CanonicalHeaderKey(h.Name), true +} + +func isHTTPLabel(schema *smithy.Schema) bool { + _, ok := smithy.SchemaTrait[*traits.HTTPLabel](schema) + return ok +} + +func isHTTPQuery(schema *smithy.Schema) (*traits.HTTPQuery, bool) { + return smithy.SchemaTrait[*traits.HTTPQuery](schema) +} + +func isHTTPPayload(schema *smithy.Schema) bool { + _, ok := smithy.SchemaTrait[*traits.HTTPPayload](schema) + return ok +} + +func isHTTPPrefixHeaders(schema *smithy.Schema) (*traits.HTTPPrefixHeaders, bool) { + ph, ok := smithy.SchemaTrait[*traits.HTTPPrefixHeaders](schema) + return ph, ok +} + +func isHTTPQueryParams(schema *smithy.Schema) bool { + _, ok := smithy.SchemaTrait[*traits.HTTPQueryParams](schema) + return ok +} + +func hasBodyMembers(schema *smithy.Schema) bool { + for _, member := range schema.Members() { + if !isHTTPBound(member) { + return true + } + } + return false +} + +func isHTTPBound(schema *smithy.Schema) bool { + if _, ok := isHTTPHeader(schema); ok { + return true + } + if _, ok := isHTTPPrefixHeaders(schema); ok { + return true + } + if isHTTPLabel(schema) { + return true + } + if _, ok := isHTTPQuery(schema); ok { + return true + } + if isHTTPQueryParams(schema) { + return true + } + if isHTTPPayload(schema) { + return true + } + return false +} + +// WriteString implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteString(schema *smithy.Schema, v string) { + switch s.mapMode { + case mapModePrefixHeaders: + s.encoder.SetHeader(http.CanonicalHeaderKey(s.mapPrefix + s.currentKey)).String(v) + return + case mapModeQueryParams: + s.encoder.AddQuery(s.currentKey).String(v) + return + } + + bt, bn := s.resolveBinding(schema) + switch bt { + case bindHeaderList: + escaped := v + if strings.ContainsAny(v, ",\"") { + escaped = strconv.Quote(v) + } + s.encoder.AddHeader(bn).String(escaped) + s.listHasItems = true + case bindQueryList: + s.encoder.AddQuery(bn).String(v) + case bindHeader: + if _, ok := smithy.SchemaTrait[*traits.MediaType](schema); ok { + s.encoder.SetHeader(bn).String(base64.StdEncoding.EncodeToString([]byte(v))) + return + } + s.encoder.SetHeader(bn).String(v) + case bindLabel: + s.encoder.SetURI(bn).String(v) + case bindQuery: + s.encoder.SetQuery(bn).String(v) + default: + if isHTTPPayload(schema) { + s.httpPayload = []byte(v) + s.httpPayloadContentType = "text/plain" + return + } + s.input.WriteString(schema, v) + } +} + +// WriteBool implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteBool(schema *smithy.Schema, v bool) { + bt, bn := s.resolveBinding(schema) + switch bt { + case bindHeaderList: + s.encoder.AddHeader(bn).Boolean(v) + s.listHasItems = true + case bindQueryList: + s.encoder.AddQuery(bn).Boolean(v) + case bindHeader: + s.encoder.SetHeader(bn).Boolean(v) + case bindLabel: + s.encoder.SetURI(bn).Boolean(v) + case bindQuery: + s.encoder.SetQuery(bn).Boolean(v) + default: + s.input.WriteBool(schema, v) + } +} + +// WriteInt8 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteInt8(schema *smithy.Schema, v int8) { + bt, bn := s.resolveBinding(schema) + switch bt { + case bindHeaderList: + s.encoder.AddHeader(bn).Byte(v) + s.listHasItems = true + case bindQueryList: + s.encoder.AddQuery(bn).Byte(v) + case bindHeader: + s.encoder.SetHeader(bn).Byte(v) + case bindLabel: + s.encoder.SetURI(bn).Byte(v) + case bindQuery: + s.encoder.SetQuery(bn).Byte(v) + default: + s.input.WriteInt8(schema, v) + } +} + +// WriteInt16 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteInt16(schema *smithy.Schema, v int16) { + bt, bn := s.resolveBinding(schema) + switch bt { + case bindHeaderList: + s.encoder.AddHeader(bn).Short(v) + s.listHasItems = true + case bindQueryList: + s.encoder.AddQuery(bn).Short(v) + case bindHeader: + s.encoder.SetHeader(bn).Short(v) + case bindLabel: + s.encoder.SetURI(bn).Short(v) + case bindQuery: + s.encoder.SetQuery(bn).Short(v) + default: + s.input.WriteInt16(schema, v) + } +} + +// WriteInt32 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteInt32(schema *smithy.Schema, v int32) { + bt, bn := s.resolveBinding(schema) + switch bt { + case bindHeaderList: + s.encoder.AddHeader(bn).Integer(v) + s.listHasItems = true + case bindQueryList: + s.encoder.AddQuery(bn).Integer(v) + case bindHeader: + s.encoder.SetHeader(bn).Integer(v) + case bindLabel: + s.encoder.SetURI(bn).Integer(v) + case bindQuery: + s.encoder.SetQuery(bn).Integer(v) + default: + s.input.WriteInt32(schema, v) + } +} + +// WriteInt64 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteInt64(schema *smithy.Schema, v int64) { + bt, bn := s.resolveBinding(schema) + switch bt { + case bindHeaderList: + s.encoder.AddHeader(bn).Long(v) + s.listHasItems = true + case bindQueryList: + s.encoder.AddQuery(bn).Long(v) + case bindHeader: + s.encoder.SetHeader(bn).Long(v) + case bindLabel: + s.encoder.SetURI(bn).Long(v) + case bindQuery: + s.encoder.SetQuery(bn).Long(v) + default: + s.input.WriteInt64(schema, v) + } +} + +// WriteFloat32 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteFloat32(schema *smithy.Schema, v float32) { + bt, bn := s.resolveBinding(schema) + switch bt { + case bindHeaderList: + s.encoder.AddHeader(bn).Float(v) + s.listHasItems = true + case bindQueryList: + s.encoder.AddQuery(bn).Float(v) + case bindHeader: + s.encoder.SetHeader(bn).Float(v) + case bindLabel: + s.encoder.SetURI(bn).Float(v) + case bindQuery: + s.encoder.SetQuery(bn).Float(v) + default: + s.input.WriteFloat32(schema, v) + } +} + +// WriteFloat64 implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteFloat64(schema *smithy.Schema, v float64) { + bt, bn := s.resolveBinding(schema) + switch bt { + case bindHeaderList: + s.encoder.AddHeader(bn).Double(v) + s.listHasItems = true + case bindQueryList: + s.encoder.AddQuery(bn).Double(v) + case bindHeader: + s.encoder.SetHeader(bn).Double(v) + case bindLabel: + s.encoder.SetURI(bn).Double(v) + case bindQuery: + s.encoder.SetQuery(bn).Double(v) + default: + s.input.WriteFloat64(schema, v) + } +} + +// WriteBlob implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteBlob(schema *smithy.Schema, v []byte) { + if isHTTPPayload(schema) { + s.httpPayload = v + if mt, ok := smithy.SchemaTrait[*traits.MediaType](schema); ok { + s.httpPayloadContentType = mt.Type + } else { + s.httpPayloadContentType = "application/octet-stream" + } + return + } + if name, ok := isHTTPHeader(schema); ok { + s.encoder.SetHeader(name).Blob(v) + return + } + s.input.WriteBlob(schema, v) +} + +// WriteTime implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteTime(schema *smithy.Schema, v time.Time) { + bt, bn := s.resolveBinding(schema) + switch bt { + case bindHeaderList: + s.encoder.AddHeader(bn).String(formatTimestamp(schema, "http-date", v)) + s.listHasItems = true + case bindQueryList: + s.encoder.AddQuery(bn).String(formatTimestamp(schema, "date-time", v)) + case bindHeader: + s.encoder.SetHeader(bn).String(formatTimestamp(schema, "http-date", v)) + case bindLabel: + s.encoder.SetURI(bn).String(formatTimestamp(schema, "date-time", v)) + case bindQuery: + s.encoder.SetQuery(bn).String(formatTimestamp(schema, "date-time", v)) + default: + s.input.WriteTime(schema, v) + } +} + +// WriteList implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteList(schema *smithy.Schema) { + if s.mapMode == mapModeQueryParams { + s.listMode = listModeQuery + s.listName = s.currentKey + return + } + if name, ok := isHTTPHeader(schema); ok { + s.listMode = listModeHeader + s.listName = name + s.listHasItems = false + return + } + if q, ok := isHTTPQuery(schema); ok { + s.listMode = listModeQuery + s.listName = q.Name + s.listHasItems = false + return + } + s.input.WriteList(schema) +} + +// CloseList implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) CloseList() { + if s.listMode != listModeNone { + if !s.listHasItems && s.listMode == listModeHeader { + s.encoder.SetHeader(s.listName).String("") + } + s.listMode = listModeNone + s.listName = "" + s.listHasItems = false + return + } + s.input.CloseList() +} + +// WriteMap implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteMap(schema *smithy.Schema) { + if ph, ok := isHTTPPrefixHeaders(schema); ok { + s.mapMode = mapModePrefixHeaders + s.mapPrefix = ph.Prefix + return + } + + if isHTTPQueryParams(schema) { + s.mapMode = mapModeQueryParams + return + } + + s.input.WriteMap(schema) +} + +// WriteKey implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteKey(schema *smithy.Schema, key string) { + switch s.mapMode { + case mapModePrefixHeaders, mapModeQueryParams: + s.currentKey = key + default: + s.input.WriteKey(schema, key) + } +} + +// CloseMap implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) CloseMap() { + if s.mapMode != mapModeNone { + s.mapMode = mapModeNone + s.mapPrefix = "" + s.currentKey = "" + return + } + s.input.CloseMap() +} + +// WriteStruct implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteStruct(schema *smithy.Schema) { + s.depth++ + + if s.depth > 1 { // not the root, HTTP bindings don't apply + if isHTTPPayload(schema) { + s.hasStructPayload = true + } + s.input.WriteStruct(schema) + return + } + + for _, m := range schema.Members() { + if !isHTTPPayload(m) { + continue + } + + if _, ok := smithy.SchemaTrait[*traits.Streaming](m); ok { + s.streamingContentType = "application/octet-stream" + if mt, ok := smithy.SchemaTrait[*traits.MediaType](m); ok { + s.streamingContentType = mt.Type + } + } else if m.Type() == smithy.ShapeTypeStructure { + s.hasStructPayload = true + } + } + + if !hasBodyMembers(schema) { + s.noBody = true + return + } + + // IMPLICIT payload, ie. no @httpPayload but there is at least one member + // that isn't http-bound + s.input.WriteStruct(schema) +} + +// CloseStruct implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) CloseStruct() { + s.depth-- + + // we skip the close if there was no payload to begin with, implicit or + // otherwise + if s.depth > 0 || !s.noBody { + s.input.CloseStruct() + } +} + +// WriteUnion implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteUnion(schema, variant *smithy.Schema) { + s.input.WriteUnion(schema, variant) +} + +// CloseUnion implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) CloseUnion() { + s.input.CloseUnion() +} + +// WriteNil implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteNil(schema *smithy.Schema) { + s.input.WriteNil(schema) +} + +// WriteBigInt implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteBigInt(schema *smithy.Schema, v *big.Int) { + s.input.WriteBigInt(schema, v) +} + +// WriteBigFloat implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteBigFloat(schema *smithy.Schema, v *big.Float) { + s.input.WriteBigFloat(schema, v) +} + +// WriteDocument implements [smithy.ShapeSerializer]. +func (s *ShapeSerializer) WriteDocument(schema *smithy.Schema, v document.Value) { + if isHTTPPayload(schema) { + // httpPayload document: serialize to raw bytes for the body. + doc := awsjson.NewShapeSerializer() + doc.WriteDocument(schema, v) + s.httpPayload = doc.Bytes() + s.httpPayloadContentType = "application/json" + return + } + s.input.WriteDocument(schema, v) +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/timestamp.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/timestamp.go new file mode 100644 index 000000000..335ac6c52 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding/timestamp.go @@ -0,0 +1,44 @@ +package httpbinding + +import ( + "fmt" + "strconv" + "time" + + "github.com/aws/smithy-go" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/traits" +) + +func timestampFormat(schema *smithy.Schema, fallback string) string { + if tf, ok := smithy.SchemaTrait[*traits.TimestampFormat](schema); ok { + return tf.Format + } + return fallback +} + +func formatTimestamp(schema *smithy.Schema, fallback string, v time.Time) string { + switch timestampFormat(schema, fallback) { + case "http-date": + return smithytime.FormatHTTPDate(v) + case "date-time": + return smithytime.FormatDateTime(v) + default: // "epoch-seconds" + return strconv.FormatFloat(smithytime.FormatEpochSeconds(v), 'f', -1, 64) + } +} + +func parseTimestamp(schema *smithy.Schema, fallback, s string) (time.Time, error) { + switch timestampFormat(schema, fallback) { + case "http-date": + return smithytime.ParseHTTPDate(s) + case "date-time": + return smithytime.ParseDateTime(s) + default: // "epoch-seconds" + v, err := strconv.ParseFloat(s, 64) + if err != nil { + return time.Time{}, fmt.Errorf("parse epoch-seconds %q: %w", s, err) + } + return smithytime.ParseEpochSeconds(v), nil + } +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_deserializer.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_deserializer.go index 40c277f45..47e9561b3 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_deserializer.go +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/internal/json/shape_deserializer.go @@ -528,20 +528,7 @@ func (d *ShapeDeserializer) ReadUnion(s *smithy.Schema) (*smithy.Schema, error) return nil, nil } - // save escaped before peek overwrites it - keyEscaped := d.p.escaped - - // inline null check - ptok, err := d.peek() - if err != nil { - return nil, err - } - if isN(ptok) { - d.peeked = nil - continue - } - - member, err := memberFromToken(s, tok, keyEscaped) + member, err := memberFromToken(s, tok, d.p.escaped) if err != nil { return nil, err } @@ -565,6 +552,16 @@ func (d *ShapeDeserializer) ReadUnion(s *smithy.Schema) (*smithy.Schema, error) continue } + // inline null check + ptok, err := d.peek() + if err != nil { + return nil, err + } + if isN(ptok) { + d.peeked = nil + continue + } + return member, nil } } diff --git a/vendor/github.com/aws/smithy-go/transport/http/protocol/restjson1/restjson1.go b/vendor/github.com/aws/smithy-go/transport/http/protocol/restjson1/restjson1.go new file mode 100644 index 000000000..c2949401c --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/protocol/restjson1/restjson1.go @@ -0,0 +1,235 @@ +package restjson1 + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + + "github.com/aws/smithy-go" + internales "github.com/aws/smithy-go/internal/eventstream" + internalserde "github.com/aws/smithy-go/internal/serde" + internalsync "github.com/aws/smithy-go/internal/sync" + smithyio "github.com/aws/smithy-go/io" + smithyhttp "github.com/aws/smithy-go/transport/http" + internalhttpbinding "github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding" + internaljson "github.com/aws/smithy-go/transport/http/protocol/internal/json" +) + +// ProtocolOptions configures aws.protocols#restJson1. +type ProtocolOptions struct{} + +// New returns an instance of the aws.protocols#restJson1 protocol. +func New(_ *smithy.ServiceSchema, opts ...func(*ProtocolOptions)) *Protocol { + var o ProtocolOptions + for _, fn := range opts { + fn(&o) + } + return &Protocol{ + bufs: internalsync.NewBufferPool(), + eventstream: &internales.Codec{ + Serializer: func() smithy.ShapeSerializer { return internaljson.NewShapeSerializer() }, + Deserializer: func(p []byte) smithy.ShapeDeserializer { return internaljson.NewShapeDeserializer(p) }, + ContentType: "application/json", + ErrorInfo: internaljson.EventStreamErrorInfo, + }, + } +} + +// Protocol implements aws.protocols#restJson1. +type Protocol struct { + bufs *internalsync.BufferPool + eventstream *internales.Codec +} + +var _ smithyhttp.ClientProtocol = (*Protocol)(nil) + +// ID identifies the protocol. +func (*Protocol) ID() smithy.ShapeID { + return smithy.ShapeID{Namespace: "aws.protocols", Name: "restJson1"} +} + +// SerializeRequest serializes a request for restJson1. +func (p *Protocol) SerializeRequest( + ctx context.Context, + op *smithy.OperationSchema, + in smithy.Serializable, + req *smithyhttp.Request, +) error { + serializer, err := internalhttpbinding.NewShapeSerializer(op.Schema, req, internaljson.NewShapeSerializer(useJSONName)) + if err != nil { + return err + } + + if op.Input != nil { + in.Serialize(serializer) + } + + contentType := "application/json" + if op.IsInputEventStream() { + contentType = "application/vnd.amazon.eventstream" + } + if err := serializer.Build(in, contentType); err != nil { + return fmt.Errorf("build request: %w", err) + } + + return nil +} + +// DeserializeResponse deserializes a response for restJson1. +func (p *Protocol) DeserializeResponse( + ctx context.Context, + op *smithy.OperationSchema, + types *smithy.TypeRegistry, + resp *smithyhttp.Response, + out smithy.Deserializable, +) error { + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return p.deserializeError(types, resp) + } + + if op.Output == nil { + return nil + } + + // @httpPayload + @streaming = do not touch the body at all, it's the + // caller's problem + if so, ok := out.(smithy.StreamingOutput); ok { + so.SetPayloadStream(resp.Body) + deser := internalhttpbinding.NewShapeDeserializer(resp.Response, bd(nil), nil) + if err := out.Deserialize(deser); err != nil { + return &smithy.DeserializationError{Err: err} + } + return nil + } + + if op.IsOutputEventStream() { + if op.IsInputEventStream() { + if err := p.eventstream.RequireBidiHTTP2(resp.Proto, resp.ProtoMajor); err != nil { + return err + } + } + deser := internalhttpbinding.NewShapeDeserializer(resp.Response, bd(nil), nil) + if err := out.Deserialize(deser); err != nil { + return &smithy.DeserializationError{Err: err} + } + return nil + } + + // a blob @httpPayload is handed to the caller by reference, so its buffer + // can't be reused + var buf *bytes.Buffer + var err error + if internalhttpbinding.HasBlobPayload(op.Output) { + if buf, err = internalserde.ReadPayloadBlob(resp.Body, resp.ContentLength); err != nil { + return &smithy.DeserializationError{Err: err} + } + } else { + if buf, err = p.bufs.Get(resp.Body); err != nil { + return &smithy.DeserializationError{Err: err} + } + defer p.bufs.Put(buf) + } + + payload := buf.Bytes() + deser := internalhttpbinding.NewShapeDeserializer(resp.Response, bd(payload), payload) + if err := out.Deserialize(deser); err != nil { + return &smithy.DeserializationError{Err: err} + } + + return nil +} + +// HasInitialEventMessage is false for REST-style protocols with HTTP bindings. +func (*Protocol) HasInitialEventMessage() bool { + return false +} + +// SerializeEventMessage implements [smithyhttp.ClientProtocol]. +func (p *Protocol) SerializeEventMessage(schema, variant *smithy.Schema, v smithy.Serializable, w io.Writer) error { + return p.eventstream.SerializeEventMessage(schema, variant, v, w) +} + +// DeserializeEventMessage implements [smithyhttp.ClientProtocol]. +func (p *Protocol) DeserializeEventMessage(schema *smithy.Schema, types *smithy.TypeRegistry, r io.Reader) (smithy.Deserializable, error) { + return p.eventstream.DeserializeEventMessage(schema, types, r) +} + +// SerializeInitialRequest implements [smithyhttp.ClientProtocol]. +func (p *Protocol) SerializeInitialRequest(schema *smithy.Schema, v smithy.Serializable, w io.Writer) error { + return p.eventstream.SerializeInitialRequest(schema, v, w) +} + +// DeserializeInitialResponse implements [smithyhttp.ClientProtocol]. +func (p *Protocol) DeserializeInitialResponse(schema *smithy.Schema, r io.Reader, out smithy.Deserializable) error { + return p.eventstream.DeserializeInitialResponse(schema, r, out) +} + +func (p *Protocol) deserializeError(types *smithy.TypeRegistry, response *smithyhttp.Response) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := internaljson.GetProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := internaljson.ResolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = typ + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + + errorCode = internaljson.SanitizeErrorCode(errorCode) + + perr, ok := types.DeserializableError(errorCode) + if !ok { + return &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + } + + errorBody.Seek(0, io.SeekStart) + errorBytes, _ := io.ReadAll(errorBody) + + deser := internalhttpbinding.NewShapeDeserializer(response.Response, bd(errorBytes), errorBytes) + if err := perr.Deserialize(deser); err != nil { + return &smithy.DeserializationError{Err: err} + } + + return perr +} + +func bd(payload []byte) smithy.ShapeDeserializer { + if len(payload) == 0 { + payload = []byte("{}") + } + return internaljson.NewShapeDeserializer(payload, useJSONName) +} + +func useJSONName(o *internaljson.Options) { + o.UseJSONName = true +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 15985c749..78502a1bb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -33,13 +33,12 @@ github.com/alicebob/miniredis/v2/size # github.com/armon/go-metrics v0.4.1 ## explicit; go 1.12 github.com/armon/go-metrics -# github.com/aws/aws-sdk-go-v2 v1.47.4 +# github.com/aws/aws-sdk-go-v2 v1.47.5 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/aws github.com/aws/aws-sdk-go-v2/aws/defaults github.com/aws/aws-sdk-go-v2/aws/middleware github.com/aws/aws-sdk-go-v2/aws/protocol/query -github.com/aws/aws-sdk-go-v2/aws/protocol/restjson github.com/aws/aws-sdk-go-v2/aws/protocol/xml github.com/aws/aws-sdk-go-v2/aws/ratelimit github.com/aws/aws-sdk-go-v2/aws/retry @@ -60,11 +59,11 @@ github.com/aws/aws-sdk-go-v2/internal/strings github.com/aws/aws-sdk-go-v2/internal/sync/singleflight github.com/aws/aws-sdk-go-v2/internal/timeconv github.com/aws/aws-sdk-go-v2/internal/timeouts -# github.com/aws/aws-sdk-go-v2/config v1.33.6 +# github.com/aws/aws-sdk-go-v2/config v1.33.12 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/config github.com/aws/aws-sdk-go-v2/config/internal/ini -# github.com/aws/aws-sdk-go-v2/credentials v1.20.6 +# github.com/aws/aws-sdk-go-v2/credentials v1.20.12 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/credentials github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds @@ -74,17 +73,17 @@ github.com/aws/aws-sdk-go-v2/credentials/logincreds github.com/aws/aws-sdk-go-v2/credentials/processcreds github.com/aws/aws-sdk-go-v2/credentials/ssocreds github.com/aws/aws-sdk-go-v2/credentials/stscreds -# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.1 +# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.5 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/feature/ec2/imds github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config -# github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.7 +# github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.8 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/internal/configsources -# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.7 +# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.8 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 -# github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.4 +# github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.8 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/internal/v4a github.com/aws/aws-sdk-go-v2/internal/v4a/internal/crypto @@ -102,13 +101,13 @@ github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/customizations github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/endpoints github.com/aws/aws-sdk-go-v2/service/dynamodb/schemas github.com/aws/aws-sdk-go-v2/service/dynamodb/types -# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19 +# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.23 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding # github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.13.4 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery -# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.4 +# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.8 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url # github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.50.1 @@ -117,10 +116,11 @@ github.com/aws/aws-sdk-go-v2/service/secretsmanager github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints github.com/aws/aws-sdk-go-v2/service/secretsmanager/schemas github.com/aws/aws-sdk-go-v2/service/secretsmanager/types -# github.com/aws/aws-sdk-go-v2/service/signin v1.10.1 +# github.com/aws/aws-sdk-go-v2/service/signin v1.12.0 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/signin github.com/aws/aws-sdk-go-v2/service/signin/internal/endpoints +github.com/aws/aws-sdk-go-v2/service/signin/schemas github.com/aws/aws-sdk-go-v2/service/signin/types # github.com/aws/aws-sdk-go-v2/service/ssm v1.81.0 ## explicit; go 1.24 @@ -128,22 +128,24 @@ github.com/aws/aws-sdk-go-v2/service/ssm github.com/aws/aws-sdk-go-v2/service/ssm/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ssm/schemas github.com/aws/aws-sdk-go-v2/service/ssm/types -# github.com/aws/aws-sdk-go-v2/service/sso v1.38.1 +# github.com/aws/aws-sdk-go-v2/service/sso v1.39.0 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/sso github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints +github.com/aws/aws-sdk-go-v2/service/sso/schemas github.com/aws/aws-sdk-go-v2/service/sso/types -# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.1 +# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.0 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/ssooidc github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints +github.com/aws/aws-sdk-go-v2/service/ssooidc/schemas github.com/aws/aws-sdk-go-v2/service/ssooidc/types -# github.com/aws/aws-sdk-go-v2/service/sts v1.51.1 +# github.com/aws/aws-sdk-go-v2/service/sts v1.51.6 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/sts github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sts/types -# github.com/aws/smithy-go v1.28.6 +# github.com/aws/smithy-go v1.28.7 ## explicit; go 1.24 github.com/aws/smithy-go github.com/aws/smithy-go/auth @@ -180,8 +182,10 @@ github.com/aws/smithy-go/traits github.com/aws/smithy-go/transport/http github.com/aws/smithy-go/transport/http/internal/io github.com/aws/smithy-go/transport/http/protocol/awsjson +github.com/aws/smithy-go/transport/http/protocol/internal/httpbinding github.com/aws/smithy-go/transport/http/protocol/internal/json github.com/aws/smithy-go/transport/http/protocol/internal/json/internal/stdlib +github.com/aws/smithy-go/transport/http/protocol/restjson1 github.com/aws/smithy-go/waiter # github.com/beorn7/perks v1.0.1 ## explicit; go 1.11